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.  [ 2 posts ] 
Author Message
 Post subject: Error in Formula parsing
PostPosted: Wed Jun 13, 2007 10:57 am 
Beginner
Beginner

Joined: Wed May 03, 2006 5:10 am
Posts: 32
Location: Monopoli - Italy
I'm having some problems creating computed properties using the FORMULA attribute of the Property element.

I have the following class:

Code:
  <class name="ObjectModel.Asset.AssetBase, ObjectModel" table="Asset_AssetBase">
..........
    <property name="ExpiryDate" column="ExpiryDate" type="DateTime" />
    <property name="IsAlive" formula="(CASE WHEN ExpiryDate IS NULL THEN 1 ELSE 0 END)" type="Boolean" />


but NHibernate translates it by the query
Code:
([this_1_].CASE [this_1_].WHEN [this_1_].ExpiryDate IS NULL [this_1_].THEN 1 [this_1_].ELSE 0 [this_1_].END) as f0_4_,


Any suggestions to solve the problem?

Antonella

Hibernate version: 1.0.4


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 14, 2007 5:03 am 
Beginner
Beginner

Joined: Wed May 03, 2006 5:10 am
Posts: 32
Location: Monopoli - Italy
Solved using IsDate

Code:
<property name="IsAlive" formula="(ISDATE(ExpiryDate)+1)%2" type="Boolean" />


Thanks
Antonella


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.