When I was developing the Simulation Model System (SimModSys), I faced this issue.
I'm from the school that believes that the database should be developed first and independently from the system, to serve the purpose of maintaining the data integrity, and the application should integrate to the existing database to apply logic on the data, but not to force how the data should be represented. So I designed the database first ignoring that there were issues between Hibernate and Postgres capital letters.
Instead of changing the database I decided to fight for it, after all it was a learning personal project.
I received a partial answer that I completed later at StackOverflow. In short, what you have to do is the following:
- Escape every table that has capital letters (using \"):
- Escape every field that has capital letters (using \"):
- Escape joins that include columns that have capital letters (strangely, using `):
It is a tedious work. This worked for me with PostgreSQL 9.1.9, Hibernate 4.1.3 and Java 7.
For a complete example you can review the code at BitBucket of any of the classes of the SimModSys project's persistence package.
English Hibernate Java PostgreSQL Simulation Model System Troubleshooting