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.