Finally getting back to this issue.
I talked some more with one of my stake holders and discussed wants / vs needs in regards to national character support. We broke this problem down into two separate issues. The first and most important is table creation. They need a generic way to tell the EclipseLink runtime to create String columns as a type that will support national character types (a la unicode). Since they are writing code that will run against any number of databases, it isn't a viable option to specify this information in a @Column annotation (or xml). Unfortunately support for unicode column types isn't fully standard across the range of supported databases. For example, to be able to store the following Java String "\u215c" each database needs to have a column defined in this way:
Oracle: NVARCHAR2
DB2: VARCHAR
Derby: VARCHAR
MySQL: NVARCHAR
Informix: NVARCHAR
Sybase: NVARCHAR
SQLServer: NVARCHAR
This is problem #1 and can be mostly implemented by way of a new property that can be set on the DatabasePlatform to change how Strings are mapped and each Platform will need to be updated. This only addresses the problem from a table creation point of view.
Problem #2 is more involved and entails adding runtime support for JDBC 4.0 setN, etc methods. For the sake of keeping a targeted discussion, I'm going to table issue #2 till the future when myself/others have more time to add full jdbc4.0 support.
Without a proper solution for #2, we still have something workable by relying on each JDBC driver to handle unicode values for us. Nearly all of the databases mentioned have some way to configure the driver to properly handle unicode values. Example:
Oracle: jvm property -Doracle.jdbc.defaultNChar=true
Derby: none
MySQL: jdbc connection property characterEncoding=utf8
SQLServer: jdbc connection property (default) sendStringParametersAsUnicode=true
Informix: unknown
Sybase: unknown
DB2: none
Woa, sorry for the wall of text here... hopefully I didn't scare everyone away. Long story short, I need to add support to the runtime to generically specify that I want all Strings to be mapped to a unicode supporting type.
Thoughts?
Rick