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
|