@Test public void deleteByIdTest() throws Exception { Player player = createPlayer(); dao.saveOrUpdate(player); UnitOfWorks.getCurrent().transactionalFlush(); UnitOfWorks.getCurrent().clearSession(); dao.deleteById(Player.class, player.getId()); UnitOfWorks.getCurrent().transactionalFlush(); UnitOfWorks.getCurrent().clearSession(); Player loaded = dao.get(Player.class, player.getId()); assertThat(loaded).isNull(); }
@Override public void deleteById(Class<?> clazz, Serializable id) { Object entity = getFullTextSession().load(clazz, id); delete(entity); }
HibernateOgmDao implements IHibernateOgmDao { @Override public void deleteById(Class<?> clazz, Serializable id) { Object entity = getFullTextSession().load(clazz, id); delete(entity); } }
HibernateOgmDao implements IHibernateOgmDao { @Override public void deleteById(Class<?> clazz, Serializable id) { Object entity = getFullTextSession().load(clazz, id); delete(entity); }  }
HibernateOgmDao implements IHibernateOgmDao { @Override public void deleteById(Class<?> clazz, Serializable id) { Object entity = getFullTextSession().load(clazz, id); delete(entity); }  @Override synchronized final Session getSession(); @Override synchronized final FullTextSession getFullTextSession(); @Override final QueryBuilder getQueryBuilder(Class<?> clazz); @Override FullTextQuery getFullTextQuery(Query luceneQuery, Class<?>... entities); @Override T get(Class<T> clazz, Serializable id); @Override List<T> find(Class<T> clazz); @Override List<T> find(Class<T> clazz, Query luceneQuery); @Override List<T> find(Class<T> clazz, Query luceneQuery, Sort luceneSort); @Override List<T> find(Class<T> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort); @Override List<T> find(Class<T> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort, Criteria criteria); @Override List<Serializable> findIds(Class<?> clazz, Query luceneQuery); @Override List<Serializable> findIds(Class<?> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort); @Override List<Serializable> findIds(Class<?> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort, Criteria criteria); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields, Sort luceneSort); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields, Sort luceneSort, Criteria criteria); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields,
                                          int firstResult, int maxResults, Sort luceneSort, Criteria criteria); @Override IPagedList<T> getPage(Class<T> clazz, Query luceneQuery, int pageNo, int pageSize); @Override IPagedList<T> getPage(Class<T> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort); @Override IPagedList<T> getPage(Class<T> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort, Criteria criteria); @Override IPagedList<Serializable> getIdPage(Class<?> clazz, Query luceneQuery, int pageNo, int pageSize); @Override IPagedList<Serializable> getIdPage(Class<?> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort); @Override IPagedList<Serializable> getIdPage(Class<?> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort, Criteria criteria); @Override IPagedList<Object[]> getProjectionPage(Class<?> clazz, Query luceneQuery, String[] fields, int pageNo, int pageSize); @Override IPagedList<Object[]> getProjectionPage(Class<?> clazz, Query luceneQuery, String[] fields, int pageNo, int pageSize, Sort luceneSort); @Override IPagedList<Object[]> getProjectionPage(Class<?> clazz, Query luceneQuery, String[] fields,
                                                  int pageNo, int pageSize, Sort luceneSort, Criteria criteria); @Override long count(Class<?> clazz); @Override long count(Class<?> clazz, Query luceneQuery); @Override long count(Class<?> clazz, Query luceneQuery, Criteria criteria); @Override boolean exists(Class<?> clazz); @Override boolean exists(Class<?> clazz, Query luceneQuery); @Override void persist(Object entity); @Override Object merge(Object entity); @Override Serializable save(Object entity); @Override void saveOrUpdate(Object entity); @Override void update(Object entity); @Override void delete(Object entity); @Override void deleteById(Class<?> clazz, Serializable id); @Override void deleteByIds(Class<?> clazz, Collection<? extends Serializable> ids); @Override void deleteAll(Class<?> clazz); @Override void deleteAll(Class<?> clazz, Query luceneQuery); @Override void deleteAll(Collection<?> entities); @Override void purge(Class<?> clazz, Serializable id); @Override void purgeAll(Class<?> clazz); @Override void flushToIndexes(); @Override void index(T entity); @Override void indexAll(Class<?> clazz, int batchSize); @Override Future<Void> indexAllAsync(final Class<?> clazz, final int batchSize); @Override void clearIndex(Class<?> clazz); @Override void clearIndexAll(); @Override void optimize(Class<?> clazz); @Override void optimizeAll(); @Override void flush(); @Override void flushIndexes(); }
HibernateOgmDao implements IHibernateOgmDao { @Override public void deleteById(Class<?> clazz, Serializable id) { Object entity = getFullTextSession().load(clazz, id); delete(entity); }  @Override synchronized final Session getSession(); @Override synchronized final FullTextSession getFullTextSession(); @Override final QueryBuilder getQueryBuilder(Class<?> clazz); @Override FullTextQuery getFullTextQuery(Query luceneQuery, Class<?>... entities); @Override T get(Class<T> clazz, Serializable id); @Override List<T> find(Class<T> clazz); @Override List<T> find(Class<T> clazz, Query luceneQuery); @Override List<T> find(Class<T> clazz, Query luceneQuery, Sort luceneSort); @Override List<T> find(Class<T> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort); @Override List<T> find(Class<T> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort, Criteria criteria); @Override List<Serializable> findIds(Class<?> clazz, Query luceneQuery); @Override List<Serializable> findIds(Class<?> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort); @Override List<Serializable> findIds(Class<?> clazz, Query luceneQuery, int firstResult, int maxResults, Sort luceneSort, Criteria criteria); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields, Sort luceneSort); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields, Sort luceneSort, Criteria criteria); @Override List<Object[]> findProjections(Class<?> clazz, Query luceneQuery, String[] fields,
                                          int firstResult, int maxResults, Sort luceneSort, Criteria criteria); @Override IPagedList<T> getPage(Class<T> clazz, Query luceneQuery, int pageNo, int pageSize); @Override IPagedList<T> getPage(Class<T> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort); @Override IPagedList<T> getPage(Class<T> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort, Criteria criteria); @Override IPagedList<Serializable> getIdPage(Class<?> clazz, Query luceneQuery, int pageNo, int pageSize); @Override IPagedList<Serializable> getIdPage(Class<?> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort); @Override IPagedList<Serializable> getIdPage(Class<?> clazz, Query luceneQuery, int pageNo, int pageSize, Sort luceneSort, Criteria criteria); @Override IPagedList<Object[]> getProjectionPage(Class<?> clazz, Query luceneQuery, String[] fields, int pageNo, int pageSize); @Override IPagedList<Object[]> getProjectionPage(Class<?> clazz, Query luceneQuery, String[] fields, int pageNo, int pageSize, Sort luceneSort); @Override IPagedList<Object[]> getProjectionPage(Class<?> clazz, Query luceneQuery, String[] fields,
                                                  int pageNo, int pageSize, Sort luceneSort, Criteria criteria); @Override long count(Class<?> clazz); @Override long count(Class<?> clazz, Query luceneQuery); @Override long count(Class<?> clazz, Query luceneQuery, Criteria criteria); @Override boolean exists(Class<?> clazz); @Override boolean exists(Class<?> clazz, Query luceneQuery); @Override void persist(Object entity); @Override Object merge(Object entity); @Override Serializable save(Object entity); @Override void saveOrUpdate(Object entity); @Override void update(Object entity); @Override void delete(Object entity); @Override void deleteById(Class<?> clazz, Serializable id); @Override void deleteByIds(Class<?> clazz, Collection<? extends Serializable> ids); @Override void deleteAll(Class<?> clazz); @Override void deleteAll(Class<?> clazz, Query luceneQuery); @Override void deleteAll(Collection<?> entities); @Override void purge(Class<?> clazz, Serializable id); @Override void purgeAll(Class<?> clazz); @Override void flushToIndexes(); @Override void index(T entity); @Override void indexAll(Class<?> clazz, int batchSize); @Override Future<Void> indexAllAsync(final Class<?> clazz, final int batchSize); @Override void clearIndex(Class<?> clazz); @Override void clearIndexAll(); @Override void optimize(Class<?> clazz); @Override void optimizeAll(); @Override void flush(); @Override void flushIndexes();  }