I'm using DataNucleus as my persistence layer (JDO) and am forced to use Oracle 11g as a database (using 11g XE for development). Unfortunately since version 11.2 the default length semantics (NLS_LENGTH_SEMANTICS) for VARCHAR columns have been set to byte instead of char which means that all columns that only provide a size will result in a type definition like this:
VARCHAR2(50 byte)
instead of:
VARCHAR2(50 char)
From Oracle's perspective the solution is threefold:
- declare a unit in your size definiton (what I'm trying to achieve with JDO metadata)
- alter the
NLS_LENGTH_SEMANTICSattribute on every session - alter the
NLS_LENGTH_SEMANTICSattribute globally (which seems not to work with the "Express Edition", I've already wasted a whole day on this)
I've searched the Mapping and Persistence Documention up and down to find metadata attributes that let me do this. I can specify jdbcType, sqlType and of course length for a column. But no unit.
Any help would be greatly appreciated.