1
//$Id: SessionFactoryImplementor.java 9908 2006-05-08 20:59:20Z max.andersen@jboss.com $
2
package org.hibernate.engine;
6
import java.sql.Connection;
8
import javax.transaction.TransactionManager;
10
import org.hibernate.HibernateException;
11
import org.hibernate.Interceptor;
12
import org.hibernate.MappingException;
13
import org.hibernate.SessionFactory;
14
import org.hibernate.ConnectionReleaseMode;
15
import org.hibernate.proxy.EntityNotFoundDelegate;
16
import org.hibernate.engine.query.QueryPlanCache;
17
import org.hibernate.persister.collection.CollectionPersister;
18
import org.hibernate.persister.entity.EntityPersister;
19
import org.hibernate.cache.Cache;
20
import org.hibernate.cache.QueryCache;
21
import org.hibernate.cache.UpdateTimestampsCache;
22
import org.hibernate.cfg.Settings;
23
import org.hibernate.connection.ConnectionProvider;
24
import org.hibernate.dialect.Dialect;
25
import org.hibernate.dialect.function.SQLFunctionRegistry;
26
import org.hibernate.exception.SQLExceptionConverter;
27
import org.hibernate.id.IdentifierGenerator;
28
import org.hibernate.stat.StatisticsImplementor;
29
import org.hibernate.type.Type;
32
* Defines the internal contract between the <tt>SessionFactory</tt> and other parts of
33
* Hibernate such as implementors of <tt>Type</tt>.
35
* @see org.hibernate.SessionFactory
36
* @see org.hibernate.impl.SessionFactoryImpl
39
public interface SessionFactoryImplementor extends Mapping, SessionFactory {
42
* Get the persister for the named entity
44
public EntityPersister getEntityPersister(String entityName) throws MappingException;
46
* Get the persister object for a collection role
48
public CollectionPersister getCollectionPersister(String role) throws MappingException;
51
* Get the SQL <tt>Dialect</tt>
53
public Dialect getDialect();
55
public Interceptor getInterceptor();
57
public QueryPlanCache getQueryPlanCache();
60
* Get the return types of a query
62
public Type[] getReturnTypes(String queryString) throws HibernateException;
65
* Get the return aliases of a query
67
public String[] getReturnAliases(String queryString) throws HibernateException;
70
* Get the connection provider
72
public ConnectionProvider getConnectionProvider();
74
* Get the names of all persistent classes that implement/extend the given interface/class
76
public String[] getImplementors(String className) throws MappingException;
78
* Get a class name, using query language imports
80
public String getImportedClassName(String name);
84
* Get the JTA transaction manager
86
public TransactionManager getTransactionManager();
90
* Get the default query cache
92
public QueryCache getQueryCache();
94
* Get a particular named query cache, or the default cache
95
* @param regionName the name of the cache region, or null for the default query cache
96
* @return the existing cache, or a newly created cache if none by that region name
98
public QueryCache getQueryCache(String regionName) throws HibernateException;
101
* Get the cache of table update timestamps
103
public UpdateTimestampsCache getUpdateTimestampsCache();
107
public StatisticsImplementor getStatisticsImplementor();
109
public NamedQueryDefinition getNamedQuery(String queryName);
110
public NamedSQLQueryDefinition getNamedSQLQuery(String queryName);
111
public ResultSetMappingDefinition getResultSetMapping(String name);
114
* Get the identifier generator for the hierarchy
116
public IdentifierGenerator getIdentifierGenerator(String rootEntityName);
119
* Get a named second-level cache region
121
public Cache getSecondLevelCacheRegion(String regionName);
123
public Map getAllSecondLevelCacheRegions();
126
* Retrieves the SQLExceptionConverter in effect for this SessionFactory.
128
* @return The SQLExceptionConverter for this SessionFactory.
130
public SQLExceptionConverter getSQLExceptionConverter();
132
public Settings getSettings();
135
* Get a nontransactional "current" session for Hibernate EntityManager
137
public org.hibernate.classic.Session openTemporarySession() throws HibernateException;
140
* Open a session conforming to the given parameters. Used mainly by
141
* {@link org.hibernate.context.JTASessionContext} for current session processing.
143
* @param connection The external jdbc connection to use, if one (i.e., optional).
144
* @param flushBeforeCompletionEnabled Should the session be auto-flushed
145
* prior to transaction completion?
146
* @param autoCloseSessionEnabled Should the session be auto-closed after
147
* transaction completion?
148
* @param connectionReleaseMode The release mode for managed jdbc connections.
149
* @return An appropriate session.
150
* @throws HibernateException
152
public org.hibernate.classic.Session openSession(
153
final Connection connection,
154
final boolean flushBeforeCompletionEnabled,
155
final boolean autoCloseSessionEnabled,
156
final ConnectionReleaseMode connectionReleaseMode) throws HibernateException;
159
* Retrieves a set of all the collection roles in which the given entity
160
* is a participant, as either an index or an element.
162
* @param entityName The entity name for which to get the collection roles.
163
* @return set of all the collection roles in which the given entityName participates.
165
public Set getCollectionRolesByEntityParticipant(String entityName);
167
public EntityNotFoundDelegate getEntityNotFoundDelegate();
169
public SQLFunctionRegistry getSqlFunctionRegistry();