-->
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: Sibling objects in Hibernate
PostPosted: Mon May 07, 2007 1:34 pm 
Newbie

Joined: Fri Oct 20, 2006 12:55 pm
Posts: 12
Hey everyone,

I have a problem in an accounting system where I have ledger entries, but each ledger entry needs to know about its opposing entry, ie

public class LedgerEntry
{
/**
* @hibernate.many-to-one column="opposing_entry_id" not-null="false" lazy="false" cascade="none"
*/

private LedgerEntry opposingEntry;
}

but this generates the error :
"not-null property references a null or transient value: com.mypackage.LedgerEntry.opposingEntry" which is to be expected since Hibernate has to choose an order by which to persist the ledger entries. A ledger entry also has to know about its JournalEntry. JournalEntry and LedgerEntry have a parent/child one-to-many relationship, while LedgerEntries have "sibling" relationships with other LedgerEntries that have the same parent. Does anybody have any experience with this sort of thing or any ideas on how I can map it in Hibernate and have Hibernate automatically update the IDs correctly so that I don't have this transient value error ? I'd really appreciate any help. Thank you kindly.


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.