Skip to content

Instantly share code, notes, and snippets.

@jnorthrup
Created February 28, 2011 04:11
Show Gist options
  • Save jnorthrup/846925 to your computer and use it in GitHub Desktop.
Save jnorthrup/846925 to your computer and use it in GitHub Desktop.
static delegate for jpa em
@Transactional
public void persist() {
ModelTx.persist(this);
}
@Transactional
public void flush() {
ModelTx.flush();
}
public static final EntityManager entityManager() {
return ModelTx.entityManager();
}
@Transactional
public void remove() {
ModelTx.remove(this,TwImage.class);
}
@Transactional
public TwImage merge() {
return ModelTx.merge(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment