use of com.blazebit.persistence.testsuite.tx.TxVoidWork in project blaze-persistence by Blazebit.
the class NullSubviewTest method setUpOnce.
@Override
public void setUpOnce() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
doc1 = new Document("doc1");
Person o1 = new Person("pers1");
o1.getLocalized().put(1, "localized1");
doc1.setOwner(o1);
em.persist(o1);
em.persist(doc1);
}
});
}
use of com.blazebit.persistence.testsuite.tx.TxVoidWork in project blaze-persistence by Blazebit.
the class SubviewEntityViewSettingTest method setUpOnce.
@Override
public void setUpOnce() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
Document doc1 = new Document("MyTest");
Document doc2 = new Document("YourTest");
Document doc3 = new Document("HisTest");
Person o1 = new Person("DocumentViewer");
Person o2 = new Person("DocumentOwnerMaster");
Person o3 = new Person("DocumentOwnerSlave");
o1.getLocalized().put(1, "localized1");
o2.getLocalized().put(1, "localized2");
o1.setPartnerDocument(doc1);
o2.setPartnerDocument(doc2);
doc1.setOwner(o1);
doc2.setOwner(o2);
doc3.setOwner(o3);
doc1.getContacts().put(1, o1);
doc2.getContacts().put(1, o2);
doc3.getContacts().put(1, o3);
doc1.getContacts2().put(2, o1);
doc2.getContacts2().put(2, o2);
doc3.getContacts2().put(2, o3);
em.persist(o1);
em.persist(o2);
em.persist(o3);
em.persist(doc1);
em.persist(doc2);
em.persist(doc3);
}
});
}
use of com.blazebit.persistence.testsuite.tx.TxVoidWork in project blaze-persistence by Blazebit.
the class SubviewTest method setUpOnce.
@Override
public void setUpOnce() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
doc1 = new Document("doc1");
doc2 = new Document("doc2");
Person o1 = new Person("pers1");
Person o2 = new Person("pers2");
Person o3 = new Person("pers3");
Person o4 = new Person("pers4");
o1.getLocalized().put(1, "localized1");
o2.getLocalized().put(1, "localized2");
o1.setPartnerDocument(doc1);
o2.setPartnerDocument(doc2);
o3.setPartnerDocument(doc1);
o4.setPartnerDocument(doc2);
doc1.setOwner(o1);
doc2.setOwner(o2);
doc1.getContacts().put(2, o1);
doc2.getContacts().put(2, o2);
doc1.getContacts2().put(1, o1);
doc2.getContacts2().put(1, o2);
doc1.getContacts2().put(2, o3);
doc2.getContacts2().put(2, o4);
em.persist(o1);
em.persist(o2);
em.persist(o3);
em.persist(o4);
doc1.getPartners().add(o1);
doc1.getPartners().add(o3);
doc2.getPartners().add(o2);
doc2.getPartners().add(o4);
doc1.getPeople().add(o1);
doc1.getPeople().add(o2);
doc2.getPeople().add(o3);
doc2.getPeople().add(o4);
em.persist(doc1);
em.persist(doc2);
}
});
}
use of com.blazebit.persistence.testsuite.tx.TxVoidWork in project blaze-persistence by Blazebit.
the class BasicViewPaginationTest method setUpOnce.
@Override
public void setUpOnce() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
doc1 = new Document("doc1");
Person o1 = new Person("pers1");
doc1.setAge(10);
doc1.setOwner(o1);
doc1.getContacts().put(1, o1);
doc1.getContacts2().put(2, o1);
em.persist(o1);
em.persist(doc1);
em.persist(new Document("doc2", o1));
}
});
}
use of com.blazebit.persistence.testsuite.tx.TxVoidWork in project blaze-persistence by Blazebit.
the class BasicPredicatedTest method setUpOnce.
@Override
public void setUpOnce() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
doc1 = new DocumentForCollections("doc1");
doc2 = new DocumentForCollections("doc2");
PersonForCollections o1 = new PersonForCollections("pers1");
PersonForCollections o2 = new PersonForCollections("pers2");
PersonForCollections o3 = new PersonForCollections("pers3");
PersonForCollections o4 = new PersonForCollections("pers4");
o1.setPartnerDocument(doc1);
o2.setPartnerDocument(doc2);
o3.setPartnerDocument(doc1);
o4.setPartnerDocument(doc2);
doc1.setOwner(o1);
doc2.setOwner(o2);
doc1.getContacts().put(0, o1);
doc2.getContacts().put(0, o2);
doc1.getContacts().put(1, o3);
doc2.getContacts().put(1, o4);
em.persist(o1);
em.persist(o2);
em.persist(o3);
em.persist(o4);
doc1.getPartners().add(o1);
doc1.getPartners().add(o3);
doc2.getPartners().add(o2);
doc2.getPartners().add(o4);
doc1.getPersonList().add(o1);
doc1.getPersonList().add(o2);
doc2.getPersonList().add(o3);
doc2.getPersonList().add(o4);
em.persist(doc1);
em.persist(doc2);
}
});
}
Aggregations