use of com.blazebit.persistence.testsuite.entity.PolymorphicPropertySub2 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.PolymorphicPropertySub2 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