|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.impl.SessionFactoryImpl
Concrete implementation of the SessionFactory interface. Has the following responsibilites
ConnectionProvider,
Session,
QueryTranslator,
ClassPersister,
CollectionPersister,
Serialized Form| Constructor Summary | |
SessionFactoryImpl(Configuration cfg,
Settings settings)
|
|
| Method Summary | |
void |
close()
Closes the session factory, releasing all held resources. |
void |
evict(Class persistentClass)
Evict all entries from the second-level cache. |
void |
evict(Class persistentClass,
Serializable id)
Evict an entry from the second-level cache. |
void |
evictCollection(String roleName)
Evict all entries from the second-level cache. |
void |
evictCollection(String roleName,
Serializable id)
Evict an entry from the second-level cache. |
void |
evictQueries()
Evict any query result sets cached in the default query cache region. |
void |
evictQueries(String cacheRegion)
Evict any query result sets cached in the named query cache region. |
Map |
getAllClassMetadata()
Get all ClassMetadata as a Map from Class to metadata object |
Map |
getAllCollectionMetadata()
Get all CollectionMetadata as a Map from role name to metadata object |
ClassMetadata |
getClassMetadata(Class persistentClass)
Get the ClassMetadata associated with the given entity class |
CollectionMetadata |
getCollectionMetadata(String roleName)
Get the CollectionMetadata associated with the named collection role |
CollectionPersister |
getCollectionPersister(String role)
Get the persister object for a collection role |
ConnectionProvider |
getConnectionProvider()
Get the connection provider |
String |
getDefaultSchema()
Get the database schema specified in hibernate.default_schema |
Dialect |
getDialect()
Get the SQL Dialect |
FilterTranslator |
getFilter(String filterString,
String collectionRole,
boolean scalar)
|
String |
getIdentifierPropertyName(Class ObjectClass)
|
Type |
getIdentifierType(Class ObjectClass)
|
String[] |
getImplementors(Class clazz)
Return the names of all persistent (mapped) classes that extend or implement the given class or interface, accounting for implicit/explicit polymorphism settings and excluding mapped subclasses/joined-subclasses of other classes in the result. |
String |
getImportedClassName(String className)
Get a class name, using query language imports |
int |
getJdbcBatchSize()
Get the JDBC batch size |
Integer |
getJdbcFetchSize()
Get the JDBC fetch size |
Integer |
getMaximumFetchDepth()
Get the maxmimum depth of outer join fetching |
String |
getNamedQuery(String queryName)
|
net.sf.hibernate.impl.SessionFactoryImpl.InternalNamedSQLQuery |
getNamedSQLQuery(String queryName)
|
ClassPersister |
getPersister(Class theClass)
Get the persister for a class |
ClassPersister |
getPersister(String className)
Get the persister for the named class |
Type |
getPropertyType(Class persistentClass,
String propertyName)
|
QueryTranslator[] |
getQuery(String queryString,
boolean shallow)
|
QueryCache |
getQueryCache()
Get the default query cache |
QueryCache |
getQueryCache(String cacheRegion)
Get a particular named query cache, or the default cache |
Reference |
getReference()
|
Type[] |
getReturnTypes(String queryString)
Get the return types of a query |
SQLExceptionConverter |
getSQLExceptionConverter()
Retrieves the SQLExceptionConverter in effect for this SessionFactory. |
TransactionFactory |
getTransactionFactory()
|
TransactionManager |
getTransactionManager()
Get the JTA transaction manager |
UpdateTimestampsCache |
getUpdateTimestampsCache()
|
boolean |
isGetGeneratedKeysEnabled()
Is PreparedStatement.getGeneratedKeys supported? |
boolean |
isJdbcBatchUpdateEnabled()
|
boolean |
isJdbcBatchVersionedData()
Should versioned data be included in jdbc batches? |
boolean |
isOuterJoinedFetchEnabled()
Is outerjoin fetching enabled? |
boolean |
isQueryCacheEnabled()
If query caching enabled? |
boolean |
isScrollableResultSetsEnabled()
Are scrollable ResultSets supported? |
boolean |
isShowSqlEnabled()
Are we logging SQL to the console? |
boolean |
isWrapResultSetsEnabled()
Should Hibernate wrap result sets in order to speed up column name lookups? |
Databinder |
openDatabinder()
Create a new databinder. |
Session |
openSession()
Create database connection and open a Session on it. |
Session |
openSession(Connection connection)
Open a Session on the given connection. |
Session |
openSession(Connection connection,
Interceptor interceptor)
Open a Session on the given connection, specifying an interceptor. |
Session |
openSession(Interceptor interceptor)
Create database connection and open a Session on it, specifying an interceptor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SessionFactoryImpl(Configuration cfg, Settings settings) throws HibernateException
| Method Detail |
public QueryTranslator[] getQuery(String queryString, boolean shallow) throws QueryException, MappingException
QueryException
MappingExceptionpublic FilterTranslator getFilter(String filterString, String collectionRole, boolean scalar) throws QueryException, MappingException
QueryException
MappingExceptionpublic Session openSession(Connection connection, Interceptor interceptor)
SessionFactoryNote that the second-level cache will be disabled if you supply a JDBC connection. Hibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own ConnectionProvider.
openSession in interface SessionFactoryconnection - a connection provided by the application.interceptor - a session-scoped interceptor
public Session openSession(Interceptor interceptor) throws HibernateException
SessionFactory
openSession in interface SessionFactoryinterceptor - a session-scoped interceptor
HibernateExceptionpublic Session openSession(Connection connection)
SessionFactoryNote that the second-level cache will be disabled if you supply a JDBC connection. Hibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own ConnectionProvider.
openSession in interface SessionFactoryconnection - a connection provided by the application.
public Session openSession() throws HibernateException
SessionFactory
openSession in interface SessionFactoryHibernateExceptionpublic ClassPersister getPersister(String className) throws MappingException
SessionFactoryImplementor
getPersister in interface SessionFactoryImplementorMappingExceptionpublic ClassPersister getPersister(Class theClass) throws MappingException
SessionFactoryImplementor
getPersister in interface SessionFactoryImplementorMappingExceptionpublic CollectionPersister getCollectionPersister(String role) throws MappingException
SessionFactoryImplementor
getCollectionPersister in interface SessionFactoryImplementorMappingExceptionpublic Databinder openDatabinder() throws HibernateException
SessionFactory
openDatabinder in interface SessionFactoryHibernateExceptionpublic Dialect getDialect()
SessionFactoryImplementor
getDialect in interface SessionFactoryImplementorpublic TransactionFactory getTransactionFactory()
public TransactionManager getTransactionManager()
SessionFactoryImplementor
getTransactionManager in interface SessionFactoryImplementorpublic SQLExceptionConverter getSQLExceptionConverter()
SessionFactory
getSQLExceptionConverter in interface SessionFactorypublic Reference getReference() throws NamingException
getReference in interface ReferenceableNamingExceptionpublic boolean isJdbcBatchUpdateEnabled()
public int getJdbcBatchSize()
SessionFactoryImplementor
getJdbcBatchSize in interface SessionFactoryImplementorpublic boolean isScrollableResultSetsEnabled()
SessionFactoryImplementor
isScrollableResultSetsEnabled in interface SessionFactoryImplementorpublic boolean isGetGeneratedKeysEnabled()
SessionFactoryImplementor
isGetGeneratedKeysEnabled in interface SessionFactoryImplementorpublic boolean isOuterJoinedFetchEnabled()
SessionFactoryImplementor
isOuterJoinedFetchEnabled in interface SessionFactoryImplementorpublic String getNamedQuery(String queryName)
public net.sf.hibernate.impl.SessionFactoryImpl.InternalNamedSQLQuery getNamedSQLQuery(String queryName)
public Type getIdentifierType(Class ObjectClass) throws MappingException
getIdentifierType in interface MappingMappingExceptionpublic String getIdentifierPropertyName(Class ObjectClass) throws MappingException
getIdentifierPropertyName in interface MappingMappingExceptionpublic Type[] getReturnTypes(String queryString) throws HibernateException
SessionFactoryImplementor
getReturnTypes in interface SessionFactoryImplementorHibernateExceptionpublic String getDefaultSchema()
SessionFactoryImplementor
getDefaultSchema in interface SessionFactoryImplementorpublic ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException
SessionFactory
getClassMetadata in interface SessionFactoryHibernateExceptionClassMetadatapublic CollectionMetadata getCollectionMetadata(String roleName) throws HibernateException
SessionFactory
getCollectionMetadata in interface SessionFactoryHibernateExceptionCollectionMetadatapublic String[] getImplementors(Class clazz)
getImplementors in interface SessionFactoryImplementorpublic String getImportedClassName(String className)
SessionFactoryImplementor
getImportedClassName in interface SessionFactoryImplementorpublic Map getAllClassMetadata() throws HibernateException
SessionFactory
getAllClassMetadata in interface SessionFactoryHibernateExceptionClassMetadatapublic Map getAllCollectionMetadata() throws HibernateException
SessionFactory
getAllCollectionMetadata in interface SessionFactoryHibernateExceptionCollectionMetadata
public void close()
throws HibernateException
close in interface SessionFactoryHibernateExceptionpublic void evict(Class persistentClass, Serializable id) throws HibernateException
SessionFactory
evict in interface SessionFactoryHibernateExceptionpublic void evict(Class persistentClass) throws HibernateException
SessionFactory
evict in interface SessionFactoryHibernateExceptionpublic void evictCollection(String roleName, Serializable id) throws HibernateException
SessionFactory
evictCollection in interface SessionFactoryHibernateExceptionpublic void evictCollection(String roleName) throws HibernateException
SessionFactory
evictCollection in interface SessionFactoryHibernateExceptionpublic Integer getMaximumFetchDepth()
SessionFactoryImplementor
getMaximumFetchDepth in interface SessionFactoryImplementorpublic Type getPropertyType(Class persistentClass, String propertyName) throws MappingException
getPropertyType in interface MappingMappingExceptionpublic boolean isShowSqlEnabled()
SessionFactoryImplementor
isShowSqlEnabled in interface SessionFactoryImplementorpublic Integer getJdbcFetchSize()
SessionFactoryImplementor
getJdbcFetchSize in interface SessionFactoryImplementorpublic ConnectionProvider getConnectionProvider()
SessionFactoryImplementor
getConnectionProvider in interface SessionFactoryImplementorpublic UpdateTimestampsCache getUpdateTimestampsCache()
public QueryCache getQueryCache()
SessionFactoryImplementor
getQueryCache in interface SessionFactoryImplementorpublic QueryCache getQueryCache(String cacheRegion) throws HibernateException
SessionFactoryImplementor
getQueryCache in interface SessionFactoryImplementorcacheRegion - the name of the cache region, or null for the default query cache
HibernateExceptionpublic boolean isQueryCacheEnabled()
SessionFactoryImplementor
isQueryCacheEnabled in interface SessionFactoryImplementorpublic boolean isJdbcBatchVersionedData()
SessionFactoryImplementor
isJdbcBatchVersionedData in interface SessionFactoryImplementorpublic boolean isWrapResultSetsEnabled()
SessionFactoryImplementor
isWrapResultSetsEnabled in interface SessionFactoryImplementor
public void evictQueries()
throws HibernateException
SessionFactory
evictQueries in interface SessionFactoryHibernateExceptionpublic void evictQueries(String cacheRegion) throws HibernateException
SessionFactory
evictQueries in interface SessionFactoryHibernateException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||