-->
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: catalog attribute is sometimes ignored
PostPosted: Thu Jun 25, 2009 8:41 am 
Newbie

Joined: Thu Jun 25, 2009 7:22 am
Posts: 9
Hello users,

I encountered the following problem with the catalog attribute in a hibernate mapping.

Consider the following example: You have configure hibernate to use 2 databases ("db1" and "db2") where "db1" is the default one. And you have defined a mapping for a class "A" that is mapped to a table "tab_a" in database "db2" via the catalog attribute. Then everything works fine as long as you use simple HQL queries like "select a from A a". Hibernate uses "db2.tab_a" as table identification. But when you try to retrieve the number of persistent instances of A via "select count(a) from A a" hibernate forget to add the database name in front of the table name. Thus you get an SQL error that table "tab_a" does not exist in database "db1".

I think this is a bug in hibernate. What do you think?

Regards,
xylo

hibernate version: 3.3.2.GA


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.