use of com.blazebit.persistence.testsuite.entity.PolymorphicSub1 in project blaze-persistence by Blazebit.
the class UpdatePolymorphicTest method setUp.
@Before
public void setUp() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
// Table per class data
TPCSub1 tpc1 = new TPCSub1(1L, "TPC1");
TPCSub2 tpc2 = new TPCSub2(2L, "TPC2");
em.persist(tpc1);
em.persist(tpc2);
// Joined data
PolymorphicSub1 joined1 = new PolymorphicSub1();
PolymorphicSub2 joined2 = new PolymorphicSub2();
joined1.setName("JOINED1");
joined2.setName("JOINED2");
em.persist(joined1);
em.persist(joined2);
// Single table data
PolymorphicPropertySub1 st1 = new PolymorphicPropertySub1();
PolymorphicPropertySub2 st2 = new PolymorphicPropertySub2();
st1.setName("ST1");
st2.setName("ST2");
em.persist(st1);
em.persist(st2);
}
});
}
use of com.blazebit.persistence.testsuite.entity.PolymorphicSub1 in project blaze-persistence by Blazebit.
the class TreatedCorrelatedSubqueryTest method setUpOnce.
@Override
protected void setUpOnce() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
PolymorphicSub1 root1 = new PolymorphicSub1();
PolymorphicSub1 parent1 = new PolymorphicSub1();
root2 = new PolymorphicSub1();
PolymorphicSub2 parent2 = new PolymorphicSub2();
root1.setSub1Value(1);
root1.setParent(parent1);
root2.setSub1Value(2);
root2.setParent(parent2);
em.persist(parent1);
em.persist(parent2);
em.persist(root1);
em.persist(root2);
parent2.setParent2(root1);
}
});
}
use of com.blazebit.persistence.testsuite.entity.PolymorphicSub1 in project blaze-persistence by Blazebit.
the class TreatedEntityJoinTest method setUpOnce.
@Override
protected void setUpOnce() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
PolymorphicSub1 root1 = new PolymorphicSub1();
PolymorphicSub1 parent1 = new PolymorphicSub1();
root2 = new PolymorphicSub1();
PolymorphicSub2 parent2 = new PolymorphicSub2();
root1.setSub1Value(1);
root1.setParent(parent1);
root2.setSub1Value(2);
root2.setParent(parent2);
em.persist(parent1);
em.persist(parent2);
em.persist(root1);
em.persist(root2);
}
});
}
use of com.blazebit.persistence.testsuite.entity.PolymorphicSub1 in project blaze-persistence by Blazebit.
the class DeletePolymorphicTest method setUp.
@Before
public void setUp() {
cleanDatabase();
transactional(new TxVoidWork() {
@Override
public void work(EntityManager em) {
// Table per class data
tpc1 = new TPCSub1(1L, "TPC1");
tpc2 = new TPCSub2(2L, "TPC2");
em.persist(tpc1);
em.persist(tpc2);
// Joined data
joined1 = new PolymorphicSub1();
joined2 = new PolymorphicSub2();
joined1.setName("JOINED1");
joined2.setName("JOINED2");
em.persist(joined1);
em.persist(joined2);
// Single table data
st1 = new PolymorphicPropertySub1();
st2 = new PolymorphicPropertySub2();
st1.setName("ST1");
st2.setName("ST2");
em.persist(st1);
em.persist(st2);
}
});
}
Aggregations