-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Using hibernate.default_schema but sql still wrong
PostPosted: Tue Feb 19, 2013 1:39 am 
Newbie

Joined: Mon Feb 02, 2009 3:03 am
Posts: 3
Hi,

I'm using Hibernate 3.3.1 and Hibernate-Annotations 3.4.0 and Postgres 8.4. I stumbled upon a problem where my queries were resulting in

Code:
Caused by: org.postgresql.util.PSQLException: ERROR: relation "resource" does not exist


Once I added

Quote:
<property name="hibernate.default_schema">smd</property>


to my configuration most problems went away. However, I see I'm still having problems with some queries involving many to one relationships.

Code:
select resourceit0_.CONFIG_ID as CONFIG1_1_, resourceit0_.RES_ID as RES2_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_ left outer join smd.RESOURCE resourceit1_ on resourceit0_.RES_ID=resourceit1_.ID where resourceit0_.CONFIG_ID=?


You can see that the inner select
Quote:
(select a12.URI from RESOURCE a12 where a12.ID=resourceit0_.RES_ID)


is not prefixed appropriately with "smd."

What should I do?

Thanks, Jason


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.