Issue Type: Bug Bug
Affects Versions: 4.1.6
Assignee: Unassigned
Created: 28/Sep/12 3:38 AM
Description:

In our project there are many tables with case sensitive fields. After upgrading from Hibernate 3.5.6 to Hibernate 4.1.7 problem arise. Symptom is that read and update operations work perfect, but save operation (which leads to insert SQL statement) finishs with the exception:

org.postgresql.util.PSQLException: The column name "TableID" was not found in this ResultSet.
	at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2550)

Here "TableID" is the name of the primery key in the entity:

Entity.java
@Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name="`TableID`" )
    private int             id;

While debuging I found that insert statment finishs successfuly and problem appear when Hibernate tries to get generated id from DB. In the ResultSet there is such field with correct value with the name "TableID" BUT the name of field that is quired by Hibernate is "\"TableID\"" with additional " characters. The strings are different (they has even different length). That is why the column is not found in the result set and exception raises. The same problem was absent in the previos (3.5.6) release (and also in early releases).
May be there is the way to configure Hibernate to resolve the issue? It seems that this is the bug that should be fixed ASAP.
The problem is not concerned with the postgres driver. With 3.5.6 version all works just fine, and with the 4.1.7 appears.

Environment: Hibernate 4.1.7 (also in 4.1.6), Postgres 8.4
Project: Hibernate ORM
Labels: hibernate
Priority: Major Major
Reporter: Yuriy Drohobytskiy
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira