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.  [ 3 posts ] 
Author Message
 Post subject: How to use properties from parent class in formula-field in
PostPosted: Fri Aug 04, 2006 3:39 pm 
Newbie

Joined: Fri Aug 04, 2006 3:06 pm
Posts: 2
I use hibernate 1.0.2. I have such situation - I Have a class and it's child - joined-subclass and I need to create formula in childs property which uses property from parent class.
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="CoreIMSEE.Domain.Partner, CoreIMSEE.Domain" table="PARTNER">
<id name="Id" column="ID" unsaved-value="0" access="field.camelcase">
<generator class="native" />
</id>

<timestamp name="timestamp" column="TS" access="field"/>


<property name="Name" column="NAME" type="String" length="100" not-null="true" />

<joined-subclass name="CoreIMSEE.Domain.Customer, CoreIMSEE.Domain" table="CUSTOMER">
<key column="ID" />

<property name="Name2" column="NAME2" />
<property name="Name3" column="NAME3" />
<property name="customerName" formula="Name + ' ' + Name2 + ' ' + Name3" insert="false" update="false" type="String" access="field" />
</joined-subclass>

</class>

This formula is incorrect because in SQL I found that it uses alias from Customer table instead of Parent table alias so I got error. How can I solve this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 9:07 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
are you using that calculated property in a HQL query? if not, the simplest workaround is to not map that property at all. Simply do the "calculation" in the property getter of your object.

cheers,
radu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 10:50 am 
Newbie

Joined: Fri Aug 04, 2006 3:06 pm
Posts: 2
radu wrote:
are you using that calculated property in a HQL query? if not, the simplest workaround is to not map that property at all. Simply do the "calculation" in the property getter of your object.

cheers,
radu

I use it to filter data and to sort data ny this field.


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