Exemplo n.º 1
0
 @Override
 public void delete(final ENTITY entity) {
   LOG.info(
       "Removing {}.entity with id: {}, {}",
       getEntityClass().getSimpleName(),
       entity.getId(),
       entity);
   persistenceManager.remove(entity);
 }
Exemplo n.º 2
0
  @Override
  public PagedResult<ENTITY> getEntities(final MultiplePagedSearch<ENTITY> pagedSearch) {
    LOG.info("Getting paged result for {}: {}", getEntityClass().getSimpleName(), pagedSearch);

    String querySql = queryBuilder.build(pagedSearch);
    Query<ENTITY> queries = new Query<ENTITY>(getEntityClass(), querySql);

    MultiplePagedQuerySearch<ENTITY> pagedQuerySearch =
        new MultiplePagedQuerySearch<ENTITY>(
            queries,
            pagedSearch.getOffset(),
            pagedSearch.getLimit(),
            pagedSearch.getParameters(),
            getEntityClass());

    return persistenceManager.search(pagedQuerySearch);
  }
Exemplo n.º 3
0
 @Override
 public void save(final ENTITY entity) {
   LOG.info("Saving {}.entity: {}", getEntityClass().getSimpleName(), entity);
   persistenceManager.create(entity);
 }