29303132333435363738
@Inject private Session _session; void onCreateEntity() { User user = new User(); user.setFirstName("name"); _session.save(user); _user = user; }
42434445464748
// avoid having the changes saved if the request transaction is committed _session.evict(_user); } void onSetToTransient() { _user = new User(); }
363738394041424344
@Inject private Session _session; void onSuccess() { User user = new User(); user.setFirstName(_name); _session.save(user); }
293031323334353637
@SuppressWarnings("unused") @Property private User _user; void onCreate() { User user = new User(); user.setFirstName("name"); _session.save(user); }
373839404142434445464748
@Inject private Request request; void onPersistEntity() { User user = new User(); user.setFirstName("name"); userDAO.add(user); this.user = user; }
52535455565758
user = null; } void onSetToTransient() { user = new User(); }
32333435363738394041
private User user; @CommitAfter void onCreate() { User user = new User(); user.setFirstName("name"); session.save(user); }
394041424344454647484950
@Inject private HibernateSessionManager manager; void onCreateEntity() { User user = new User(); user.setFirstName("name"); userDAO.add(user); this.user = user; }
353637383940414243444546
414243444546474849505152
@Inject private HibernateSessionManager manager; void onSuccess() { User user = new User(); user.setFirstName(name); session.save(user); manager.commit(); }