save « Component « JPA Q&A





1. Problem on saving entity containing collection of components    forum.hibernate.org

Hello! Suppose I have a many-to-many realtion between the two classes A and B. The association itself has an attribute, so I decide to model the association as an association-class C. Now I decided to map this scenario with the approach recommended in the Hibernate Reference (chapter 7.2): "A special case of a composite element is a composite element with a ...

2. Properties within dynamic-component and Save/Update    forum.hibernate.org

Hi, I am wondering if it actually is supposed to work to have properties within a dynamic component and use these properties when saving/updating a object. There is no problems retriving data, the errors occur when trying to save/update. I recieve a sql exeption stating the value cannot be null (column setting), but the value has been set in the map. ...

3. save/update object with lazy components    forum.hibernate.org

Not sure if this will solve your lazy loading problem, but... If your Session is still open you don't need to call update (or saveOrUpdate). Either commit the transaction or flush the session (depending on you autocommit setting in the db) will save any changes you made to the object. If like me you came to Hib' from an EJB 1.1 ...