Unfortunately I am not able to persuade Hibernate to use field access for my embedded object (moving @Embedded to field or adding @AccessType doesn't help). But using common sense it can not work with that.
Also I have a small modification to the workaround - we will use a bit more semantically correct version alternative (instead of ignoring _null_ value, we will interpret it as a an "_empty object_"): {code} public void setMyEmbeddedObject(MyEmbeddedObject myEmbeddedObject) { this.myEmbeddedObject = (myEmbeddedObject != null) ? myEmbeddedObject : new MyEmbeddedObject(); } {code}
|