本文整理汇总了Java中com.querydsl.jpa.impl.JPAQuery.fetchCount方法的典型用法代码示例。如果您正苦于以下问题:Java JPAQuery.fetchCount方法的具体用法?Java JPAQuery.fetchCount怎么用?Java JPAQuery.fetchCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.querydsl.jpa.impl.JPAQuery
的用法示例。
在下文中一共展示了JPAQuery.fetchCount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: count
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
@Min(0)
public long count(@NotNull Where<E> predicate) {
PathBuilder<E> entity = newQueryEntity();
JPAQuery<E> q = newQuery().from(entity);
predicate.where(q, entity, alias(getEntityType(), entity));
return q.fetchCount();
}
示例2: countBySearchCriteria
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
public Long countBySearchCriteria(EntityPath<? extends CatalogItem> entityPath, String searchCriteria) {
QCatalogItem qCatalogItem = new QCatalogItem(entityPath);
JPAQuery query = new JPAQueryFactory(entityManager)
.selectFrom(qCatalogItem)
.where(buildSearchPredicate(searchCriteria, qCatalogItem));
return query.fetchCount();
}
示例3: countAll
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
/**
* Count entities in db.
*
* @return count
*/
public long countAll() {
JPAQuery<T> query = query().select(qObject());
applyWhereExpression(query);
return query.fetchCount();
}
示例4: countAll
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
public Long countAll(EntityPath<? extends CatalogItem> entityPath) {
QCatalogItem qCatalogItem = new QCatalogItem(entityPath);
JPAQuery query = new JPAQueryFactory(entityManager).selectFrom(qCatalogItem);
return query.fetchCount();
}
示例5: countAll
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
public Long countAll(String searchCriteria, OrderStatus status, Long skuId) {
JPAQuery<Order> query = new JPAQueryFactory(entityManager).selectFrom(order)
.where(matchesSearchAndStatusAndItemsSkuId(searchCriteria, status, skuId));
return query.fetchCount();
}
示例6: countBySearchCriteria
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
public Long countBySearchCriteria(String searchCriteria) {
JPAQuery<User> query = new JPAQueryFactory(entityManager).selectFrom(user)
.where(buildSearchPredicate(searchCriteria));
return query.fetchCount();
}
示例7: countAll
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
public Long countAll() {
JPAQuery query = new JPAQueryFactory(entityManager).selectFrom(mailTemplate);
return query.fetchCount();
}