@Test public void itShouldSaveOneSetAssociatedtoMultipleCompetitionGroups() { daoTestRule.inTransaction(() -> { CompetitionGroupHibernateEntity entity1 = HibernateEntityTestUtils.fullCompetitionGroup(); entity1.setId(null); entityDao.create(entity1); CompetitionGroupHibernateEntity entity2 = HibernateEntityTestUtils.fullCompetitionGroup(); entity2.setId(null); entityDao.create(entity2); assertThat(entity1.getId()).isNotEqualTo(entity2.getId()); CompetitionGroupSetHibernateEntity setEntity = HibernateEntityTestUtils.fullCompetitionGroupSet(); setEntity.setId(null); setEntity.setCompetitionGroups(Sets.newHashSet(entity1, entity2)); setDao.create(setEntity); }); }
@Override public void create(CompetitionGroupSetHibernateEntity entity) { persist(entity); }
CompetitionGroupSetDao extends BaseHibernateEntityDao<CompetitionGroupSetHibernateEntity> { @Override public void create(CompetitionGroupSetHibernateEntity entity) { persist(entity); } }
CompetitionGroupSetDao extends BaseHibernateEntityDao<CompetitionGroupSetHibernateEntity> { @Override public void create(CompetitionGroupSetHibernateEntity entity) { persist(entity); } @Inject  CompetitionGroupSetDao(SessionFactory sessionFactory); }
CompetitionGroupSetDao extends BaseHibernateEntityDao<CompetitionGroupSetHibernateEntity> { @Override public void create(CompetitionGroupSetHibernateEntity entity) { persist(entity); } @Inject  CompetitionGroupSetDao(SessionFactory sessionFactory); @Override void create(CompetitionGroupSetHibernateEntity entity); @Override List<CompetitionGroupSetHibernateEntity> findAll(); @Override CompetitionGroupSetHibernateEntity findById(String id); }
CompetitionGroupSetDao extends BaseHibernateEntityDao<CompetitionGroupSetHibernateEntity> { @Override public void create(CompetitionGroupSetHibernateEntity entity) { persist(entity); } @Inject  CompetitionGroupSetDao(SessionFactory sessionFactory); @Override void create(CompetitionGroupSetHibernateEntity entity); @Override List<CompetitionGroupSetHibernateEntity> findAll(); @Override CompetitionGroupSetHibernateEntity findById(String id);  }