-->
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 based on other table
PostPosted: Fri Aug 20, 2004 3:07 pm 
Newbie

Joined: Fri Aug 20, 2004 12:18 pm
Posts: 1
Hi,

How would I handle a situation where my object needs to have a property that is based on information in another table in a somewhat complex way :)

For example, say you had an Account object that represents the account of one user and one property of that is how much that user has spent buying stuff from you. That property would then be a sum of all of the amounts in a purchases table/object rather than an actual item in the account table.

Would I just put code in the set/get methods in the Account object to query the purchases table and set this, or is there another way to accomplish this?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 20, 2004 3:52 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
if you need this only for read, take a look at formula attribute on the mapping file

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.