Search in sources :

Example 1 with ThingOne

use of org.apache.tapestry5.jpa.test.entities.ThingOne 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);
}
Also used : ThingOne(org.apache.tapestry5.jpa.test.entities.ThingOne) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 2 with ThingOne

use of org.apache.tapestry5.jpa.test.entities.ThingOne 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);
}
Also used : ThingOne(org.apache.tapestry5.jpa.test.entities.ThingOne) CommitAfter(org.apache.tapestry5.jpa.annotations.CommitAfter)

Example 3 with ThingOne

use of org.apache.tapestry5.jpa.test.entities.ThingOne in project tapestry-5 by apache.

the class JpaTest method trySomething.

@Test
public void trySomething() {
    ThingOne thingOne = new ThingOne();
    thingOne.setId(1);
    PersistedEntity entity = JpaInternalUtils.convertApplicationValueToPersisted(entityManagerManager, thingOne);
}
Also used : PersistedEntity(org.apache.tapestry5.internal.jpa.PersistedEntity) ThingOne(org.apache.tapestry5.jpa.test.entities.ThingOne) Test(org.testng.annotations.Test)

Aggregations

ThingOne (org.apache.tapestry5.jpa.test.entities.ThingOne)3 CommitAfter (org.apache.tapestry5.jpa.annotations.CommitAfter)2 PersistedEntity (org.apache.tapestry5.internal.jpa.PersistedEntity)1 Test (org.testng.annotations.Test)1