|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hibernate.impl.SessionFactoryImpl
Concrete implementation of the SessionFactory interface. Has the following responsibilites
ConnectionProvider
,
Session
,
QueryTranslator
,
ClassPersister
,
CollectionPersister
,
Serialized FormConstructor 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
MappingException
public FilterTranslator getFilter(String filterString, String collectionRole, boolean scalar) throws QueryException, MappingException
QueryException
MappingException
public Session openSession(Connection connection, Interceptor interceptor)
SessionFactory
Note 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 SessionFactory
connection
- a connection provided by the application.interceptor
- a session-scoped interceptor
public Session openSession(Interceptor interceptor) throws HibernateException
SessionFactory
openSession
in interface SessionFactory
interceptor
- a session-scoped interceptor
HibernateException
public Session openSession(Connection connection)
SessionFactory
Note 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 SessionFactory
connection
- a connection provided by the application.
public Session openSession() throws HibernateException
SessionFactory
openSession
in interface SessionFactory
HibernateException
public ClassPersister getPersister(String className) throws MappingException
SessionFactoryImplementor
getPersister
in interface SessionFactoryImplementor
MappingException
public ClassPersister getPersister(Class theClass) throws MappingException
SessionFactoryImplementor
getPersister
in interface SessionFactoryImplementor
MappingException
public CollectionPersister getCollectionPersister(String role) throws MappingException
SessionFactoryImplementor
getCollectionPersister
in interface SessionFactoryImplementor
MappingException
public Databinder openDatabinder() throws HibernateException
SessionFactory
openDatabinder
in interface SessionFactory
HibernateException
public Dialect getDialect()
SessionFactoryImplementor
getDialect
in interface SessionFactoryImplementor
public TransactionFactory getTransactionFactory()
public TransactionManager getTransactionManager()
SessionFactoryImplementor
getTransactionManager
in interface SessionFactoryImplementor
public SQLExceptionConverter getSQLExceptionConverter()
SessionFactory
getSQLExceptionConverter
in interface SessionFactory
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
public boolean isJdbcBatchUpdateEnabled()
public int getJdbcBatchSize()
SessionFactoryImplementor
getJdbcBatchSize
in interface SessionFactoryImplementor
public boolean isScrollableResultSetsEnabled()
SessionFactoryImplementor
isScrollableResultSetsEnabled
in interface SessionFactoryImplementor
public boolean isGetGeneratedKeysEnabled()
SessionFactoryImplementor
isGetGeneratedKeysEnabled
in interface SessionFactoryImplementor
public boolean isOuterJoinedFetchEnabled()
SessionFactoryImplementor
isOuterJoinedFetchEnabled
in interface SessionFactoryImplementor
public String getNamedQuery(String queryName)
public net.sf.hibernate.impl.SessionFactoryImpl.InternalNamedSQLQuery getNamedSQLQuery(String queryName)
public Type getIdentifierType(Class ObjectClass) throws MappingException
getIdentifierType
in interface Mapping
MappingException
public String getIdentifierPropertyName(Class ObjectClass) throws MappingException
getIdentifierPropertyName
in interface Mapping
MappingException
public Type[] getReturnTypes(String queryString) throws HibernateException
SessionFactoryImplementor
getReturnTypes
in interface SessionFactoryImplementor
HibernateException
public String getDefaultSchema()
SessionFactoryImplementor
getDefaultSchema
in interface SessionFactoryImplementor
public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException
SessionFactory
getClassMetadata
in interface SessionFactory
HibernateException
ClassMetadata
public CollectionMetadata getCollectionMetadata(String roleName) throws HibernateException
SessionFactory
getCollectionMetadata
in interface SessionFactory
HibernateException
CollectionMetadata
public String[] getImplementors(Class clazz)
getImplementors
in interface SessionFactoryImplementor
public String getImportedClassName(String className)
SessionFactoryImplementor
getImportedClassName
in interface SessionFactoryImplementor
public Map getAllClassMetadata() throws HibernateException
SessionFactory
getAllClassMetadata
in interface SessionFactory
HibernateException
ClassMetadata
public Map getAllCollectionMetadata() throws HibernateException
SessionFactory
getAllCollectionMetadata
in interface SessionFactory
HibernateException
CollectionMetadata
public void close() throws HibernateException
close
in interface SessionFactory
HibernateException
public void evict(Class persistentClass, Serializable id) throws HibernateException
SessionFactory
evict
in interface SessionFactory
HibernateException
public void evict(Class persistentClass) throws HibernateException
SessionFactory
evict
in interface SessionFactory
HibernateException
public void evictCollection(String roleName, Serializable id) throws HibernateException
SessionFactory
evictCollection
in interface SessionFactory
HibernateException
public void evictCollection(String roleName) throws HibernateException
SessionFactory
evictCollection
in interface SessionFactory
HibernateException
public Integer getMaximumFetchDepth()
SessionFactoryImplementor
getMaximumFetchDepth
in interface SessionFactoryImplementor
public Type getPropertyType(Class persistentClass, String propertyName) throws MappingException
getPropertyType
in interface Mapping
MappingException
public boolean isShowSqlEnabled()
SessionFactoryImplementor
isShowSqlEnabled
in interface SessionFactoryImplementor
public Integer getJdbcFetchSize()
SessionFactoryImplementor
getJdbcFetchSize
in interface SessionFactoryImplementor
public ConnectionProvider getConnectionProvider()
SessionFactoryImplementor
getConnectionProvider
in interface SessionFactoryImplementor
public UpdateTimestampsCache getUpdateTimestampsCache()
public QueryCache getQueryCache()
SessionFactoryImplementor
getQueryCache
in interface SessionFactoryImplementor
public QueryCache getQueryCache(String cacheRegion) throws HibernateException
SessionFactoryImplementor
getQueryCache
in interface SessionFactoryImplementor
cacheRegion
- the name of the cache region, or null for the default query cache
HibernateException
public boolean isQueryCacheEnabled()
SessionFactoryImplementor
isQueryCacheEnabled
in interface SessionFactoryImplementor
public boolean isJdbcBatchVersionedData()
SessionFactoryImplementor
isJdbcBatchVersionedData
in interface SessionFactoryImplementor
public boolean isWrapResultSetsEnabled()
SessionFactoryImplementor
isWrapResultSetsEnabled
in interface SessionFactoryImplementor
public void evictQueries() throws HibernateException
SessionFactory
evictQueries
in interface SessionFactory
HibernateException
public void evictQueries(String cacheRegion) throws HibernateException
SessionFactory
evictQueries
in interface SessionFactory
HibernateException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |