E - The generic base entity type.@FunctionalInterface protected static interface BaseEntityService.QueryBuilder<E>
BaseEntityService.getPage(Page, boolean) methods.
You do not need this interface directly. Just supply a lambda. Below is an usage example:
@Stateless
public class YourEntityService extends BaseEntityService<YourEntity> {
public void getPageOfFooType(Page page, boolean count) {
return getPage(page, count, (criteriaBuilder, query, root) -> {
query.where(criteriaBuilder.equals(root.get("type"), Type.FOO));
});
}
public void getPageWithLazyChildren(Page page, boolean count) {
return getPage(page, count, (criteriaBuilder, query, root) -> {
root.fetch("lazyChildren");
});
}
}
| Modifier and Type | Method and Description |
|---|---|
void |
build(javax.persistence.criteria.CriteriaBuilder criteriaBuilder,
javax.persistence.criteria.AbstractQuery<E> query,
javax.persistence.criteria.Root<E> root) |
Copyright © 2015–2017 OmniFaces. All rights reserved.