@Override
protected void configure(Configuration configuration) {
super.configure(configuration);
configuration.setProperty(AvailableSettings.SHOW_SQL, Boolean.TRUE.toString());
configuration.setProperty(AvailableSettings.FORMAT_SQL, Boolean.TRUE.toString());
configuration.setProperty(AvailableSettings.STATEMENT_BATCH_SIZE, "2");
}
@Test
public void hhhXXXTest() throws Exception {
try (Session s = openSession()) {
Transaction tx = s.beginTransaction();
EntityA ownerA1 = new EntityA();
EntityA entityA1 = new EntityA();
EntityA ownerA2 = new EntityA();
EntityA entityA2 = new EntityA();
s.persist(ownerA1);
s.persist(ownerA2);
s.persist(entityA1);
s.persist(entityA2);
s.flush();
entityA1.propertyA = 1;
entityA2.owners.add(ownerA2);
tx.commit();
}
}