-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: <delimited-identifiers/> isn´t working on Hibernate 4.0.0CR2
PostPosted: Wed Nov 23, 2011 1:49 pm 
Newbie

Joined: Tue Sep 13, 2011 2:16 pm
Posts: 5
Good afternoon,

I am trying migrate from JbosAS 5.1 to JbossAS 7.0.2 with Hibernate 4.0.0CR2. My database is SQLServer 2008 with collate Latin1_General_BIN (case-sensitive).

The problem is that my table names are in UPPER-CASE and the annotation @Table(name = "TESTE") is not respecting the UPPER_CASE so I am getting the error:

Quote:
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'teste'.


After some search I found the propertie <delimited-identifiers/> specified in JPA 2.0 and I tried:

orm.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" version="2.0">
   <persistence-unit-metadata>
      <persistence-unit-defaults>
         <delimited-identifiers/>
      </persistence-unit-defaults>
   </persistence-unit-metadata>
</entity-mappings>



persisntence.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
   <persistence-unit name="GoPointsConfig" transaction-type="RESOURCE_LOCAL">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <non-jta-data-source>java:jboss/datasources/TesteDS</non-jta-data-source>
      <mapping-file>META-INF/orm.xml</mapping-file>
      <class>com.goPoints.configuracao.entity.Teste</class>
      <exclude-unlisted-classes>true</exclude-unlisted-classes>
      <properties>
         <property name="hibernate.globally_quoted_identifiers" value="true"/>
      </properties>      
   </persistence-unit>
</persistence>


But this property is not working and I am still having the same error.
I also tried change the annotation @Table(name = "TESTE") to @Table(name = "\"TESTE\""), but it didn´t work too.

How can I do to make things work?

Should I open an issue on Hibernate Jira?

Tks.. sorry about my english.

OBS: I changed the hibernate version to 4.0.0.CR6 and didn´t work too.


Top
 Profile  
 
 Post subject: Re: <delimited-identifiers/> isn´t working on Hibernate 4.0.0CR2
PostPosted: Tue Nov 29, 2011 12:45 pm 
Newbie

Joined: Tue Sep 13, 2011 2:16 pm
Posts: 5
Should I open an issue on Jira?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.