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.
|