use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.
the class CachedForm method onSuccess.
@CommitAfter
void onSuccess() {
User user = new User();
user.setFirstName(name);
session.save(user);
}
use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.
the class EncodeEntities method onCreate.
@CommitAfter
void onCreate() {
User user = new User();
user.setFirstName("name");
session.save(user);
}
use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.
the class GridDemo method onActionFromSetup.
@CommitAfter
void onActionFromSetup() {
userDAO.deleteAll();
for (int i = 1; i <= 20; i++) {
User user = new User();
String suffix = String.valueOf(i);
user.setFirstName("Joe_" + suffix);
user.setLastName("User");
user.setEncodedPassword("####");
user.setEmail("joe" + suffix + "@null.com");
session.persist(user);
}
}
use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.
the class TopLevelServiceImpl method createThingOneAndTwo.
@Override
@CommitAfter
public void createThingOneAndTwo(String nameOne, String nameTwo) {
ThingOne thingOne = new ThingOne();
thingOne.setName(nameOne);
em.persist(thingOne);
nestedService.createThingTwo(nameTwo);
}
use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.
the class TopLevelServiceImpl method createThingOneThenTwo.
@Override
@CommitAfter
public void createThingOneThenTwo(final String nameOne, final String nameTwo) {
entityTransactionManager.invokeAfterCommit(null, new Invokable<Boolean>() {
@Override
public Boolean invoke() {
nestedService.createThingTwo(nameTwo);
return true;
}
});
ThingOne thingOne = new ThingOne();
thingOne.setName(nameOne);
em.persist(thingOne);
}
Aggregations