org.hibernate.search.impl
Class FullTextSessionImpl

java.lang.Object
  extended by org.hibernate.search.impl.FullTextSessionImpl
All Implemented Interfaces:
Serializable, org.hibernate.engine.jdbc.LobCreationContext, org.hibernate.engine.spi.SessionImplementor, FullTextSession, org.hibernate.Session, org.hibernate.SharedSessionContract

public class FullTextSessionImpl
extends Object
implements FullTextSession, org.hibernate.engine.spi.SessionImplementor

Lucene full text search aware session.

Author:
Emmanuel Bernard, John Griffin, Hardy Ferentschik
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hibernate.Session
org.hibernate.Session.LockRequest
 
Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext
org.hibernate.engine.jdbc.LobCreationContext.Callback<T>
 
Constructor Summary
FullTextSessionImpl(org.hibernate.Session session)
           
 
Method Summary
 void afterScrollOperation()
           
 void applyNonFlushedChanges(org.hibernate.engine.spi.NonFlushedChanges nonFlushedChanges)
           
 org.hibernate.Transaction beginTransaction()
           
 String bestGuessEntityName(Object object)
           
 org.hibernate.Session.LockRequest buildLockRequest(org.hibernate.LockOptions lockOptions)
           
 org.hibernate.IdentifierLoadAccess byId(Class entityClass)
           
 org.hibernate.IdentifierLoadAccess byId(String entityName)
           
 org.hibernate.NaturalIdLoadAccess byNaturalId(Class entityClass)
           
 org.hibernate.NaturalIdLoadAccess byNaturalId(String entityName)
           
 org.hibernate.SimpleNaturalIdLoadAccess bySimpleNaturalId(Class entityClass)
           
 org.hibernate.SimpleNaturalIdLoadAccess bySimpleNaturalId(String entityName)
           
 void cancelQuery()
           
 void clear()
           
 Connection close()
           
 Connection connection()
           
 boolean contains(Object object)
           
 org.hibernate.Criteria createCriteria(Class persistentClass)
           
 org.hibernate.Criteria createCriteria(Class persistentClass, String alias)
           
 org.hibernate.Criteria createCriteria(String entityName)
           
 org.hibernate.Criteria createCriteria(String entityName, String alias)
           
 org.hibernate.Query createFilter(Object collection, String queryString)
           
 FullTextQuery createFullTextQuery(org.apache.lucene.search.Query luceneQuery, Class<?>... entities)
          Execute a Lucene query and retrieve managed objects of type entities (or their indexed subclasses) If entities is empty, include all indexed entities
 MassIndexer createIndexer(Class<?>... types)
          Creates a MassIndexer to rebuild the indexes of some or all indexed entity types.
 org.hibernate.Query createQuery(String queryString)
           
 org.hibernate.SQLQuery createSQLQuery(String queryString)
           
 void delete(Object object)
           
 void delete(String entityName, Object object)
           
 void disableFetchProfile(String name)
           
 void disableFilter(String filterName)
           
 void disableTransactionAutoJoin()
           
 Connection disconnect()
           
<T> T
doReturningWork(org.hibernate.jdbc.ReturningWork<T> work)
           
 void doWork(org.hibernate.jdbc.Work work)
           
 void enableFetchProfile(String name)
           
 org.hibernate.Filter enableFilter(String filterName)
           
 void evict(Object object)
           
<T> T
execute(org.hibernate.engine.jdbc.LobCreationContext.Callback<T> callback)
           
 int executeNativeUpdate(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification specification, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 int executeUpdate(String query, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 void flush()
           
 void flushToIndexes()
          Flush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.
 org.hibernate.cache.spi.CacheKey generateCacheKey(Serializable id, org.hibernate.type.Type type, String entityOrRoleName)
           
 org.hibernate.engine.spi.EntityKey generateEntityKey(Serializable id, org.hibernate.persister.entity.EntityPersister persister)
           
 Object get(Class clazz, Serializable id)
           
 Object get(Class clazz, Serializable id, org.hibernate.LockMode lockMode)
           
 Object get(Class clazz, Serializable id, org.hibernate.LockOptions lockOptions)
           
 Object get(String entityName, Serializable id)
           
 Object get(String entityName, Serializable id, org.hibernate.LockMode lockMode)
           
 Object get(String entityName, Serializable id, org.hibernate.LockOptions lockOptions)
           
 org.hibernate.CacheMode getCacheMode()
           
 Serializable getContextEntityIdentifier(Object object)
           
 org.hibernate.LockMode getCurrentLockMode(Object object)
           
 int getDontFlushFromFind()
           
 org.hibernate.Filter getEnabledFilter(String filterName)
           
 Map getEnabledFilters()
           
 String getEntityName(Object object)
           
 org.hibernate.persister.entity.EntityPersister getEntityPersister(String entityName, Object object)
           
 Object getEntityUsingInterceptor(org.hibernate.engine.spi.EntityKey key)
           
 org.hibernate.engine.spi.SessionFactoryImplementor getFactory()
           
 String getFetchProfile()
           
 org.hibernate.type.Type getFilterParameterType(String filterParameterName)
           
 Object getFilterParameterValue(String filterParameterName)
           
 org.hibernate.FlushMode getFlushMode()
           
 Serializable getIdentifier(Object object)
           
 org.hibernate.Interceptor getInterceptor()
           
 org.hibernate.engine.jdbc.spi.JdbcConnectionAccess getJdbcConnectionAccess()
           
 org.hibernate.engine.spi.LoadQueryInfluencers getLoadQueryInfluencers()
           
 org.hibernate.LobHelper getLobHelper()
           
 org.hibernate.Query getNamedQuery(String queryName)
           
 org.hibernate.Query getNamedSQLQuery(String name)
           
 org.hibernate.engine.spi.NonFlushedChanges getNonFlushedChanges()
           
 org.hibernate.engine.spi.PersistenceContext getPersistenceContext()
           
 SearchFactory getSearchFactory()
           
 org.hibernate.SessionFactory getSessionFactory()
           
 org.hibernate.stat.SessionStatistics getStatistics()
           
 String getTenantIdentifier()
           
 long getTimestamp()
           
 org.hibernate.Transaction getTransaction()
           
 org.hibernate.engine.transaction.spi.TransactionCoordinator getTransactionCoordinator()
           
 org.hibernate.TypeHelper getTypeHelper()
           
 String guessEntityName(Object entity)
           
 Object immediateLoad(String entityName, Serializable id)
           
<T> void
index(T entity)
          (Re-)index an entity.
 void initializeCollection(org.hibernate.collection.spi.PersistentCollection collection, boolean writing)
           
 Object instantiate(String entityName, Serializable id)
           
 Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable)
           
 boolean isClosed()
           
 boolean isConnected()
           
 boolean isDefaultReadOnly()
           
 boolean isDirty()
           
 boolean isEventSource()
           
 boolean isFetchProfileEnabled(String name)
           
 boolean isOpen()
           
 boolean isReadOnly(Object entityOrProxy)
           
 boolean isTransactionInProgress()
           
 Iterator iterate(String query, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 Iterator iterateFilter(Object collection, String filter, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 List list(org.hibernate.Criteria criteria)
           
 List list(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification spec, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 List list(String query, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 List listCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 List listFilter(Object collection, String filter, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 Object load(Class theClass, Serializable id)
           
 Object load(Class theClass, Serializable id, org.hibernate.LockMode lockMode)
           
 Object load(Class theClass, Serializable id, org.hibernate.LockOptions lockOptions)
           
 void load(Object object, Serializable id)
           
 Object load(String entityName, Serializable id)
           
 Object load(String entityName, Serializable id, org.hibernate.LockMode lockMode)
           
 Object load(String entityName, Serializable id, org.hibernate.LockOptions lockOptions)
           
 void lock(Object object, org.hibernate.LockMode lockMode)
           
 void lock(String entityName, Object object, org.hibernate.LockMode lockMode)
           
 Object merge(Object object)
           
 Object merge(String entityName, Object object)
           
 void persist(Object object)
           
 void persist(String entityName, Object object)
           
<T> void
purge(Class<T> entityType, Serializable id)
          Remove the entity with the type entityType and the identifier id from the index.
<T> void
purgeAll(Class<T> entityType)
          Remove all entities from of particular class and all its subclasses from the index.
 void reconnect(Connection connection)
           
 void refresh(Object object)
           
 void refresh(Object object, org.hibernate.LockMode lockMode)
           
 void refresh(Object object, org.hibernate.LockOptions lockOptions)
           
 void refresh(String entityName, Object object)
           
 void refresh(String entityName, Object object, org.hibernate.LockOptions lockOptions)
           
 void replicate(Object object, org.hibernate.ReplicationMode replicationMode)
           
 void replicate(String entityName, Object object, org.hibernate.ReplicationMode replicationMode)
           
 Serializable save(Object object)
           
 Serializable save(String entityName, Object object)
           
 void saveOrUpdate(Object object)
           
 void saveOrUpdate(String entityName, Object object)
           
 org.hibernate.ScrollableResults scroll(org.hibernate.Criteria criteria, org.hibernate.ScrollMode scrollMode)
           
 org.hibernate.ScrollableResults scroll(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification spec, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 org.hibernate.ScrollableResults scroll(String query, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 org.hibernate.ScrollableResults scrollCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery, org.hibernate.engine.spi.QueryParameters queryParameters)
           
 FullTextSharedSessionBuilder sessionWithOptions()
          
 void setAutoClear(boolean enabled)
           
 void setCacheMode(org.hibernate.CacheMode cacheMode)
           
 void setDefaultReadOnly(boolean readOnly)
           
 void setFetchProfile(String name)
           
 void setFlushMode(org.hibernate.FlushMode flushMode)
           
 void setReadOnly(Object entity, boolean readOnly)
           
 void update(Object object)
           
 void update(String entityName, Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullTextSessionImpl

public FullTextSessionImpl(org.hibernate.Session session)
Method Detail

createFullTextQuery

public FullTextQuery createFullTextQuery(org.apache.lucene.search.Query luceneQuery,
                                         Class<?>... entities)
Execute a Lucene query and retrieve managed objects of type entities (or their indexed subclasses) If entities is empty, include all indexed entities

Specified by:
createFullTextQuery in interface FullTextSession
Parameters:
entities - must be immutable for the lifetime of the query object
luceneQuery - The native Lucene query to be run against the Lucene index.
Returns:
A FullTextQuery wrapping around the native Lucene query.

purgeAll

public <T> void purgeAll(Class<T> entityType)
Remove all entities from of particular class and all its subclasses from the index. Any EntityIndexingInterceptor registered on the entity type will be ignored.

Specified by:
purgeAll in interface FullTextSession
Parameters:
entityType - The class of the entities to remove.

flushToIndexes

public void flushToIndexes()
Description copied from interface: FullTextSession
Flush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.

Specified by:
flushToIndexes in interface FullTextSession

purge

public <T> void purge(Class<T> entityType,
                      Serializable id)
Remove the entity with the type entityType and the identifier id from the index. If id == null all indexed entities of this type and its indexed subclasses are deleted. In this case this method behaves like FullTextSession.purgeAll(Class). Any EntityIndexingInterceptor registered on the entity will be ignored: this method forces a purge operation.

Specified by:
purge in interface FullTextSession
Parameters:
entityType - The type of the entity to delete.
id - The id of the entity to delete.

index

public <T> void index(T entity)
(Re-)index an entity. The entity must be associated with the session and non indexable entities are ignored.

Specified by:
index in interface FullTextSession
Parameters:
entity - The entity to index - must not be null.
Throws:
IllegalArgumentException - if entity is null or not an @Indexed entity

createIndexer

public MassIndexer createIndexer(Class<?>... types)
Description copied from interface: FullTextSession
Creates a MassIndexer to rebuild the indexes of some or all indexed entity types. Instances cannot be reused. Any EntityIndexingInterceptor registered on the entity types are applied: each instance will trigger an EntityIndexingInterceptor.onAdd(Object) event from where you can customize the indexing operation.

Specified by:
createIndexer in interface FullTextSession
Parameters:
types - optionally restrict the operation to selected types
Returns:
a new MassIndexer

getSearchFactory

public SearchFactory getSearchFactory()
Specified by:
getSearchFactory in interface FullTextSession
Returns:
the SearchFactory instance.

getTenantIdentifier

public String getTenantIdentifier()
Specified by:
getTenantIdentifier in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
getTenantIdentifier in interface org.hibernate.SharedSessionContract

beginTransaction

public org.hibernate.Transaction beginTransaction()
                                           throws org.hibernate.HibernateException
Specified by:
beginTransaction in interface org.hibernate.SharedSessionContract
Throws:
org.hibernate.HibernateException

cancelQuery

public void cancelQuery()
                 throws org.hibernate.HibernateException
Specified by:
cancelQuery in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

clear

public void clear()
Specified by:
clear in interface org.hibernate.Session

close

public Connection close()
                 throws org.hibernate.HibernateException
Specified by:
close in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

contains

public boolean contains(Object object)
Specified by:
contains in interface org.hibernate.Session

createCriteria

public org.hibernate.Criteria createCriteria(String entityName)
Specified by:
createCriteria in interface org.hibernate.SharedSessionContract

createCriteria

public org.hibernate.Criteria createCriteria(String entityName,
                                             String alias)
Specified by:
createCriteria in interface org.hibernate.SharedSessionContract

createCriteria

public org.hibernate.Criteria createCriteria(Class persistentClass)
Specified by:
createCriteria in interface org.hibernate.SharedSessionContract

createCriteria

public org.hibernate.Criteria createCriteria(Class persistentClass,
                                             String alias)
Specified by:
createCriteria in interface org.hibernate.SharedSessionContract

createFilter

public org.hibernate.Query createFilter(Object collection,
                                        String queryString)
                                 throws org.hibernate.HibernateException
Specified by:
createFilter in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

createQuery

public org.hibernate.Query createQuery(String queryString)
                                throws org.hibernate.HibernateException
Specified by:
createQuery in interface org.hibernate.SharedSessionContract
Throws:
org.hibernate.HibernateException

createSQLQuery

public org.hibernate.SQLQuery createSQLQuery(String queryString)
                                      throws org.hibernate.HibernateException
Specified by:
createSQLQuery in interface org.hibernate.SharedSessionContract
Throws:
org.hibernate.HibernateException

delete

public void delete(String entityName,
                   Object object)
            throws org.hibernate.HibernateException
Specified by:
delete in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

delete

public void delete(Object object)
            throws org.hibernate.HibernateException
Specified by:
delete in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

disableFilter

public void disableFilter(String filterName)
Specified by:
disableFilter in interface org.hibernate.Session

disconnect

public Connection disconnect()
                      throws org.hibernate.HibernateException
Specified by:
disconnect in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

enableFilter

public org.hibernate.Filter enableFilter(String filterName)
Specified by:
enableFilter in interface org.hibernate.Session

evict

public void evict(Object object)
           throws org.hibernate.HibernateException
Specified by:
evict in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

sessionWithOptions

public FullTextSharedSessionBuilder sessionWithOptions()
Description copied from interface: FullTextSession

Specified by:
sessionWithOptions in interface FullTextSession
Specified by:
sessionWithOptions in interface org.hibernate.Session

flush

public void flush()
           throws org.hibernate.HibernateException
Specified by:
flush in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
flush in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

get

public Object get(Class clazz,
                  Serializable id)
           throws org.hibernate.HibernateException
Specified by:
get in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

get

public Object get(Class clazz,
                  Serializable id,
                  org.hibernate.LockMode lockMode)
           throws org.hibernate.HibernateException
Specified by:
get in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

get

public Object get(Class clazz,
                  Serializable id,
                  org.hibernate.LockOptions lockOptions)
           throws org.hibernate.HibernateException
Specified by:
get in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

get

public Object get(String entityName,
                  Serializable id)
           throws org.hibernate.HibernateException
Specified by:
get in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

get

public Object get(String entityName,
                  Serializable id,
                  org.hibernate.LockMode lockMode)
           throws org.hibernate.HibernateException
Specified by:
get in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

get

public Object get(String entityName,
                  Serializable id,
                  org.hibernate.LockOptions lockOptions)
           throws org.hibernate.HibernateException
Specified by:
get in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

getCacheMode

public org.hibernate.CacheMode getCacheMode()
Specified by:
getCacheMode in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
getCacheMode in interface org.hibernate.Session

getCurrentLockMode

public org.hibernate.LockMode getCurrentLockMode(Object object)
                                          throws org.hibernate.HibernateException
Specified by:
getCurrentLockMode in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

getEnabledFilter

public org.hibernate.Filter getEnabledFilter(String filterName)
Specified by:
getEnabledFilter in interface org.hibernate.Session

getJdbcConnectionAccess

public org.hibernate.engine.jdbc.spi.JdbcConnectionAccess getJdbcConnectionAccess()
Specified by:
getJdbcConnectionAccess in interface org.hibernate.engine.spi.SessionImplementor

generateEntityKey

public org.hibernate.engine.spi.EntityKey generateEntityKey(Serializable id,
                                                            org.hibernate.persister.entity.EntityPersister persister)
Specified by:
generateEntityKey in interface org.hibernate.engine.spi.SessionImplementor

generateCacheKey

public org.hibernate.cache.spi.CacheKey generateCacheKey(Serializable id,
                                                         org.hibernate.type.Type type,
                                                         String entityOrRoleName)
Specified by:
generateCacheKey in interface org.hibernate.engine.spi.SessionImplementor

getInterceptor

public org.hibernate.Interceptor getInterceptor()
Specified by:
getInterceptor in interface org.hibernate.engine.spi.SessionImplementor

setAutoClear

public void setAutoClear(boolean enabled)
Specified by:
setAutoClear in interface org.hibernate.engine.spi.SessionImplementor

disableTransactionAutoJoin

public void disableTransactionAutoJoin()
Specified by:
disableTransactionAutoJoin in interface org.hibernate.engine.spi.SessionImplementor

isTransactionInProgress

public boolean isTransactionInProgress()
Specified by:
isTransactionInProgress in interface org.hibernate.engine.spi.SessionImplementor

initializeCollection

public void initializeCollection(org.hibernate.collection.spi.PersistentCollection collection,
                                 boolean writing)
                          throws org.hibernate.HibernateException
Specified by:
initializeCollection in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

internalLoad

public Object internalLoad(String entityName,
                           Serializable id,
                           boolean eager,
                           boolean nullable)
                    throws org.hibernate.HibernateException
Specified by:
internalLoad in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

immediateLoad

public Object immediateLoad(String entityName,
                            Serializable id)
                     throws org.hibernate.HibernateException
Specified by:
immediateLoad in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

getTimestamp

public long getTimestamp()
Specified by:
getTimestamp in interface org.hibernate.engine.spi.SessionImplementor

getFactory

public org.hibernate.engine.spi.SessionFactoryImplementor getFactory()
Specified by:
getFactory in interface org.hibernate.engine.spi.SessionImplementor

list

public List list(String query,
                 org.hibernate.engine.spi.QueryParameters queryParameters)
          throws org.hibernate.HibernateException
Specified by:
list in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

iterate

public Iterator iterate(String query,
                        org.hibernate.engine.spi.QueryParameters queryParameters)
                 throws org.hibernate.HibernateException
Specified by:
iterate in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

scroll

public org.hibernate.ScrollableResults scroll(String query,
                                              org.hibernate.engine.spi.QueryParameters queryParameters)
                                       throws org.hibernate.HibernateException
Specified by:
scroll in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

scroll

public org.hibernate.ScrollableResults scroll(org.hibernate.Criteria criteria,
                                              org.hibernate.ScrollMode scrollMode)
Specified by:
scroll in interface org.hibernate.engine.spi.SessionImplementor

list

public List list(org.hibernate.Criteria criteria)
Specified by:
list in interface org.hibernate.engine.spi.SessionImplementor

listFilter

public List listFilter(Object collection,
                       String filter,
                       org.hibernate.engine.spi.QueryParameters queryParameters)
                throws org.hibernate.HibernateException
Specified by:
listFilter in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

iterateFilter

public Iterator iterateFilter(Object collection,
                              String filter,
                              org.hibernate.engine.spi.QueryParameters queryParameters)
                       throws org.hibernate.HibernateException
Specified by:
iterateFilter in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

getEntityPersister

public org.hibernate.persister.entity.EntityPersister getEntityPersister(String entityName,
                                                                         Object object)
                                                                  throws org.hibernate.HibernateException
Specified by:
getEntityPersister in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

getEntityUsingInterceptor

public Object getEntityUsingInterceptor(org.hibernate.engine.spi.EntityKey key)
                                 throws org.hibernate.HibernateException
Specified by:
getEntityUsingInterceptor in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

getContextEntityIdentifier

public Serializable getContextEntityIdentifier(Object object)
Specified by:
getContextEntityIdentifier in interface org.hibernate.engine.spi.SessionImplementor

bestGuessEntityName

public String bestGuessEntityName(Object object)
Specified by:
bestGuessEntityName in interface org.hibernate.engine.spi.SessionImplementor

guessEntityName

public String guessEntityName(Object entity)
                       throws org.hibernate.HibernateException
Specified by:
guessEntityName in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

instantiate

public Object instantiate(String entityName,
                          Serializable id)
                   throws org.hibernate.HibernateException
Specified by:
instantiate in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

listCustomQuery

public List listCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery,
                            org.hibernate.engine.spi.QueryParameters queryParameters)
                     throws org.hibernate.HibernateException
Specified by:
listCustomQuery in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

scrollCustomQuery

public org.hibernate.ScrollableResults scrollCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery,
                                                         org.hibernate.engine.spi.QueryParameters queryParameters)
                                                  throws org.hibernate.HibernateException
Specified by:
scrollCustomQuery in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

list

public List list(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification spec,
                 org.hibernate.engine.spi.QueryParameters queryParameters)
          throws org.hibernate.HibernateException
Specified by:
list in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

scroll

public org.hibernate.ScrollableResults scroll(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification spec,
                                              org.hibernate.engine.spi.QueryParameters queryParameters)
                                       throws org.hibernate.HibernateException
Specified by:
scroll in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

getFilterParameterValue

public Object getFilterParameterValue(String filterParameterName)
Specified by:
getFilterParameterValue in interface org.hibernate.engine.spi.SessionImplementor

getFilterParameterType

public org.hibernate.type.Type getFilterParameterType(String filterParameterName)
Specified by:
getFilterParameterType in interface org.hibernate.engine.spi.SessionImplementor

getEnabledFilters

public Map getEnabledFilters()
Specified by:
getEnabledFilters in interface org.hibernate.engine.spi.SessionImplementor

getDontFlushFromFind

public int getDontFlushFromFind()
Specified by:
getDontFlushFromFind in interface org.hibernate.engine.spi.SessionImplementor

getPersistenceContext

public org.hibernate.engine.spi.PersistenceContext getPersistenceContext()
Specified by:
getPersistenceContext in interface org.hibernate.engine.spi.SessionImplementor

executeUpdate

public int executeUpdate(String query,
                         org.hibernate.engine.spi.QueryParameters queryParameters)
                  throws org.hibernate.HibernateException
Specified by:
executeUpdate in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

executeNativeUpdate

public int executeNativeUpdate(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification specification,
                               org.hibernate.engine.spi.QueryParameters queryParameters)
                        throws org.hibernate.HibernateException
Specified by:
executeNativeUpdate in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

getNonFlushedChanges

public org.hibernate.engine.spi.NonFlushedChanges getNonFlushedChanges()
                                                                throws org.hibernate.HibernateException
Specified by:
getNonFlushedChanges in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

applyNonFlushedChanges

public void applyNonFlushedChanges(org.hibernate.engine.spi.NonFlushedChanges nonFlushedChanges)
                            throws org.hibernate.HibernateException
Specified by:
applyNonFlushedChanges in interface org.hibernate.engine.spi.SessionImplementor
Throws:
org.hibernate.HibernateException

getEntityName

public String getEntityName(Object object)
                     throws org.hibernate.HibernateException
Specified by:
getEntityName in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

getFlushMode

public org.hibernate.FlushMode getFlushMode()
Specified by:
getFlushMode in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
getFlushMode in interface org.hibernate.Session

getIdentifier

public Serializable getIdentifier(Object object)
                           throws org.hibernate.HibernateException
Specified by:
getIdentifier in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

getNamedQuery

public org.hibernate.Query getNamedQuery(String queryName)
                                  throws org.hibernate.HibernateException
Specified by:
getNamedQuery in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
getNamedQuery in interface org.hibernate.SharedSessionContract
Throws:
org.hibernate.HibernateException

getNamedSQLQuery

public org.hibernate.Query getNamedSQLQuery(String name)
Specified by:
getNamedSQLQuery in interface org.hibernate.engine.spi.SessionImplementor

isEventSource

public boolean isEventSource()
Specified by:
isEventSource in interface org.hibernate.engine.spi.SessionImplementor

afterScrollOperation

public void afterScrollOperation()
Specified by:
afterScrollOperation in interface org.hibernate.engine.spi.SessionImplementor

setFetchProfile

public void setFetchProfile(String name)
Specified by:
setFetchProfile in interface org.hibernate.engine.spi.SessionImplementor

getTransactionCoordinator

public org.hibernate.engine.transaction.spi.TransactionCoordinator getTransactionCoordinator()
Specified by:
getTransactionCoordinator in interface org.hibernate.engine.spi.SessionImplementor

getFetchProfile

public String getFetchProfile()
Specified by:
getFetchProfile in interface org.hibernate.engine.spi.SessionImplementor

isClosed

public boolean isClosed()
Specified by:
isClosed in interface org.hibernate.engine.spi.SessionImplementor

getLoadQueryInfluencers

public org.hibernate.engine.spi.LoadQueryInfluencers getLoadQueryInfluencers()
Specified by:
getLoadQueryInfluencers in interface org.hibernate.engine.spi.SessionImplementor

getSessionFactory

public org.hibernate.SessionFactory getSessionFactory()
Specified by:
getSessionFactory in interface org.hibernate.Session

getStatistics

public org.hibernate.stat.SessionStatistics getStatistics()
Specified by:
getStatistics in interface org.hibernate.Session

isReadOnly

public boolean isReadOnly(Object entityOrProxy)
Specified by:
isReadOnly in interface org.hibernate.Session

getTransaction

public org.hibernate.Transaction getTransaction()
Specified by:
getTransaction in interface org.hibernate.SharedSessionContract

isConnected

public boolean isConnected()
Specified by:
isConnected in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
isConnected in interface org.hibernate.Session

isDirty

public boolean isDirty()
                throws org.hibernate.HibernateException
Specified by:
isDirty in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

isDefaultReadOnly

public boolean isDefaultReadOnly()
Specified by:
isDefaultReadOnly in interface org.hibernate.Session

isOpen

public boolean isOpen()
Specified by:
isOpen in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
isOpen in interface org.hibernate.Session

load

public Object load(String entityName,
                   Serializable id)
            throws org.hibernate.HibernateException
Specified by:
load in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

load

public Object load(String entityName,
                   Serializable id,
                   org.hibernate.LockMode lockMode)
            throws org.hibernate.HibernateException
Specified by:
load in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

load

public Object load(String entityName,
                   Serializable id,
                   org.hibernate.LockOptions lockOptions)
            throws org.hibernate.HibernateException
Specified by:
load in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

load

public void load(Object object,
                 Serializable id)
          throws org.hibernate.HibernateException
Specified by:
load in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

load

public Object load(Class theClass,
                   Serializable id)
            throws org.hibernate.HibernateException
Specified by:
load in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

load

public Object load(Class theClass,
                   Serializable id,
                   org.hibernate.LockMode lockMode)
            throws org.hibernate.HibernateException
Specified by:
load in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

load

public Object load(Class theClass,
                   Serializable id,
                   org.hibernate.LockOptions lockOptions)
            throws org.hibernate.HibernateException
Specified by:
load in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

lock

public void lock(String entityName,
                 Object object,
                 org.hibernate.LockMode lockMode)
          throws org.hibernate.HibernateException
Specified by:
lock in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

buildLockRequest

public org.hibernate.Session.LockRequest buildLockRequest(org.hibernate.LockOptions lockOptions)
Specified by:
buildLockRequest in interface org.hibernate.Session

lock

public void lock(Object object,
                 org.hibernate.LockMode lockMode)
          throws org.hibernate.HibernateException
Specified by:
lock in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

merge

public Object merge(String entityName,
                    Object object)
             throws org.hibernate.HibernateException
Specified by:
merge in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

merge

public Object merge(Object object)
             throws org.hibernate.HibernateException
Specified by:
merge in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

persist

public void persist(String entityName,
                    Object object)
             throws org.hibernate.HibernateException
Specified by:
persist in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

persist

public void persist(Object object)
             throws org.hibernate.HibernateException
Specified by:
persist in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

reconnect

public void reconnect(Connection connection)
               throws org.hibernate.HibernateException
Specified by:
reconnect in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

refresh

public void refresh(Object object)
             throws org.hibernate.HibernateException
Specified by:
refresh in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

refresh

public void refresh(String entityName,
                    Object object)
             throws org.hibernate.HibernateException
Specified by:
refresh in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

refresh

public void refresh(Object object,
                    org.hibernate.LockMode lockMode)
             throws org.hibernate.HibernateException
Specified by:
refresh in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

refresh

public void refresh(Object object,
                    org.hibernate.LockOptions lockOptions)
             throws org.hibernate.HibernateException
Specified by:
refresh in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

refresh

public void refresh(String entityName,
                    Object object,
                    org.hibernate.LockOptions lockOptions)
             throws org.hibernate.HibernateException
Specified by:
refresh in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

replicate

public void replicate(String entityName,
                      Object object,
                      org.hibernate.ReplicationMode replicationMode)
               throws org.hibernate.HibernateException
Specified by:
replicate in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

replicate

public void replicate(Object object,
                      org.hibernate.ReplicationMode replicationMode)
               throws org.hibernate.HibernateException
Specified by:
replicate in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

save

public Serializable save(String entityName,
                         Object object)
                  throws org.hibernate.HibernateException
Specified by:
save in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

save

public Serializable save(Object object)
                  throws org.hibernate.HibernateException
Specified by:
save in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

saveOrUpdate

public void saveOrUpdate(String entityName,
                         Object object)
                  throws org.hibernate.HibernateException
Specified by:
saveOrUpdate in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

saveOrUpdate

public void saveOrUpdate(Object object)
                  throws org.hibernate.HibernateException
Specified by:
saveOrUpdate in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

setCacheMode

public void setCacheMode(org.hibernate.CacheMode cacheMode)
Specified by:
setCacheMode in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
setCacheMode in interface org.hibernate.Session

setDefaultReadOnly

public void setDefaultReadOnly(boolean readOnly)
Specified by:
setDefaultReadOnly in interface org.hibernate.Session

setFlushMode

public void setFlushMode(org.hibernate.FlushMode flushMode)
Specified by:
setFlushMode in interface org.hibernate.engine.spi.SessionImplementor
Specified by:
setFlushMode in interface org.hibernate.Session

connection

public Connection connection()
Specified by:
connection in interface org.hibernate.engine.spi.SessionImplementor

setReadOnly

public void setReadOnly(Object entity,
                        boolean readOnly)
Specified by:
setReadOnly in interface org.hibernate.Session

doWork

public void doWork(org.hibernate.jdbc.Work work)
            throws org.hibernate.HibernateException
Specified by:
doWork in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

doReturningWork

public <T> T doReturningWork(org.hibernate.jdbc.ReturningWork<T> work)
                  throws org.hibernate.HibernateException
Specified by:
doReturningWork in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

update

public void update(String entityName,
                   Object object)
            throws org.hibernate.HibernateException
Specified by:
update in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

update

public void update(Object object)
            throws org.hibernate.HibernateException
Specified by:
update in interface org.hibernate.Session
Throws:
org.hibernate.HibernateException

isFetchProfileEnabled

public boolean isFetchProfileEnabled(String name)
                              throws org.hibernate.UnknownProfileException
Specified by:
isFetchProfileEnabled in interface org.hibernate.Session
Throws:
org.hibernate.UnknownProfileException

enableFetchProfile

public void enableFetchProfile(String name)
                        throws org.hibernate.UnknownProfileException
Specified by:
enableFetchProfile in interface org.hibernate.Session
Throws:
org.hibernate.UnknownProfileException

disableFetchProfile

public void disableFetchProfile(String name)
                         throws org.hibernate.UnknownProfileException
Specified by:
disableFetchProfile in interface org.hibernate.Session
Throws:
org.hibernate.UnknownProfileException

getTypeHelper

public org.hibernate.TypeHelper getTypeHelper()
Specified by:
getTypeHelper in interface org.hibernate.Session

getLobHelper

public org.hibernate.LobHelper getLobHelper()
Specified by:
getLobHelper in interface org.hibernate.Session

execute

public <T> T execute(org.hibernate.engine.jdbc.LobCreationContext.Callback<T> callback)
Specified by:
execute in interface org.hibernate.engine.jdbc.LobCreationContext

byId

public org.hibernate.IdentifierLoadAccess byId(String entityName)
Specified by:
byId in interface org.hibernate.Session

byId

public org.hibernate.IdentifierLoadAccess byId(Class entityClass)
Specified by:
byId in interface org.hibernate.Session

byNaturalId

public org.hibernate.NaturalIdLoadAccess byNaturalId(String entityName)
Specified by:
byNaturalId in interface org.hibernate.Session

byNaturalId

public org.hibernate.NaturalIdLoadAccess byNaturalId(Class entityClass)
Specified by:
byNaturalId in interface org.hibernate.Session

bySimpleNaturalId

public org.hibernate.SimpleNaturalIdLoadAccess bySimpleNaturalId(String entityName)
Specified by:
bySimpleNaturalId in interface org.hibernate.Session

bySimpleNaturalId

public org.hibernate.SimpleNaturalIdLoadAccess bySimpleNaturalId(Class entityClass)
Specified by:
bySimpleNaturalId in interface org.hibernate.Session


Copyright © 2006–2013 Hibernate. All rights reserved.