@Test @Ignore("Deferring work on this, see https: public void itShouldThrowWhenEventAndSequenceNotUnique() throws InterruptedException { RunHibernateEntity entity1 = buildUnsavedRun(); entity1.setSequence(1); RunHibernateEntity entity2 = buildUnsavedRun(); entity2.setSequence(1); assertThat(entity1.getEvent()).isSameAs(entity2.getEvent()); assertThat(entity1.getSequence()).isEqualTo(entity2.getSequence()); try { daoTestRule.inTransaction(() -> { dao.create(entity1); dao.create(entity2); failBecauseExceptionWasNotThrown(PersistenceException.class); }); } catch (Exception e) { assertThat(e) .isInstanceOf(PersistenceException.class) .hasCauseInstanceOf(ConstraintViolationException.class); } }
@Override public void create(RunHibernateEntity entity) { persist(entity); }
RunDao extends BaseHibernateEntityDao<RunHibernateEntity> { @Override public void create(RunHibernateEntity entity) { persist(entity); } }
RunDao extends BaseHibernateEntityDao<RunHibernateEntity> { @Override public void create(RunHibernateEntity entity) { persist(entity); } @Inject  RunDao(SessionFactory sessionFactory); }
RunDao extends BaseHibernateEntityDao<RunHibernateEntity> { @Override public void create(RunHibernateEntity entity) { persist(entity); } @Inject  RunDao(SessionFactory sessionFactory); @Override void create(RunHibernateEntity entity); @Override List<RunHibernateEntity> findAll(); @Override RunHibernateEntity findById(String id); RunHibernateEntity findLastInSequenceFor(EventHibernateEntity event); RunHibernateEntity findFirstInSequenceWithoutRawTime(EventHibernateEntity event); List<RunHibernateEntity> getAllWith(EventHibernateEntity event); List<RunHibernateEntity> getAllWith(RegistrationHibernateEntity registration); }
RunDao extends BaseHibernateEntityDao<RunHibernateEntity> { @Override public void create(RunHibernateEntity entity) { persist(entity); } @Inject  RunDao(SessionFactory sessionFactory); @Override void create(RunHibernateEntity entity); @Override List<RunHibernateEntity> findAll(); @Override RunHibernateEntity findById(String id); RunHibernateEntity findLastInSequenceFor(EventHibernateEntity event); RunHibernateEntity findFirstInSequenceWithoutRawTime(EventHibernateEntity event); List<RunHibernateEntity> getAllWith(EventHibernateEntity event); List<RunHibernateEntity> getAllWith(RegistrationHibernateEntity registration);  }