TransientObjectException « Map « JPA Q&A





1. Hibernate - ManyToOne - Save - org.hibernate.TransientObjectException:    stackoverflow.com

While I try to save top level entity (using JPA), do I need to get the ManyToOne mapped entity freshly from database and set it or cannot I just set Id ...

3. ManyToOne - Save - org.hibernate.TransientObjectException    forum.hibernate.org

While I try to save top level entity (using JPA - hibernate), do I need to get the ManyToOne mapped entity freshly from database and set it or cannot I just set Id (of manyToOne mapped entity and save top level entity? When do not get fresh entity it throws: org.hibernate.TransientObjectException: Table structures we are using: DEPARTMENT(DEPARTMENT_ID BIGINT, NAME VARCHAR(128)) EMPLOYEE(EMPLOYEE_ID ...