|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.hibernate.HibernateCacheLoader
public class HibernateCacheLoader
Data-driven CacheLoader implementation for Hibernate tables <p/> These methods all follow the pattern of:
| Field Summary | |
|---|---|
protected static String |
PARAM_IDSName of the "ids" named parameter in HQL bulk queries |
| Constructor Summary | |
|---|---|
HibernateCacheLoader()Default constructor. |
|
HibernateCacheLoader(String sEntityName)Constructor which accepts an entityName. |
|
HibernateCacheLoader(String sEntityName, File configurationFile)Constructor which accepts an entityName and a Hibernate configuration resource. |
|
HibernateCacheLoader(String sEntityName, String sResource)Constructor which accepts an entityName and a Hibernate configuration resource. |
|
| Method Summary | |
|---|---|
protected void |
closeSession(Session session)Close a Hibernate Session. |
protected Object |
createEntityFromId(Object id)Create a transient entity instance given an entity id |
protected void |
ensureInitialized()Called by all API-implementing methods for lazy initialization. |
protected ClassMetadata |
getEntityClassMetadata()Get the Hibernate ClassMetadata for the Hibernate entity |
protected String |
getEntityName()Get the Hibernate entity name |
protected String |
getLoadAllQuery()Get the parameterized loadAll HQL query string |
SessionFactory |
getSessionFactory()Get the Hibernate SessionFactory. |
protected void |
initialize()Initializer (must be called post-constructor) <p/> We do this specifically so that derived classes can safely create override methods that depend on a fully constructed object state. |
Object |
load(Object key)Load a Hibernate entity given an id (key) |
Map |
loadAll(Collection keys)Load a collection of Hibernate entities given a set of ids (keys) |
protected Session |
openSession()Open a Hibernate Session. |
protected void |
setEntityClassMetadata(ClassMetadata entityClassMetadata)Get the Hibernate ClassMetadata for the Hibernate entity |
void |
setEntityName(String sEntityName)Set the Hibernate entity name. |
protected void |
setLoadAllQuery(String sLoadAllQuery)Get the parameterized loadAll HQL query string |
void |
setSessionFactory(SessionFactory sessionFactory)Set the Hibernate SessionFactory to be used by this CacheLoader. |
protected void |
validateIdentifier(Serializable id, Object entity)Ensure that there are no conflicts between an explicit and implicit key. |
| Field Detail |
|---|
protected static final String PARAM_IDS
| Constructor Detail |
|---|
public HibernateCacheLoader()
public HibernateCacheLoader(String sEntityName)
sEntityName - the Hibernate entity (i.e., the HQL table name)
public HibernateCacheLoader(String sEntityName,
String sResource)
sEntityName - Hibernate entity (i.e. the HQL table name)sResource - Hibernate config classpath resource (e.g. hibernate.cfg.xml)
public HibernateCacheLoader(String sEntityName,
File configurationFile)
sEntityName - Hibernate entity (i.e. the HQL table name)configurationFile - Hibernate config file (e.g. hibernate.cfg.xml)| Method Detail |
|---|
public SessionFactory getSessionFactory()
public void setSessionFactory(SessionFactory sessionFactory)
sessionFactory - the Hibernate SessionFactoryIllegalStateException - if the session factory has already been setprotected String getEntityName()
public void setEntityName(String sEntityName)
sEntityName - the entity nameIllegalStateException - if the entity name has already been setprotected void initialize()
protected void ensureInitialized()
public Object load(Object key)
load in interface CacheLoaderkey - the cache key; specifically, the entity idpublic Map loadAll(Collection keys)
loadAll in interface CacheLoaderkeys - the cache keys; specifically, the entity idsprotected Session openSession()
protected void closeSession(Session session)
session - the Hibernate Session objectprotected ClassMetadata getEntityClassMetadata()
protected void setEntityClassMetadata(ClassMetadata entityClassMetadata)
entityClassMetadata - the ClassMetadata objectprotected String getLoadAllQuery()
protected void setLoadAllQuery(String sLoadAllQuery)
sLoadAllQuery - a parameterized HQL query stringprotected Object createEntityFromId(Object id)
id - the Hibernate entity id
protected void validateIdentifier(Serializable id,
Object entity)
id - the explicit keyentity - an entity (containing an implicit key)
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||