Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Support for national character types

I've been given the requirement that some users need the ability to tell EclipseLink to treat all Strings as NVARCHAR type rather than VARCHAR. I did a bit of searching around and haven't found much discussion regarding this issue. I know with some jdbc drivers I can rely on some pre jdbc-4.1 workarounds (sqlserver SendStringParametersAsUnicode), but I'd prefer to stay away from those. 

I'm wondering if anyone has a feeling for how large of a change this will be?

After thinking through this I came up with the following :

* Configuration option that is something like 'use national types for Strings'... obviously this is platform dependent. Ideally a future version of the spec will add an attribute to the @Basic type to denote that a given field needs to use national character types.
* Updates to the runtime to use proper ResultSet.get/PreparedStatement.set methods for NCHAR,
NVARCHAR, LONGNVARCHAR, and NCLOB. -- jdbc 4.1 requirement
* Updates to the runtime so that table creation uses the national types.
* SQL literals for NCHAR,NVARCHAR,LONGNVARCHAR need a 'N' prefix to the String... that being said I don't think this is an issue because it appears that we (nearly?) always convert JPQL literals to SQL parameters.


Rick Curtis

Back to the top