Hibernate version: 3
DB: Postgres 8.1
I have some mappings to columns like notMCPS that are causing these kind of errors:
Code:
Caused by: org.postgresql.util.PSQLException: ERROR: column label0_1_.notmcps does not exist
My column definition includes the correct name:
Quote:
@Column(name = "notMCPS", unique = false, nullable = true, insertable = true, updatable = true)
They ocurr because hibernate's generated sql is lowercasing all column names.
The problem is similar in a psql client, your column names are lowercased automatically, unless you put them in quotes. If I run the same query as hibernate (lowercase names) it fails, if i do
select "notMCPS" from blah it works perfectly.
So I guess my question is, how can I force hibernate to respect the case on field names? Or is there any other workaround for this? Unfortunately renaming columns is not an option.
Thanks.