It is not possible to copy a table with NVARCHAR field(s) to an HSQLDB database. During table creation in the target I get the error:
Copy failed: No Dialect mapping for JDBC type: -9 (NVARCHAR)
This probably also happens for NCHAR, NCLOB and LONGNVARCHAR
I have seen that the mapping is hard-coded in the CommonHibernateDialect implementations.
I fixed this for me by adding following line in the constructor of HSQLDialectExt:
registerColumnType(Types.NVARCHAR, "varchar");
I have mapped this to varchar because HSQLDB uses by default unicode encoding for character strings:
HyperSQL's default character set is Unicode, therefore all possible character strings can be represented by these types.
(http://hsqldb.org/doc/guide/guide.html)
Also the content of the tab data types displays this mapping:
TYPE_NAME DATA_TYPE PRECISION LITERAL_PREFIX LITERAL_SUFFIX CREATE_PARAMS
NVARCHAR 12 [VARCHAR] 2147483647 ' ' LENGTH
Perhaps it is possible to let the user configure this mapping in future.
I just released a new snapshot that contains the changes you suggested, see:
https://sourceforge.net/projects/squirrel-sql/files/3-snapshots/snapshot-20160821_2336/
It would be great if you could give it a try and let me know if the changes work.
Thanks
Gerd
Hi Gerd,
Thanks. I have tested it and it works now.
Perhaps it makes sense to adapt the lines
to
and add
registerColumnType(Types.NCLOB, "longvarchar");Regards
Florian