开发者

create table in ibatis with array data type

I'm trying to use ibatis with HSSQL to create a table in an in memory database at runtime but using the following returns an error, presumably because the square brackets confuse Ibatis, which results in a SQLException: Incorrect syntax near 'ARRAY'

CREATE TABLE GROUPS (id INT PRIMARY KEY, members bigint ARRAY DEFAULT ARRAY[])

I tried escaping in XML like this but got the same error:

<![CDATA[ CREATE TABLE MATCHGROUPS (id INT PRIMARY KEY, groupid bigint ARRAY DEFAULT ARRAY[], members bigint ARRAY DEFAULT ARRAY[]) ]]>

Anyone know a way to work around this? I'd like to keep the design consistent and 开发者_开发知识库not resort to a raw query for this case if possible. I've checked that the sql runs fine in HSSQL manager so it's the right sql syntax.

Thanks in advance


The CDATA excape actually does work, I discovered a mistake I made somewhere else that was causing the misleading error!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜