Hibernate Books

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: Issue with where attribute in 0.8.* (worked in 0.7.*)
PostPosted: Thu May 19, 2005 6:18 am 
Newbie

Joined: Thu May 19, 2005 6:04 am
Posts: 14
Location: Glasgow, UK
I am using the where attribute on class mappings extensively (as we use an InUse column to flag a row as being deleted, rather than actually deleting it for security reasons).

each of my class maps declares this like so:

<class name="User, Types" table="USERS" where="INUSE=1">

This works exactly as expected in NHibernate 0.7.*, but I recently did a build using 0.8.3 and on running I received the following message (from the log file):

Exception: System.Data.OracleClient.OracleException
Message: ORA-00936: missing expression


The problem appears to be down to the SQL being generated (again from the log):

SELECT this.USER_ID as USER_ID0_, this.SURNAME as SURNAME0_, this.ADDEDBY as ADDEDBY0_, this.LASTUPDATEDBY as LASTUPDA7_0_, this.FIRSTNAME as FIRSTNAME0_, this.DATEADDED as DATEADDED0_, this.INUSE as INUSE0_, this.PAYNUMBER as PAYNUMBER0_, this.DATELASTUPDATED as DATELAST8_0_ FROM USERS this WHERE 1=1 AND and this.INUSE=1

notice the "AND and" in the query.

If I revert to 0.7 this starts working again.

Mark


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 6:21 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
The "and and" bug should have been fixed in 0.8.3, please try that version. Be warned though that 0.8.3 still has another bug that affects Oracle. The bug was fixed in CVS and the fix will be part of 0.8.4 (scheduled to be packaged and released on Sunday or Monday).


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 8:05 am 
Newbie

Joined: Thu May 19, 2005 6:04 am
Posts: 14
Location: Glasgow, UK
sergey, thanks for the quick response. You're right I'm using 0.8.0, thought was up to date, but I think I can wait for the other fix in 0.8.4 next week.

Cheers

Mark


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.