All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.unterrainer.commons.httpserver.daos.CountQueryBuilder Maven / Gradle / Ivy

There is a newer version: 0.3.14
Show newest version
package info.unterrainer.commons.httpserver.daos;

import javax.persistence.EntityManagerFactory;

import info.unterrainer.commons.rdbutils.Transactions;
import info.unterrainer.commons.rdbutils.entities.BasicJpa;

public class CountQueryBuilder

extends BasicListQueryBuilder> { CountQueryBuilder(final EntityManagerFactory emf, final JpqlDao

dao) { super(emf, dao, Long.class); } public Long build() { if (entityManager != null) return (Long) dao.coreDao .getCountQuery(entityManager, selectClause, joinClause, whereClause, parameters, null, readTenantIds) .getSingleResult(); return (Long) Transactions.withNewTransactionReturning(emf, em -> dao.coreDao.getCountQuery(em, selectClause, joinClause, whereClause, parameters, null, readTenantIds) .getSingleResult()); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy