@Test public void itShouldAddAddRegistrationsForSameCarAtSameEvents() { RegistrationHibernateEntity registrationOfCarOwner = buildUnsavedRegistration(); RegistrationHibernateEntity registrationOfCoDriver = buildUnsavedRegistration(); registrationOfCoDriver.setCar(registrationOfCarOwner.getCar()); daoTestRule.inTransaction(() -> { dao.create(registrationOfCarOwner); dao.create(registrationOfCoDriver); }); }
@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();  }