| EclipseLink - SQL Server - Unicode? [message #633029] |
Fri, 15 October 2010 03:30  |
David Safranek Messages: 6 Registered: October 2010 |
Junior Member |
|
|
Hi all,
I am working on a Java/NetBeans project that uses EclipseLink as a persistence provider and Microsoft SQL Server as a database. Unfortunately I am not able to configure String to be stored as NVARCHAR. EclipseLink uses its default type VARCHAR and it does not seem that there would be an easy and clean solution to this.
I have for example tried to provide my own ORM file
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
... >
<type-converter name="Unicode" data-type="NVARCHAR" object-type="String" />
</entity-mappings>
Which is ignored by EclipseLink.
So is there a way how to make EclipseLink to use Unicode? Thanks in advance for advices.
|
|
|
|
|
|
| Re: EclipseLink - SQL Server - Unicode? [message #634445 is a reply to message #633776] |
Thu, 21 October 2010 14:04  |
James Sutherland Messages: 1844 Registered: July 2009 |
Senior Member |
|
|
JPA defines the columnDefinition explicitly to supports types such as this. Given it works, it seems a little odd to be saying EclipseLink does not support this.
If you cannot set the columnDefinition, then you could use a DescriptorCustomizer, or SessionCustomizer to set the columnDefinition on the mapping's DatabaseField based on the Session's DatabasePlatform.
You could also modify, or create your own DatabasePlatform subclass to change all VARCHAR to NVARCHAR if you wish.
James : Wiki : Book : Blog
|
|
|
Powered by
FUDForum. Page generated in 0.01680 seconds