Class DaoHelper

java.lang.Object
org.apache.openmeetings.db.util.DaoHelper

public class DaoHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> long
    count(javax.persistence.EntityManager em, Class<T> clazz, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter)
     
    static <T> long
    count(javax.persistence.EntityManager em, Class<T> clazz, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.Root<T>,javax.persistence.criteria.Expression<Long>> queuePath, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter)
     
    static <T> List<T>
    fillLazy(javax.persistence.EntityManager em, Function<org.apache.openjpa.persistence.OpenJPAEntityManager,javax.persistence.TypedQuery<T>> func, String... groups)
     
    static <T, R> List<T>
    get(javax.persistence.EntityManager em, Class<R> rootClazz, Class<T> clazz, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.Root<R>,javax.persistence.criteria.Expression<T>> queuePath, boolean distinct, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, long start, long count)
     
    static <T> List<T>
    get(javax.persistence.EntityManager em, Class<T> clazz, boolean distinct, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, long start, long count)
     
    static <T> javax.persistence.criteria.Root<T>
    getRoot(javax.persistence.criteria.CriteriaQuery<?> query, Class<T> clazz)
     
    static String
     
    static javax.persistence.criteria.Subquery<Long>
    groupAdminQuery(Long userId, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.AbstractQuery<?> parentQ)
     
    static <T> javax.persistence.criteria.Predicate
    like(String col, String searchItem, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Path<T> root)
     
    static <T> T
    only(List<T> l)
     
    static <T, R> javax.persistence.criteria.CriteriaQuery<T>
    query(javax.persistence.EntityManager em, Class<R> rootClazz, Class<T> clazz, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.Root<R>,javax.persistence.criteria.Expression<T>> queuePath, boolean distinct, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort)
     
    static <T, Q> javax.persistence.criteria.Predicate
    search(String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Root<T> root, javax.persistence.criteria.CriteriaQuery<Q> query)
     
    static <T> javax.persistence.TypedQuery<T>
    setLimits(javax.persistence.TypedQuery<T> q, Long first, Long max)
     
    static <T> T
    single(List<T> l)
     
    static <T, Q> void
    sort(org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Root<T> root, javax.persistence.criteria.CriteriaQuery<Q> query)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getStringParam

      public static String getStringParam(String param)
    • count

      public static <T> long count(javax.persistence.EntityManager em, Class<T> clazz, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter)
    • count

      public static <T> long count(javax.persistence.EntityManager em, Class<T> clazz, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.Root<T>,javax.persistence.criteria.Expression<Long>> queuePath, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter)
    • get

      public static <T> List<T> get(javax.persistence.EntityManager em, Class<T> clazz, boolean distinct, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, long start, long count)
    • get

      public static <T, R> List<T> get(javax.persistence.EntityManager em, Class<R> rootClazz, Class<T> clazz, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.Root<R>,javax.persistence.criteria.Expression<T>> queuePath, boolean distinct, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, long start, long count)
    • query

      public static <T, R> javax.persistence.criteria.CriteriaQuery<T> query(javax.persistence.EntityManager em, Class<R> rootClazz, Class<T> clazz, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.Root<R>,javax.persistence.criteria.Expression<T>> queuePath, boolean distinct, String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort)
    • search

      public static <T, Q> javax.persistence.criteria.Predicate search(String search, List<String> searchFields, boolean noDeleted, BiFunction<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<?>,javax.persistence.criteria.Predicate> filter, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Root<T> root, javax.persistence.criteria.CriteriaQuery<Q> query)
    • like

      public static <T> javax.persistence.criteria.Predicate like(String col, String searchItem, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Path<T> root)
    • sort

      public static <T, Q> void sort(org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Root<T> root, javax.persistence.criteria.CriteriaQuery<Q> query)
    • setLimits

      public static <T> javax.persistence.TypedQuery<T> setLimits(javax.persistence.TypedQuery<T> q, Long first, Long max)
    • fillLazy

      public static <T> List<T> fillLazy(javax.persistence.EntityManager em, Function<org.apache.openjpa.persistence.OpenJPAEntityManager,javax.persistence.TypedQuery<T>> func, String... groups)
    • single

      public static <T> T single(List<T> l)
    • only

      public static <T> T only(List<T> l)
    • getRoot

      public static <T> javax.persistence.criteria.Root<T> getRoot(javax.persistence.criteria.CriteriaQuery<?> query, Class<T> clazz)
    • groupAdminQuery

      public static javax.persistence.criteria.Subquery<Long> groupAdminQuery(Long userId, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.AbstractQuery<?> parentQ)