Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Type conversion Oracle NVARCHAR2
Type conversion Oracle NVARCHAR2 [message #510109] Tue, 26 January 2010 10:01 Go to next message
Richard Wood is currently offline Richard Wood
Messages: 29
Registered: January 2010
Junior Member
Hello

I'm trying to make Eclipselink convert from NVARCHAR2 columns to java.lang.String
Say for example to store japanese characters.

It seems that Eclipselink supports this with Oracle platform support, ie class Oracle9Platform and the use of oracle.jdbc.OraclePreparedStatement.setFormUse(...)

The question is how do I activate it?

I'm using following annotations
@org.eclipse.persistence.annotations.TypeConverter(name = "nvarchar", dataType=org.eclipse.persistence.platform.database.oracle.NString.class, objectType=String.class )

@Basic
@org.eclipse.persistence.annotations.Convert("nvarchar")
@Column(name = "COMMENT", columnDefinition = "NVARCHAR2(1333)")


Thanks for any support
Richard
Re: Type conversion Oracle NVARCHAR2 [message #510331 is a reply to message #510109] Wed, 27 January 2010 05:03 Go to previous message
Richard Wood is currently offline Richard Wood
Messages: 29
Registered: January 2010
Junior Member
To answer my own question

You need to specify the Oracle version in persistence.xml.
"Oracle" is not enough

<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.oracle.Oracle11Platform"/>


Previous Topic:Howto call nontransactional Call in JTA Environment?
Next Topic:Problem with indirect (lazy) mappings
Goto Forum:
  


Current Time: Tue Sep 02 03:02:07 EDT 2014

Powered by FUDForum. Page generated in 0.11774 seconds