Let me setup the scenario before asking the questions
First off I'm using an older version of Hibernate Hibernate Version:3.6.10.Final
I have a questionnaire / person tables that have a one to one relationship with each other.
Here's my Questionnaire table (Partial of course) and only the relevant part.
@Entity
public class Questionnaire {
...
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "person_id")
private Person person;
...
}
Here's my Person table (Partial of course) and only the relevant part.
@Entity
public class Person {
...
@OneToOne(cascade = {CascadeType.ALL}, fetch = FetchType.LAZY, optional = false)
@JoinColumn(name="questionnaireInfo_id", unique=true)
private QuestionnaireInfo questionnaireInfo;
....
}
If I update the questionnaire object and save the questionaire entity (not using HQL or any SQL type syntax) will it also update my person table as well and lock that table when it saves? [even if the id of person remains the same as before]
I'm using PostgreSQL 9.5.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit