You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Michael Duffy <du...@yahoo.com> on 2003/03/19 22:00:41 UTC

m:n Question

I've got an m:n association that's causing me a
problem.

Let's say I have two Java classes, A and B, that have
underlying database tables and an m:n association
between them.  Both A and B have members of type
java.util.Collection that maintain references to the
other.

I have a constructor for A that allows me to create an
empty collection of B references.  

When I test creating and storing an instance of class
A with an empty collection of B references OJB throws
a java.util.NoSuchElementException: "Thrown by the
nextElement method of an Enumeration to indicate that
there are no more elements in the enumeration."

Does OJB not allow me to persist an instance of class
A which has no references to class B, or have I made
another newbie mistake?   Thank you. - MOD


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com