KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > engine > SessionFactoryImplementor


1 //$Id: SessionFactoryImplementor.java,v 1.28 2005/07/08 14:44:09 epbernard Exp $
2
package org.hibernate.engine;
3
4 import java.util.Map JavaDoc;
5 import java.util.Set JavaDoc;
6
7 import javax.transaction.TransactionManager JavaDoc;
8
9 import org.hibernate.HibernateException;
10 import org.hibernate.MappingException;
11 import org.hibernate.SessionFactory;
12 import org.hibernate.persister.collection.CollectionPersister;
13 import org.hibernate.persister.entity.EntityPersister;
14 import org.hibernate.cache.Cache;
15 import org.hibernate.cache.QueryCache;
16 import org.hibernate.cache.UpdateTimestampsCache;
17 import org.hibernate.cfg.Settings;
18 import org.hibernate.connection.ConnectionProvider;
19 import org.hibernate.dialect.Dialect;
20 import org.hibernate.exception.SQLExceptionConverter;
21 import org.hibernate.id.IdentifierGenerator;
22 import org.hibernate.stat.StatisticsImplementor;
23 import org.hibernate.type.Type;
24
25 /**
26  * Defines the internal contract between the <tt>SessionFactory</tt> and other parts of
27  * Hibernate such as implementors of <tt>Type</tt>.
28  *
29  * @see org.hibernate.SessionFactory
30  * @see org.hibernate.impl.SessionFactoryImpl
31  * @author Gavin King
32  */

33 public interface SessionFactoryImplementor extends Mapping, SessionFactory {
34
35     /**
36      * Get the persister for the named entity
37      */

38     public EntityPersister getEntityPersister(String JavaDoc entityName) throws MappingException;
39     /**
40      * Get the persister object for a collection role
41      */

42     public CollectionPersister getCollectionPersister(String JavaDoc role) throws MappingException;
43
44     /**
45      * Get the SQL <tt>Dialect</tt>
46      */

47     public Dialect getDialect();
48
49     /**
50      * Get the return types of a query
51      */

52     public Type[] getReturnTypes(String JavaDoc queryString) throws HibernateException;
53
54     /**
55      * Get the return aliases of a query
56      */

57     public String JavaDoc[] getReturnAliases(String JavaDoc queryString) throws HibernateException;
58
59     /**
60      * Get the connection provider
61      */

62     public ConnectionProvider getConnectionProvider();
63     /**
64      * Get the names of all persistent classes that implement/extend the given interface/class
65      */

66     public String JavaDoc[] getImplementors(String JavaDoc className) throws MappingException;
67     /**
68      * Get a class name, using query language imports
69      */

70     public String JavaDoc getImportedClassName(String JavaDoc name);
71
72
73     /**
74      * Get the JTA transaction manager
75      */

76     public TransactionManager JavaDoc getTransactionManager();
77
78
79     /**
80      * Get the default query cache
81      */

82     public QueryCache getQueryCache();
83     /**
84      * Get a particular named query cache, or the default cache
85      * @param regionName the name of the cache region, or null for the default query cache
86      * @return the existing cache, or a newly created cache if none by that region name
87      */

88     public QueryCache getQueryCache(String JavaDoc regionName) throws HibernateException;
89     
90     /**
91      * Get the cache of table update timestamps
92      */

93     public UpdateTimestampsCache getUpdateTimestampsCache();
94     /**
95      * Statistics SPI
96      */

97     public StatisticsImplementor getStatisticsImplementor();
98     
99     public NamedQueryDefinition getNamedQuery(String JavaDoc queryName);
100     public NamedSQLQueryDefinition getNamedSQLQuery(String JavaDoc queryName);
101     public ResultSetMappingDefinition getResultSetMapping(String JavaDoc name);
102
103     /**
104      * Get the identifier generator for the hierarchy
105      */

106     public IdentifierGenerator getIdentifierGenerator(String JavaDoc rootEntityName);
107     
108     /**
109      * Get a named second-level cache region
110      */

111     public Cache getSecondLevelCacheRegion(String JavaDoc regionName);
112     
113     public Map JavaDoc getAllSecondLevelCacheRegions();
114     
115     /**
116      * Retrieves the SQLExceptionConverter in effect for this SessionFactory.
117      *
118      * @return The SQLExceptionConverter for this SessionFactory.
119      */

120     public SQLExceptionConverter getSQLExceptionConverter();
121
122     public Settings getSettings();
123
124     /**
125      * Get a nontransactional "current" session for Hibernate EntityManager
126      */

127     public org.hibernate.classic.Session openTemporarySession() throws HibernateException;
128
129     /**
130      * Retrieves a set of all the collection roles in which the given entity
131      * is a participant, as either an index or an element.
132      *
133      * @param entityName The entity name for which to get the collection roles.
134      * @return set of all the collection roles in which the given entityName participates.
135      */

136     public Set JavaDoc getCollectionRolesByEntityParticipant(String JavaDoc entityName);
137
138 }
139
Popular Tags