title: JPA One to one update operation
body: <p>I want to update the employee via Parkingspace, but I do not succeed.  Why can't I update the employee over the parking space?</p>
  
  <p><strong>Employee Class</strong></p>
  
  <pre><code>@Entity
  public class Employee {
  @Id
  @GeneratedValue(strategy=GenerationType.TABLE)
  private int id;
  private String name;
  private String surname;
  private int salary;
  
  @OneToOne(fetch = FetchType.LAZY)
  @JoinColumn(name="park_id", unique=true)
  private ParkingSpace parkingSpace;
   ...getter/setter
  
     }
  </code></pre>
  
  <p><strong>Parkingspace Class</strong></p>
  
  <pre><code>@Entity
  public class ParkingSpace {
  @Id
  @GeneratedValue(strategy = GenerationType.TABLE)
  private int id;
  private int parkingLot;
  private String location;
  @OneToOne(mappedBy = "parkingSpace",cascade = CascadeType.ALL, 
          fetch = FetchType.LAZY, optional = false)
  private Employee employee;
  ....getter/setter
  }
  </code></pre>
  
  <p>I want to update the employee via Parkingspace, but I do not succeed.There is no change in the database.</p>
  
  <pre><code>...........
  entityTransaction.begin();
  parkingSpace.setEmployee(employee);
  entityTransaction.commit();
  .....
  </code></pre>