Class HibernateHandler

  • All Implemented Interfaces:
    QueryHandler

    public class HibernateHandler
    extends java.lang.Object
    implements QueryHandler
    HibernateHandler is the QueryHandler implementation for Hibernate
    Author:
    tiwe
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEntity​(jakarta.persistence.Query query, java.lang.String alias, java.lang.Class<?> type)
      Add the given entity to the given native query
      void addScalar​(jakarta.persistence.Query query, java.lang.String alias, java.lang.Class<?> type)
      Add the given scalar to the given native query
      boolean createNativeQueryTyped()
      Return whether native queries should be created as typed queries
      <T> com.mysema.commons.lang.CloseableIterator<T> iterate​(jakarta.persistence.Query query, FactoryExpression<?> projection)
      Iterate the results with the optional projection
      <T> java.util.stream.Stream<T> stream​(jakarta.persistence.Query query, @Nullable FactoryExpression<?> projection)
      Stream the results with the optional projection
      boolean transform​(jakarta.persistence.Query query, FactoryExpression<?> projection)
      Transform the results of the given query using the given factory expression
      boolean wrapEntityProjections()
      Return whether entity projections need to be wrapped
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HibernateHandler

        public HibernateHandler()
    • Method Detail

      • addEntity

        public void addEntity​(jakarta.persistence.Query query,
                              java.lang.String alias,
                              java.lang.Class<?> type)
        Description copied from interface: QueryHandler
        Add the given entity to the given native query
        Specified by:
        addEntity in interface QueryHandler
        Parameters:
        query - query
        alias - alias
        type - type
      • addScalar

        public void addScalar​(jakarta.persistence.Query query,
                              java.lang.String alias,
                              java.lang.Class<?> type)
        Description copied from interface: QueryHandler
        Add the given scalar to the given native query
        Specified by:
        addScalar in interface QueryHandler
        Parameters:
        query - query
        alias - alias
        type - type
      • createNativeQueryTyped

        public boolean createNativeQueryTyped()
        Description copied from interface: QueryHandler
        Return whether native queries should be created as typed queries
        Specified by:
        createNativeQueryTyped in interface QueryHandler
        Returns:
        whether native queries should be created as typed queries
      • iterate

        public <T> com.mysema.commons.lang.CloseableIterator<T> iterate​(jakarta.persistence.Query query,
                                                                        FactoryExpression<?> projection)
        Description copied from interface: QueryHandler
        Iterate the results with the optional projection
        Specified by:
        iterate in interface QueryHandler
        Parameters:
        query - query
        Returns:
        iterator
      • stream

        public <T> java.util.stream.Stream<T> stream​(jakarta.persistence.Query query,
                                                     @Nullable
                                                     @Nullable FactoryExpression<?> projection)
        Description copied from interface: QueryHandler
        Stream the results with the optional projection
        Specified by:
        stream in interface QueryHandler
        Parameters:
        query - query
        Returns:
        stream
      • transform

        public boolean transform​(jakarta.persistence.Query query,
                                 FactoryExpression<?> projection)
        Description copied from interface: QueryHandler
        Transform the results of the given query using the given factory expression
        Specified by:
        transform in interface QueryHandler
        Parameters:
        query - query
        projection - projection
        Returns:
        true, if query as been modified
      • wrapEntityProjections

        public boolean wrapEntityProjections()
        Description copied from interface: QueryHandler
        Return whether entity projections need to be wrapped
        Specified by:
        wrapEntityProjections in interface QueryHandler
        Returns:
        whether entity projections need to be wrapped