Search in sources :

Example 1 with DocumentInfo

use of com.blazebit.persistence.testsuite.entity.DocumentInfo in project blaze-persistence by Blazebit.

the class PaginationOneToOneTest method setUpOnce.

@Override
public void setUpOnce() {
    cleanDatabase();
    transactional(new TxVoidWork() {

        @Override
        public void work(EntityManager em) {
            DocumentForOneToOne doc1 = new DocumentForOneToOne("doc1");
            DocumentForOneToOne doc2 = new DocumentForOneToOne("doc2");
            Person p1 = new Person("owner");
            doc1.setOwner(p1);
            doc2.setOwner(p1);
            DocumentInfo o1 = new DocumentInfo(1L, doc2, "Karl1");
            DocumentInfo o2 = new DocumentInfo(2L, doc1, "Karl2");
            em.persist(p1);
            em.persist(doc1);
            em.persist(doc2);
            em.persist(o1);
            em.persist(o2);
        }
    });
}
Also used : EntityManager(javax.persistence.EntityManager) TxVoidWork(com.blazebit.persistence.testsuite.tx.TxVoidWork) DocumentForOneToOne(com.blazebit.persistence.testsuite.entity.DocumentForOneToOne) Person(com.blazebit.persistence.testsuite.entity.Person) DocumentInfo(com.blazebit.persistence.testsuite.entity.DocumentInfo)

Aggregations

DocumentForOneToOne (com.blazebit.persistence.testsuite.entity.DocumentForOneToOne)1 DocumentInfo (com.blazebit.persistence.testsuite.entity.DocumentInfo)1 Person (com.blazebit.persistence.testsuite.entity.Person)1 TxVoidWork (com.blazebit.persistence.testsuite.tx.TxVoidWork)1 EntityManager (javax.persistence.EntityManager)1