Please help me with this. This is literally holding up sending our product to the client. I cannot be in a worse situation. I am sitting here a by myself and I am in trouble. This seems like an easy thing to fix, but I am so exhausted that I just can not seem to find my way out of this maze.. I need some help
I am creating a parent child relationship. There is a Master and a ContentDetail object. This addDetail code lives inside of my MasterObject. The MasterObject creates a ContentDetail object and then calls this method.
Now the thing to note here is that the this.details.add(contentDetail); only adds the first ContentDetail object but none of the other ones.
So when I go to persists this master child model. I get one Master and then first child (ContentDetail) object. None of the other ContentDetail objects. Please can someone help me out with this.
public void addDetail(ContentDetail contentDetail) {
logger.debug("[ContentMaster::addDetail]Entered");
contentDetail.setContentMaster(this);
this.details.add(contentDetail);
logger.debug("[ContentMaster::addDetail]Exit");
}
As a side note, and a contributing factor, the Id fields for all the ContentDetail objects being added are null, since they have not been saved to the database. This is causing my standard hibernate equals and hashcode methods to return true and 629 accordingly.
My understanding is that I am not really allowed to manual set these and that hibernate will set them when these objects are persisted, but I can not get them into the list to get persisted.. CATCH 22.. Chicken and Egg..
How do I break this deadlock.
ray