Hi All,
Im trying to implement a PreInsertEventListener to create an object a that owns an object b. I try something like this
boolean onPreInsertEvent(PreInsertEvent e) { if (e.getEntity() instanceof A){ B = new B(); // Set some values in b e.getEntity().getState[indexForB] = b ((A)e.getEntity()).setB(b); return false; } return true; }
This results in an Insert for A and an insert For B, But I was expecting that A now would containg b.id which it does not.
Am I missing something important here, or have anybode else attempted something similar? It seems to me that A is not dirty, when I actually think it should be.
cheers
|