Skip to content

Instantly share code, notes, and snippets.

@emmanuelbernard
Created January 19, 2011 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmanuelbernard/786238 to your computer and use it in GitHub Desktop.
Save emmanuelbernard/786238 to your computer and use it in GitHub Desktop.
@Entity
public class A {
@Id @GeneratedValue(strategy=SEQUENCE)
public Integer getId() { return id; }
public void setId(Integer id) { this.id = id; }
private Integer id;
public String getName() { return name; }
private void setName(String name) { this.name = name; }
private String name;
}
Serializable id = em.unwrap(Session.class).save(a);
a.setName("Why oh why redundancy? " + id);
em.flush();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment