-->
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.  [ 4 posts ] 
Author Message
 Post subject: saving properties mapped with using formula tag
PostPosted: Wed Jul 14, 2004 4:27 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
hi all,
suppose I have
Table A: id, name, bID (class A: id, name, bName)
Table B: bID,name,work, address,..... ( no B class)

<class A ....

<property name= "bName" formula = "(Select b.NAME from B where b.bID = bID)" ...
..

Here I load the B.name value for A's bname property.
When I try to save A object, the bID field of the row in A is empty since I did a mapping with a formula tag. That is normal, but I wonder that what can I do to solve that problem.
1- I should map that attribute by using an association, then fine?(I mean to write a B class)
2 - But if I use formula, what can I do to fill the bID field of table A in saving?

thanks..

_________________
-developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 6:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I'd say use a proper association. This is note easily doable with a formula.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 8:13 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
yes I know it is easily doable with association.
I wonder about the performance.
What can u say about the break points of the performance?
I think using a formula or a association have nearly equal time consumes.

_________________
-developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 9:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can always outer-join fetch the association, which should be quite equal to a subselect.


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