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 > sysDate or MAST_TERMINATION_DATE is null) and (MAST_DROP_DATE >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') < sysDate or MAST_DROP_DATE < sysDate) and (MAST_GRACE_OVERRIDE_IND ='N')
then 'In-Active'
else
case when ((MAST_TERMINATION_DATE < sysDate) and (MAST_TERMINATION_DATE + (select cast(sd.sd_value as integer) from mx_site_defaults sd where sd.sd_code ='gracePeriod') > sysDate) and (MAST_DROP_DATE > 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