-->
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.  [ 1 post ] 
Author Message
 Post subject: Join on indeterminate column value
PostPosted: Wed Jan 10, 2007 4:53 am 
Newbie

Joined: Tue Oct 03, 2006 2:57 am
Posts: 4
Consider the following situation:

Quote:
Account -|------0<- Transaction


An account has 0 or more transactions associated with it.

In my Hibernate mapping, an Account's Transactions are modelled as a set, with account_id as the join column between the two. So when I call:
Code:
anAccount.getTransactions()
I get a (lazy) Collection of _all_ the Transaction associated with that account.


Transactions have transaction dates.

Is there a way I can (cleanly) model in Hibernate that the join should be done on a known column ("trade_dt") whose value will vary from call to call.

Ultimately, can I acheive something like this?
Code:
anAccount.getTransactions(tradeDate)


I use hbm2java to generate Java classes from my Hibernate mappings.

Any help appreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.