What is the standard way to implement simple update?
Example: we have User with phone number NNNNNN and now we want to set it to YYYYYY.
@PersistenceContext
private EntityManager em;
public void update (User transientUser) {
what should be here?
}
User entity is as simple as possible:
@Entity
@Table (name = "USER")
public class User {
@Id
@GeneratedValue
private Integer id;
@Column (nullable = false, unique = true)
private String login;
private String phone;
public User () { }
... //some setters and getters
}