-->
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: Property formula does not get evaluated
PostPosted: Thu Apr 19, 2007 9:42 am 
Newbie

Joined: Wed Apr 11, 2007 5:34 am
Posts: 2
I have 2 database tables CSCustomInfo and CSCustomInfoValue. They both have a foreign key to another table CSFieldRegistry. In my CustomInfoValue mapping file, I want to have a property which will check if I have any record in CSCustomInfo for a given CSCustomInfoValue record.

I have written valueInUse property in my hbm xml which uses formula. But when I fetch records from CSCustomInfoValue, the valueInUse always returns null. Am I doing something wrong?

My CustomInfoValue.hbm.xml looks like



<?xml version="1.0" encoding="UTF-8"?>

<hibernate-mapping>
<class
name="com.customfield.CustomInfoValue"
table="cscustominfovalue"
>
<meta attribute="sync-DAO">false</meta>

<property
name="Value"
column="Value"
type="string"
not-null="false"
/>
<property
name="ShortName"
column="ShortName"
type="string"
not-null="false"
length="50"
/>

<property
name="valueInUse"
type="java.lang.Integer"
formula="select ci.ID from CSCustomInfo ci where ci.CSFieldRegistryID = FieldRegistry.ID"
insert="false"
update="false"
/>

<many-to-one
name="fieldRegistry"
column="CSFieldRegistryID"
class="com.customfield.FieldRegistry"
not-null="false"
>
</many-to-one>


</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 10:11 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
Formula attribute can accept a sql expression and I am not sure how the value for "FieldRegistry.ID" will be fetched.


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.