-->
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.  [ 3 posts ] 
Author Message
 Post subject: Class mapping with where clause not honored?
PostPosted: Sat Sep 03, 2005 10:28 am 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
Hi guys,

I've got a class mapping with a where clause in it like the follwing:

Code:
<class name="Customer" table="Customers" lazy="true" where="Deleted = 0">


As I understand it any query, get or load should append "Deleted = 0" to the end of any SQL statements generated...strangely this is not happening. I've got the log output set to debug and it's showing the SQL statement that will be executed as <i>not</i> having the additional clause.

Is this a bug, or have I misunderstood how this works?

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 03, 2005 1:37 pm 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
OK, after further testing I find that the where clause <i>is</i> being honored, but only on HQL queries - using the Get or Load methods of the session will not honour the where clause.

Again, is this by design or a bug?

Cheers,

Symon


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 10:24 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Judging from code, it appears Hibernate 2.1 does this too, so I would say it's by design. But I can't tell myself whether it's right or not.


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

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.