@Test public void testForceIncrementModificationCounter() { BarEntity entity = this.testBean.create(); assertThat(entity.getId()).isNotNull(); assertThat(entity.getModificationCounter()).isEqualTo(0); BarEntity updatedEntity = this.testBean.incrementModificationCounter(entity.getId()); assertThat(updatedEntity.getModificationCounter()).isEqualTo(1); }
@Override public void forceIncrementModificationCounter(E entity) { getEntityManager().lock(entity, LockModeType.OPTIMISTIC_FORCE_INCREMENT); }
AbstractGenericDao extends QueryHelper implements GenericDao<ID, E> { @Override public void forceIncrementModificationCounter(E entity) { getEntityManager().lock(entity, LockModeType.OPTIMISTIC_FORCE_INCREMENT); } }
AbstractGenericDao extends QueryHelper implements GenericDao<ID, E> { @Override public void forceIncrementModificationCounter(E entity) { getEntityManager().lock(entity, LockModeType.OPTIMISTIC_FORCE_INCREMENT); } AbstractGenericDao(); }
AbstractGenericDao extends QueryHelper implements GenericDao<ID, E> { @Override public void forceIncrementModificationCounter(E entity) { getEntityManager().lock(entity, LockModeType.OPTIMISTIC_FORCE_INCREMENT); } AbstractGenericDao(); @PersistenceContext void setEntityManager(EntityManager entityManager); @Override E save(E entity); @Override void save(Iterable<? extends E> entities); @Override void forceIncrementModificationCounter(E entity); @Override E findOne(ID id); @Override E find(ID id); @Override E get(Ref<ID, E> reference); @Override boolean exists(ID id); List<E> findAll(); @Override List<E> findAll(Iterable<ID> ids); @Override void delete(ID id); @Override void delete(E entity); @Override void delete(Iterable<? extends E> entities); }
AbstractGenericDao extends QueryHelper implements GenericDao<ID, E> { @Override public void forceIncrementModificationCounter(E entity) { getEntityManager().lock(entity, LockModeType.OPTIMISTIC_FORCE_INCREMENT); } AbstractGenericDao(); @PersistenceContext void setEntityManager(EntityManager entityManager); @Override E save(E entity); @Override void save(Iterable<? extends E> entities); @Override void forceIncrementModificationCounter(E entity); @Override E findOne(ID id); @Override E find(ID id); @Override E get(Ref<ID, E> reference); @Override boolean exists(ID id); List<E> findAll(); @Override List<E> findAll(Iterable<ID> ids); @Override void delete(ID id); @Override void delete(E entity); @Override void delete(Iterable<? extends E> entities);  }