If you want to associate the objects, you of course have to set both sides of the association manually!
How should this
Code:
sub.setSuperPerson(super);
if (sub.getSuperPerson().equlas(super))
logger.debug("that works fine");
if (!super.getSubPerson().contains(sub))
logger.debug("and that does not!");
ever work, that is just java.
You have to do:
Code:
sub.setSuperPerson(super);
super.getSubPerson().add(sub);
if (sub.getSuperPerson().equlas(super))
logger.debug("that works fine");
if (!super.getSubPerson().contains(sub))
logger.debug("and that does not!");