@Test public void itShouldAddAddRegistrationsForSameCarAtDifferentEvents() { RegistrationHibernateEntity registrationAtEvent1 = buildUnsavedRegistration(); EventHibernateEntity event2 = HibernateEntityTestUtils.fullEvent(); event2.setId(null); event2.setHandicapGroupSet(prerequisites.handicapGroupSet); event2.setCompetitionGroupSet(prerequisites.competitionGroupSet); RegistrationHibernateEntity registrationAtEvent2 = buildUnsavedRegistration(); registrationAtEvent2.setEvent(event2); registrationAtEvent2.setCar(registrationAtEvent1.getCar()); daoTestRule.inTransaction(() -> { dao.create(registrationAtEvent1); eventDao.create(event2); dao.create(registrationAtEvent2); }); }
@Override public void create(RegistrationHibernateEntity registration) { persist(registration); }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } @Inject  RegistrationDao(SessionFactory sessionFactory); }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } @Inject  RegistrationDao(SessionFactory sessionFactory); @Override RegistrationHibernateEntity findById(String id); List<RegistrationHibernateEntity> getAllWith(EventHibernateEntity event); @Override void create(RegistrationHibernateEntity registration); @Override List<RegistrationHibernateEntity> findAll(); }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } @Inject  RegistrationDao(SessionFactory sessionFactory); @Override RegistrationHibernateEntity findById(String id); List<RegistrationHibernateEntity> getAllWith(EventHibernateEntity event); @Override void create(RegistrationHibernateEntity registration); @Override List<RegistrationHibernateEntity> findAll();  }