~ubuntu-branches/ubuntu/wily/libhibernate3-java/wily-proposed

« back to all changes in this revision

Viewing changes to src/org/hibernate/engine/SessionFactoryImplementor.java

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-10-14 14:43:34 UTC
  • Revision ID: james.westby@ubuntu.com-20071014144334-eamc8i0q10gs1aro
Tags: upstream-3.2.5
ImportĀ upstreamĀ versionĀ 3.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//$Id: SessionFactoryImplementor.java 9908 2006-05-08 20:59:20Z max.andersen@jboss.com $
 
2
package org.hibernate.engine;
 
3
 
 
4
import java.util.Map;
 
5
import java.util.Set;
 
6
import java.sql.Connection;
 
7
 
 
8
import javax.transaction.TransactionManager;
 
9
 
 
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;
 
30
 
 
31
/**
 
32
 * Defines the internal contract between the <tt>SessionFactory</tt> and other parts of
 
33
 * Hibernate such as implementors of <tt>Type</tt>.
 
34
 *
 
35
 * @see org.hibernate.SessionFactory
 
36
 * @see org.hibernate.impl.SessionFactoryImpl
 
37
 * @author Gavin King
 
38
 */
 
39
public interface SessionFactoryImplementor extends Mapping, SessionFactory {
 
40
 
 
41
        /**
 
42
         * Get the persister for the named entity
 
43
         */
 
44
        public EntityPersister getEntityPersister(String entityName) throws MappingException;
 
45
        /**
 
46
         * Get the persister object for a collection role
 
47
         */
 
48
        public CollectionPersister getCollectionPersister(String role) throws MappingException;
 
49
 
 
50
        /**
 
51
         * Get the SQL <tt>Dialect</tt>
 
52
         */
 
53
        public Dialect getDialect();
 
54
        
 
55
        public Interceptor getInterceptor();
 
56
 
 
57
        public QueryPlanCache getQueryPlanCache();
 
58
 
 
59
        /**
 
60
         * Get the return types of a query
 
61
         */
 
62
        public Type[] getReturnTypes(String queryString) throws HibernateException;
 
63
 
 
64
        /**
 
65
         * Get the return aliases of a query
 
66
         */
 
67
        public String[] getReturnAliases(String queryString) throws HibernateException;
 
68
 
 
69
        /**
 
70
         * Get the connection provider
 
71
         */
 
72
        public ConnectionProvider getConnectionProvider();
 
73
        /**
 
74
         * Get the names of all persistent classes that implement/extend the given interface/class
 
75
         */
 
76
        public String[] getImplementors(String className) throws MappingException;
 
77
        /**
 
78
         * Get a class name, using query language imports
 
79
         */
 
80
        public String getImportedClassName(String name);
 
81
 
 
82
 
 
83
        /**
 
84
         * Get the JTA transaction manager
 
85
         */
 
86
        public TransactionManager getTransactionManager();
 
87
 
 
88
 
 
89
        /**
 
90
         * Get the default query cache
 
91
         */
 
92
        public QueryCache getQueryCache();
 
93
        /**
 
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
 
97
         */
 
98
        public QueryCache getQueryCache(String regionName) throws HibernateException;
 
99
        
 
100
        /**
 
101
         * Get the cache of table update timestamps
 
102
         */
 
103
        public UpdateTimestampsCache getUpdateTimestampsCache();
 
104
        /**
 
105
         * Statistics SPI
 
106
         */
 
107
        public StatisticsImplementor getStatisticsImplementor();
 
108
        
 
109
        public NamedQueryDefinition getNamedQuery(String queryName);
 
110
        public NamedSQLQueryDefinition getNamedSQLQuery(String queryName);
 
111
        public ResultSetMappingDefinition getResultSetMapping(String name);
 
112
 
 
113
        /**
 
114
         * Get the identifier generator for the hierarchy
 
115
         */
 
116
        public IdentifierGenerator getIdentifierGenerator(String rootEntityName);
 
117
        
 
118
        /**
 
119
         * Get a named second-level cache region
 
120
         */
 
121
        public Cache getSecondLevelCacheRegion(String regionName);
 
122
        
 
123
        public Map getAllSecondLevelCacheRegions();
 
124
        
 
125
        /**
 
126
         * Retrieves the SQLExceptionConverter in effect for this SessionFactory.
 
127
         *
 
128
         * @return The SQLExceptionConverter for this SessionFactory.
 
129
         */
 
130
        public SQLExceptionConverter getSQLExceptionConverter();
 
131
 
 
132
        public Settings getSettings();
 
133
 
 
134
        /**
 
135
         * Get a nontransactional "current" session for Hibernate EntityManager
 
136
         */
 
137
        public org.hibernate.classic.Session openTemporarySession() throws HibernateException;
 
138
 
 
139
        /**
 
140
         * Open a session conforming to the given parameters.  Used mainly by
 
141
         * {@link org.hibernate.context.JTASessionContext} for current session processing.
 
142
         *
 
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
 
151
         */
 
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;
 
157
 
 
158
        /**
 
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.
 
161
         *
 
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.
 
164
         */
 
165
        public Set getCollectionRolesByEntityParticipant(String entityName);
 
166
 
 
167
        public EntityNotFoundDelegate getEntityNotFoundDelegate();
 
168
 
 
169
        public SQLFunctionRegistry getSqlFunctionRegistry();
 
170
                
 
171
}