-->
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: Cast in formula
PostPosted: Wed May 09, 2007 2:02 pm 
Newbie

Joined: Thu Jul 27, 2006 2:04 pm
Posts: 4
Here is a snippet of my mapping file

Code:
...
<property name = "terminationDate" column="MAST_TERMINATION_DATE" type="date" />
<property name = "memberTypeCode" column ="MT_CODE" type="string"/>
<property name="active">
         <formula>
               case when (select mt.MT_MBR_NMBR_IND from MX_MEMBER_TYPE  mt where mt.MT_CODE = MT_CODE) = 'Y'
                  then
                     case when (MAST_TERMINATION_DATE &gt; sysDate or MAST_TERMINATION_DATE is null) and (MAST_DROP_DATE &gt;sysDate or MAST_DROP_DATE is null)
                         then 'Active'
                         else
                           case when (MAST_TERMINATION_DATE + (select cast(sd.sd_value as integer) from mx_site_defaults sd where sd.sd_code ='gracePeriod') &lt; sysDate or MAST_DROP_DATE &lt; sysDate) and (MAST_GRACE_OVERRIDE_IND ='N')
                               then 'In-Active'
                               else
                                   case when ((MAST_TERMINATION_DATE &lt; sysDate) and (MAST_TERMINATION_DATE + (select cast(sd.sd_value as integer) from mx_site_defaults sd where sd.sd_code ='gracePeriod') &gt; sysDate) and (MAST_DROP_DATE &gt; sysDate or MAST_DROP_DATE is null)) or (MAST_GRACE_OVERRIDE_IND ='Y')
                                       then 'Grace'
                                   end
                               end
                     end
               end
         </formula>
      </property>
....


when the file is parsed the cast part does not seem to parse correctly
it comes out as
Code:
cast (sd.value as this_.integer)


does any one has any clue how to work around this. I am working with hibernate 3.2.2ga and oracle 10g express. The error during runtime is
Code:
WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 902, SQLState: 42000>
ERROR [org.hibernate.util.JDBCExceptionReporter] - <ORA-00905: missing keyword>


Thanks for your help


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.