@Test public void itShouldSaveOneSetAssociatedtoMultipleHandicapGroups() { daoTestRule.inTransaction(() -> { HandicapGroupHibernateEntity entity1 = HibernateEntityTestUtils.fullHandicapGroup(); entity1.setId(null); entityDao.create(entity1); HandicapGroupHibernateEntity entity2 = HibernateEntityTestUtils.fullHandicapGroup(); entity2.setId(null); entityDao.create(entity2); assertThat(entity1.getId()).isNotEqualTo(entity2.getId()); HandicapGroupSetHibernateEntity setEntity = HibernateEntityTestUtils.fullHandicapGroupSet(); setEntity.setId(null); setEntity.setHandicapGroups(Sets.newHashSet(entity1, entity2)); setDao.create(setEntity); }); }
@Override public void create(HandicapGroupSetHibernateEntity entity) { persist(entity); }
HandicapGroupSetDao extends BaseHibernateEntityDao<HandicapGroupSetHibernateEntity> { @Override public void create(HandicapGroupSetHibernateEntity entity) { persist(entity); } }
HandicapGroupSetDao extends BaseHibernateEntityDao<HandicapGroupSetHibernateEntity> { @Override public void create(HandicapGroupSetHibernateEntity entity) { persist(entity); } @Inject  HandicapGroupSetDao(SessionFactory sessionFactory); }
HandicapGroupSetDao extends BaseHibernateEntityDao<HandicapGroupSetHibernateEntity> { @Override public void create(HandicapGroupSetHibernateEntity entity) { persist(entity); } @Inject  HandicapGroupSetDao(SessionFactory sessionFactory); @Override void create(HandicapGroupSetHibernateEntity entity); @Override List<HandicapGroupSetHibernateEntity> findAll(); @Override HandicapGroupSetHibernateEntity findById(String id); }
HandicapGroupSetDao extends BaseHibernateEntityDao<HandicapGroupSetHibernateEntity> { @Override public void create(HandicapGroupSetHibernateEntity entity) { persist(entity); } @Inject  HandicapGroupSetDao(SessionFactory sessionFactory); @Override void create(HandicapGroupSetHibernateEntity entity); @Override List<HandicapGroupSetHibernateEntity> findAll(); @Override HandicapGroupSetHibernateEntity findById(String id);  }