Search in sources :

Example 11 with CommitAfter

use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.

the class GridDemo method onActionFromSetup.

@CommitAfter
@PersistenceContext(unitName = AppConstants.TEST_PERSISTENCE_UNIT)
void onActionFromSetup() {
    userDAO.deleteAll();
    for (int i = 1; i <= 20; i++) {
        final User user = new User();
        final String suffix = String.valueOf(i);
        user.setFirstName("Joe_" + suffix);
        user.setLastName("User");
        user.setEncodedPassword("####");
        user.setEmail("joe" + suffix + "@null.com");
        entityManager.persist(user);
    }
}
Also used : User(org.example.app1.entities.User) PersistenceContext(javax.persistence.PersistenceContext) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 12 with CommitAfter

use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.

the class PersistAll method onCreateUser.

@CommitAfter
void onCreateUser() {
    final User user = new User();
    user.setFirstName("Foo User");
    entityManager.persist(user);
    this.user = user;
}
Also used : User(org.example.app1.entities.User) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 13 with CommitAfter

use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.

the class PersistAll method onCreateItem.

@CommitAfter
void onCreateItem() {
    final Item item = new Item();
    item.setName("Bar Item");
    entityManager.persist(item);
    this.item = item;
}
Also used : Item(org.example.app2.entities.Item) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 14 with CommitAfter

use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.

the class PersistItem method onCreateEntity.

@CommitAfter
void onCreateEntity() {
    final Item item = new Item();
    item.setName("name");
    entityManager.persist(item);
    this.item = item;
}
Also used : Item(org.example.app2.entities.Item) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 15 with CommitAfter

use of org.apache.tapestry5.jpa.annotations.CommitAfter in project tapestry-5 by apache.

the class PersistItem2 method onCreateEntity.

@CommitAfter
void onCreateEntity() {
    final Item item = new Item();
    item.setName("name");
    entityManager.persist(item);
    this.item = item;
}
Also used : Item(org.example.app2.entities.Item) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Aggregations

CommitAfter (org.apache.tapestry5.jpa.annotations.CommitAfter)17 PersistenceContext (javax.persistence.PersistenceContext)8 User (org.example.app1.entities.User)4 Item (org.example.app2.entities.Item)4 CommitAfter (org.apache.tapestry5.hibernate.annotations.CommitAfter)3 User (org.example.app0.entities.User)3 User (org.example.app6.entities.User)3 ThingOne (org.apache.tapestry5.jpa.test.entities.ThingOne)2 Thang (org.example.app1.entities.Thang)2 Thing (org.example.app3.model.Thing)1 Thang (org.example.app6.entities.Thang)1