-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
SessionFactoryOptionsState.java
210 lines (139 loc) · 5.54 KB
/
SessionFactoryOptionsState.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.boot.internal;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.CustomEntityDirtinessStrategy;
import org.hibernate.EntityMode;
import org.hibernate.EntityNameResolver;
import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
import org.hibernate.MultiTenancyStrategy;
import org.hibernate.NullPrecedence;
import org.hibernate.SessionFactoryObserver;
import org.hibernate.boot.SchemaAutoTooling;
import org.hibernate.boot.TempTableDdlTransactionHandling;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.spi.SessionFactoryOptions;
import org.hibernate.cache.spi.QueryCacheFactory;
import org.hibernate.cfg.BaselineSessionEventsListenerBuilder;
import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy;
import org.hibernate.loader.BatchFetchStyle;
import org.hibernate.proxy.EntityNotFoundDelegate;
import org.hibernate.query.criteria.LiteralHandlingMode;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.resource.jdbc.spi.StatementInspector;
import org.hibernate.tuple.entity.EntityTuplizerFactory;
import java.util.Map;
import java.util.TimeZone;
import java.util.function.Supplier;
/**
* Sort of a mutable SessionFactoryOptions used during SessionFactoryBuilder calls.
*
* @author Steve Ebersole
*/
public interface SessionFactoryOptionsState {
StandardServiceRegistry getServiceRegistry();
/**
* @deprecated (since 5.2) see {@link SessionFactoryOptions#isJpaBootstrap} for details
* on deprecation and intention/use.
*/
@Deprecated
boolean isJpaBootstrap();
boolean isJtaTransactionAccessEnabled();
boolean isAllowRefreshDetachedEntity();
boolean isAllowOutOfTransactionUpdateOperations();
boolean isReleaseResourcesOnCloseEnabled();
Object getBeanManagerReference();
Object getValidatorFactoryReference();
String getSessionFactoryName();
boolean isSessionFactoryNameAlsoJndiName();
boolean isFlushBeforeCompletionEnabled();
boolean isAutoCloseSessionEnabled();
boolean isStatisticsEnabled();
Interceptor getInterceptor();
/**
* Returns an {@link Interceptor} class.
*
* @deprecated use {@link #getStatelessInterceptorImplementorSupplier()} instead.
* @return {@link Interceptor} class
*/
@Deprecated
Class<? extends Interceptor> getStatelessInterceptorImplementor();
default Supplier<? extends Interceptor> getStatelessInterceptorImplementorSupplier() {
return () -> {
try {
return getStatelessInterceptorImplementor().newInstance();
}
catch (InstantiationException | IllegalAccessException e) {
throw new HibernateException( "Could not supply session-scoped SessionFactory Interceptor", e );
}
};
}
StatementInspector getStatementInspector();
SessionFactoryObserver[] getSessionFactoryObservers();
BaselineSessionEventsListenerBuilder getBaselineSessionEventsListenerBuilder();
boolean isIdentifierRollbackEnabled();
EntityMode getDefaultEntityMode();
EntityTuplizerFactory getEntityTuplizerFactory();
boolean isCheckNullability();
boolean isInitializeLazyStateOutsideTransactionsEnabled();
MultiTableBulkIdStrategy getMultiTableBulkIdStrategy();
TempTableDdlTransactionHandling getTempTableDdlTransactionHandling();
BatchFetchStyle getBatchFetchStyle();
int getDefaultBatchFetchSize();
Integer getMaximumFetchDepth();
NullPrecedence getDefaultNullPrecedence();
boolean isOrderUpdatesEnabled();
boolean isOrderInsertsEnabled();
MultiTenancyStrategy getMultiTenancyStrategy();
CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver();
boolean isJtaTrackByThread();
Map getQuerySubstitutions();
boolean isStrictJpaQueryLanguageCompliance();
boolean isNamedQueryStartupCheckingEnabled();
boolean isConventionalJavaConstants();
boolean isProcedureParameterNullPassingEnabled();
boolean isCollectionJoinSubqueryRewriteEnabled();
boolean isSecondLevelCacheEnabled();
boolean isQueryCacheEnabled();
QueryCacheFactory getQueryCacheFactory();
String getCacheRegionPrefix();
boolean isMinimalPutsEnabled();
boolean isStructuredCacheEntriesEnabled();
boolean isDirectReferenceCacheEntriesEnabled();
boolean isAutoEvictCollectionCache();
SchemaAutoTooling getSchemaAutoTooling();
int getJdbcBatchSize();
boolean isJdbcBatchVersionedData();
boolean isScrollableResultSetsEnabled();
boolean isWrapResultSetsEnabled();
boolean isGetGeneratedKeysEnabled();
Integer getJdbcFetchSize();
PhysicalConnectionHandlingMode getPhysicalConnectionHandlingMode();
boolean connectionProviderDisablesAutoCommit();
/**
* @deprecated Use {@link #getPhysicalConnectionHandlingMode()} instead
*/
@Deprecated
ConnectionReleaseMode getConnectionReleaseMode();
boolean isCommentsEnabled();
CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy();
EntityNameResolver[] getEntityNameResolvers();
EntityNotFoundDelegate getEntityNotFoundDelegate();
Map<String, SQLFunction> getCustomSqlFunctionMap();
boolean isPreferUserTransaction();
TimeZone getJdbcTimeZone();
boolean isQueryParametersValidationEnabled();
default LiteralHandlingMode getCriteriaLiteralHandlingMode() {
return LiteralHandlingMode.AUTO;
}
default boolean isFailOnPaginationOverCollectionFetchEnabled() {
return false;
}
}