February 20th, 2013, 12:59 AM
Query without schema prefix in front of table works fine on Mac OS X but not on Linux
I'm using Java Hibernate ORM with Postgres and run into a problem having to do with schemas and table names.
The SQL generated by Hibernate looks like this:
Hibernate: select resourceit0_.CONFIG_ID as CONFIG1_0_1_, resourceit0_.RES_ID as RES2_18_1_, (select a12.URI from RESOURCE a12 where a12.ID=resourceit0_.RES_ID) as formula1_1_, resourceit1_.ID as ID5_0_, resourceit1_.description as descript2_5_0_, resourceit1_.INPUT_REF as INPUT3_5_0_, resourceit1_.name as name5_0_, resourceit1_.size as size5_0_, resourceit1_.SRC_URI as SRC6_5_0_, resourceit1_.status as status5_0_, resourceit1_.STATUS_MSG as STATUS8_5_0_, resourceit1_.type as type5_0_, resourceit1_.URI as URI5_0_ from smd.RESOURCE_SIM_CONFIG resourceit0_ inner join smd.RESOURCE resourceit1_ on resourceit0_.RES_ID=resourceit1_.ID where resourceit0_.CONFIG_ID=?
As you can see it doesn't prefix the inner select (select a12.URI from RESOURCE...) with the schema name.. it should be smd.RESOURCE as the others. Seems like a bug in Hibernate but at the same time, this query works fine on MAc OS X with java/hibernate 4.2.0 and postgres 8.4 but not on Linux using the same configuration.
Is there any config I can do on the server, so as to not touch the zillions of lines of Hibernate code to get this to work?