Package com.tagtraum.beatunes.library
Interface PageCacheDataSource<T>
-
- All Known Implementing Classes:
HibernatePlayList,HibernateTaskQueue
public interface PageCacheDataSource<T>Provides the data for thePageCache.- Author:
- Hendrik Schreiber
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.hibernate.QuerycreatePageQuery(org.hibernate.Session session)Creates a query that selects persistent objects in the right order.HibernateUtilgetHibernateUtil()LonggetId(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.TgetWithId(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.voidobjectsAvailable(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- sessionid- 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- sessionids- 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 indexindex1- end index (inclusive)
-
getHibernateUtil
HibernateUtil getHibernateUtil()
- Returns:
- hibernate utilities
-
-