KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > cfg > Settings


1 //$Id: Settings.java,v 1.18 2005/07/06 21:25:51 oneovthafew Exp $
2
package org.hibernate.cfg;
3
4 import java.util.Map JavaDoc;
5
6 import org.hibernate.cache.CacheProvider;
7 import org.hibernate.cache.QueryCacheFactory;
8 import org.hibernate.connection.ConnectionProvider;
9 import org.hibernate.dialect.Dialect;
10 import org.hibernate.hql.QueryTranslatorFactory;
11 import org.hibernate.jdbc.BatcherFactory;
12 import org.hibernate.transaction.TransactionFactory;
13 import org.hibernate.transaction.TransactionManagerLookup;
14 import org.hibernate.exception.SQLExceptionConverter;
15 import org.hibernate.EntityMode;
16 import org.hibernate.ConnectionReleaseMode;
17
18 /**
19  * Settings that affect the behaviour of Hibernate at runtime.
20  *
21  * @author Gavin King
22  */

23 public final class Settings {
24
25     private boolean showSql;
26     private Integer JavaDoc maximumFetchDepth;
27     private Map JavaDoc querySubstitutions;
28     private Dialect dialect;
29     private int jdbcBatchSize;
30     private int defaultBatchFetchSize;
31     private boolean scrollableResultSetsEnabled;
32     private boolean getGeneratedKeysEnabled;
33     private String JavaDoc defaultSchemaName;
34     private String JavaDoc defaultCatalogName;
35     private Integer JavaDoc jdbcFetchSize;
36     private String JavaDoc sessionFactoryName;
37     private boolean autoCreateSchema;
38     private boolean autoDropSchema;
39     private boolean autoUpdateSchema;
40     private boolean queryCacheEnabled;
41     private boolean structuredCacheEntriesEnabled;
42     private boolean secondLevelCacheEnabled;
43     private String JavaDoc cacheRegionPrefix;
44     private boolean minimalPutsEnabled;
45     private boolean commentsEnabled;
46     private boolean statisticsEnabled;
47     private boolean jdbcBatchVersionedData;
48     private boolean identifierRollbackEnabled;
49     private boolean flushBeforeCompletionEnabled;
50     private boolean autoCloseSessionEnabled;
51     private ConnectionReleaseMode connectionReleaseMode;
52     private CacheProvider cacheProvider;
53     private QueryCacheFactory queryCacheFactory;
54     private ConnectionProvider connectionProvider;
55     private TransactionFactory transactionFactory;
56     private TransactionManagerLookup transactionManagerLookup;
57     private BatcherFactory batcherFactory;
58     private QueryTranslatorFactory queryTranslatorFactory;
59     private SQLExceptionConverter sqlExceptionConverter;
60     private boolean wrapResultSetsEnabled;
61     private boolean orderUpdatesEnabled;
62     private EntityMode defaultEntityMode;
63     
64     Settings() {}
65
66     public String JavaDoc getDefaultSchemaName() {
67         return defaultSchemaName;
68     }
69
70     public String JavaDoc getDefaultCatalogName() {
71         return defaultCatalogName;
72     }
73
74     public Dialect getDialect() {
75         return dialect;
76     }
77
78     public int getJdbcBatchSize() {
79         return jdbcBatchSize;
80     }
81
82     public int getDefaultBatchFetchSize() {
83         return defaultBatchFetchSize;
84     }
85
86     public Map JavaDoc getQuerySubstitutions() {
87         return querySubstitutions;
88     }
89
90     public boolean isShowSqlEnabled() {
91         return showSql;
92     }
93
94     public boolean isIdentifierRollbackEnabled() {
95         return identifierRollbackEnabled;
96     }
97
98     public boolean isScrollableResultSetsEnabled() {
99         return scrollableResultSetsEnabled;
100     }
101
102     public boolean isGetGeneratedKeysEnabled() {
103         return getGeneratedKeysEnabled;
104     }
105
106     public boolean isMinimalPutsEnabled() {
107         return minimalPutsEnabled;
108     }
109
110     void setDefaultSchemaName(String JavaDoc string) {
111         defaultSchemaName = string;
112     }
113
114     void setDefaultCatalogName(String JavaDoc string) {
115         defaultCatalogName = string;
116     }
117
118     void setDialect(Dialect dialect) {
119         this.dialect = dialect;
120     }
121
122     void setJdbcBatchSize(int i) {
123         jdbcBatchSize = i;
124     }
125
126     void setDefaultBatchFetchSize(int i) {
127         defaultBatchFetchSize = i;
128     }
129
130     void setQuerySubstitutions(Map JavaDoc map) {
131         querySubstitutions = map;
132     }
133
134     void setShowSqlEnabled(boolean b) {
135         showSql = b;
136     }
137
138     void setIdentifierRollbackEnabled(boolean b) {
139         identifierRollbackEnabled = b;
140     }
141
142     void setMinimalPutsEnabled(boolean b) {
143         minimalPutsEnabled = b;
144     }
145
146     void setScrollableResultSetsEnabled(boolean b) {
147         scrollableResultSetsEnabled = b;
148     }
149
150     void setGetGeneratedKeysEnabled(boolean b) {
151         getGeneratedKeysEnabled = b;
152     }
153
154     public Integer JavaDoc getJdbcFetchSize() {
155         return jdbcFetchSize;
156     }
157     void setJdbcFetchSize(Integer JavaDoc integer) {
158         jdbcFetchSize = integer;
159     }
160
161     public ConnectionProvider getConnectionProvider() {
162         return connectionProvider;
163     }
164     void setConnectionProvider(ConnectionProvider provider) {
165         connectionProvider = provider;
166     }
167
168     public TransactionFactory getTransactionFactory() {
169         return transactionFactory;
170     }
171     void setTransactionFactory(TransactionFactory factory) {
172         transactionFactory = factory;
173     }
174
175     public String JavaDoc getSessionFactoryName() {
176         return sessionFactoryName;
177     }
178     void setSessionFactoryName(String JavaDoc string) {
179         sessionFactoryName = string;
180     }
181
182     public boolean isAutoCreateSchema() {
183         return autoCreateSchema;
184     }
185     public boolean isAutoDropSchema() {
186         return autoDropSchema;
187     }
188
189     public boolean isAutoUpdateSchema() {
190         return autoUpdateSchema;
191     }
192     void setAutoCreateSchema(boolean b) {
193         autoCreateSchema = b;
194     }
195
196     void setAutoDropSchema(boolean b) {
197         autoDropSchema = b;
198     }
199     void setAutoUpdateSchema(boolean b) {
200         autoUpdateSchema = b;
201     }
202
203     public Integer JavaDoc getMaximumFetchDepth() {
204         return maximumFetchDepth;
205     }
206     void setMaximumFetchDepth(Integer JavaDoc i) {
207         maximumFetchDepth = i;
208     }
209
210     public CacheProvider getCacheProvider() {
211         return cacheProvider;
212     }
213     void setCacheProvider(CacheProvider cacheProvider) {
214         this.cacheProvider = cacheProvider;
215     }
216
217     public TransactionManagerLookup getTransactionManagerLookup() {
218         return transactionManagerLookup;
219     }
220     void setTransactionManagerLookup(TransactionManagerLookup lookup) {
221         transactionManagerLookup = lookup;
222     }
223
224     public boolean isQueryCacheEnabled() {
225         return queryCacheEnabled;
226     }
227     void setQueryCacheEnabled(boolean b) {
228         queryCacheEnabled = b;
229     }
230
231     public boolean isCommentsEnabled() {
232         return commentsEnabled;
233     }
234     void setCommentsEnabled(boolean commentsEnabled) {
235         this.commentsEnabled = commentsEnabled;
236     }
237
238     public boolean isSecondLevelCacheEnabled() {
239         return secondLevelCacheEnabled;
240     }
241     void setSecondLevelCacheEnabled(boolean secondLevelCacheEnabled) {
242         this.secondLevelCacheEnabled = secondLevelCacheEnabled;
243     }
244
245     public String JavaDoc getCacheRegionPrefix() {
246         return cacheRegionPrefix;
247     }
248     void setCacheRegionPrefix(String JavaDoc cacheRegionPrefix) {
249         this.cacheRegionPrefix = cacheRegionPrefix;
250     }
251
252     public QueryCacheFactory getQueryCacheFactory() {
253         return queryCacheFactory;
254     }
255     public void setQueryCacheFactory(QueryCacheFactory queryCacheFactory) {
256         this.queryCacheFactory = queryCacheFactory;
257     }
258
259     public boolean isStatisticsEnabled() {
260         return statisticsEnabled;
261     }
262     void setStatisticsEnabled(boolean statisticsEnabled) {
263         this.statisticsEnabled = statisticsEnabled;
264     }
265
266     public boolean isJdbcBatchVersionedData() {
267         return jdbcBatchVersionedData;
268     }
269     void setJdbcBatchVersionedData(boolean jdbcBatchVersionedData) {
270         this.jdbcBatchVersionedData = jdbcBatchVersionedData;
271     }
272
273     public boolean isFlushBeforeCompletionEnabled() {
274         return flushBeforeCompletionEnabled;
275     }
276     void setFlushBeforeCompletionEnabled(boolean flushBeforeCompletionEnabled) {
277         this.flushBeforeCompletionEnabled = flushBeforeCompletionEnabled;
278     }
279
280     public BatcherFactory getBatcherFactory() {
281         return batcherFactory;
282     }
283     void setBatcherFactory(BatcherFactory batcher) {
284         this.batcherFactory = batcher;
285     }
286     
287     public boolean isAutoCloseSessionEnabled() {
288         return autoCloseSessionEnabled;
289     }
290     void setAutoCloseSessionEnabled(boolean autoCloseSessionEnabled) {
291         this.autoCloseSessionEnabled = autoCloseSessionEnabled;
292     }
293
294     public ConnectionReleaseMode getConnectionReleaseMode() {
295         return connectionReleaseMode;
296     }
297
298     public void setConnectionReleaseMode(ConnectionReleaseMode connectionReleaseMode) {
299         this.connectionReleaseMode = connectionReleaseMode;
300     }
301
302     public QueryTranslatorFactory getQueryTranslatorFactory() {
303         return queryTranslatorFactory;
304     }
305     
306     void setQueryTranslatorFactory(QueryTranslatorFactory queryTranslatorFactory) {
307         this.queryTranslatorFactory = queryTranslatorFactory;
308     }
309
310     public SQLExceptionConverter getSQLExceptionConverter() {
311         return sqlExceptionConverter;
312     }
313
314     void setSQLExceptionConverter(SQLExceptionConverter sqlExceptionConverter) {
315         this.sqlExceptionConverter = sqlExceptionConverter;
316     }
317
318     public boolean isWrapResultSetsEnabled() {
319         return wrapResultSetsEnabled;
320     }
321
322     void setWrapResultSetsEnabled(boolean wrapResultSetsEnabled) {
323         this.wrapResultSetsEnabled = wrapResultSetsEnabled;
324     }
325     
326     public boolean isOrderUpdatesEnabled() {
327         return orderUpdatesEnabled;
328     }
329     void setOrderUpdatesEnabled(boolean orderUpdatesEnabled) {
330         this.orderUpdatesEnabled = orderUpdatesEnabled;
331     }
332
333     public boolean isStructuredCacheEntriesEnabled() {
334         return structuredCacheEntriesEnabled;
335     }
336     void setStructuredCacheEntriesEnabled(boolean structuredCacheEntriesEnabled) {
337         this.structuredCacheEntriesEnabled = structuredCacheEntriesEnabled;
338     }
339
340     public EntityMode getDefaultEntityMode() {
341         return defaultEntityMode;
342     }
343
344     public void setDefaultEntityMode(EntityMode defaultEntityMode) {
345         this.defaultEntityMode = defaultEntityMode;
346     }
347
348 }
349
Popular Tags