Interface PageCacheDataSource<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.hibernate.Query createPageQuery​(org.hibernate.Session session)
      Creates a query that selects persistent objects in the right order.
      HibernateUtil getHibernateUtil()  
      Long getId​(T t)
      Needs to be implemented to get the persistent id of the objects that are cached in this cache.
      IndexedId[] getIds​(org.hibernate.Session session)
      A complete list of sorted ids along with their natural indices.
      T getWithId​(org.hibernate.Session session, Long id)  
      List<T> getWithIds​(org.hibernate.Session session, Long... ids)
      Creates a query that selects persistent objects in the right order.
      void objectsAvailable​(int index0, int index1)
      Notifies the data source, that the given index range has been loaded.
    • Method Detail

      • getId

        Long getId​(T t)
        Needs to be implemented to get the persistent id of the objects that are cached in this cache.
        Parameters:
        t - some persistent object
        Returns:
        persistent id
      • getIds

        IndexedId[] getIds​(org.hibernate.Session session)
        A complete list of sorted ids along with their natural indices. Indices of filtered out objects are flipped: -(index+1)
        Parameters:
        session - hibernate session
        Returns:
        a complete list of persistent ids
      • getWithId

        T getWithId​(org.hibernate.Session session,
                    Long id)
        Parameters:
        session - session
        id - id of the object we are looking for
        Returns:
        the persistent object or null, if not found
        See Also:
        getWithIds(Session, Long...)
      • getWithIds

        List<T> getWithIds​(org.hibernate.Session session,
                           Long... ids)
        Creates a query that selects persistent objects in the right order. query.setMaxResults(..) and query.setFirstResult(..) are set by the caller.
        Parameters:
        session - session
        ids - ids of the objects we are looking for
        Returns:
        list of objects. not found objects are null
        See Also:
        getWithId(Session, Long)
      • createPageQuery

        org.hibernate.Query createPageQuery​(org.hibernate.Session session)
        Creates a query that selects persistent objects in the right order. query.setMaxResults(..) and query.setFirstResult(..) are set by the caller.
        Parameters:
        session - session
        Returns:
        a query that returns objects in the right order or null, if such a query cannot be constructed
      • objectsAvailable

        void objectsAvailable​(int index0,
                              int index1)
        Notifies the data source, that the given index range has been loaded.
        Parameters:
        index0 - start index
        index1 - end index (inclusive)
      • getHibernateUtil

        HibernateUtil getHibernateUtil()
        Returns:
        hibernate utilities