[jboss-user] [EJB 3.0] New message: "howto setup jpa using oracle 10g unicode nvarchar2"

Michael Glöckner do-not-reply at jboss.com
Mon Feb 22 08:05:15 EST 2010


User development,

A new message was posted in the thread "howto setup jpa using oracle 10g unicode nvarchar2":

http://community.jboss.org/message/527586#527586

Author  : Michael Glöckner
Profile : http://community.jboss.org/people/michael.gloeckner

Message:
--------------------------------------------------------------
Hello folks,
 
i like to setup jpa to use oracles nvarchar2 datatyp for string columns. Im using ejb3.0 and oracle 10.2.0.4.0
 
 
I already tried the suggestions made in http://community.jboss.org/message/489679#489679, but the only think which worked out was the following annotation added to the specific String variables.
 
@Column(columnDefinition="nvarchar2")
 
 

 
But this would force me to implement the source code in a oracle database depended way.
Is there any standard way to customize the datasource or the persistence.xml so the jpa framework is switching automatically to nvarchar2.
 
my persistence.xml looks like:
 
   <persistence-unit name="MyPersistentUnit" transaction-type="JTA">
       <jta-data-source>java:/MyDS</jta-data-source>
       <properties>
            <property name="hibernate.hbm2ddl.auto" value="create"/> 
             <property name="hibernate.show_sql" value="true"/>
             <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/> 
            <property name="jboss.entity.manager.factory.jndi.name" value="java:/MyEjbTestEntityManagerFactory"/>
       </properties>
   </persistence-unit>


My ds.xml file looks like:
 <xa-datasource>
    <jndi-name>MyDS</jndi-name>
    <track-connection-by-tx/>
    <isSameRM-override-value>false</isSameRM-override-value>
    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
    <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:XE</xa-datasource-property>
    <xa-datasource-property name="User">user</xa-datasource-property>
    <xa-datasource-property name="Password">password</xa-datasource-property>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <no-tx-separate-pools/>
  </xa-datasource>

 
Thanks in advanced,
Micha

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/527586#527586




More information about the jboss-user mailing list