mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 05:04:52 +00:00
false is the default for getBoolean()
This commit is contained in:
parent
7ff2c86c6e
commit
c648aee954
@ -511,18 +511,16 @@ public SessionFactoryOptionsBuilder(StandardServiceRegistry serviceRegistry, Boo
|
|||||||
|
|
||||||
this.commentsEnabled = getBoolean( USE_SQL_COMMENTS, configurationSettings );
|
this.commentsEnabled = getBoolean( USE_SQL_COMMENTS, configurationSettings );
|
||||||
|
|
||||||
this.preferUserTransaction = getBoolean( PREFER_USER_TRANSACTION, configurationSettings, false );
|
this.preferUserTransaction = getBoolean( PREFER_USER_TRANSACTION, configurationSettings );
|
||||||
|
|
||||||
this.allowOutOfTransactionUpdateOperations = getBoolean(
|
this.allowOutOfTransactionUpdateOperations = getBoolean(
|
||||||
ALLOW_UPDATE_OUTSIDE_TRANSACTION,
|
ALLOW_UPDATE_OUTSIDE_TRANSACTION,
|
||||||
configurationSettings,
|
configurationSettings
|
||||||
false
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.releaseResourcesOnCloseEnabled = getBoolean(
|
this.releaseResourcesOnCloseEnabled = getBoolean(
|
||||||
DISCARD_PC_ON_CLOSE,
|
DISCARD_PC_ON_CLOSE,
|
||||||
configurationSettings,
|
configurationSettings
|
||||||
false
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Object jdbcTimeZoneValue = configurationSettings.get(
|
Object jdbcTimeZoneValue = configurationSettings.get(
|
||||||
@ -556,8 +554,7 @@ else if ( jdbcTimeZoneValue != null ) {
|
|||||||
|
|
||||||
this.failOnPaginationOverCollectionFetchEnabled = getBoolean(
|
this.failOnPaginationOverCollectionFetchEnabled = getBoolean(
|
||||||
FAIL_ON_PAGINATION_OVER_COLLECTION_FETCH,
|
FAIL_ON_PAGINATION_OVER_COLLECTION_FETCH,
|
||||||
configurationSettings,
|
configurationSettings
|
||||||
false
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.immutableEntityUpdateQueryHandlingMode = ImmutableEntityUpdateQueryHandlingMode.interpret(
|
this.immutableEntityUpdateQueryHandlingMode = ImmutableEntityUpdateQueryHandlingMode.interpret(
|
||||||
@ -569,8 +566,7 @@ else if ( jdbcTimeZoneValue != null ) {
|
|||||||
|
|
||||||
this.inClauseParameterPaddingEnabled = getBoolean(
|
this.inClauseParameterPaddingEnabled = getBoolean(
|
||||||
IN_CLAUSE_PARAMETER_PADDING,
|
IN_CLAUSE_PARAMETER_PADDING,
|
||||||
configurationSettings,
|
configurationSettings
|
||||||
false
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.queryStatisticsMaxSize = getInt(
|
this.queryStatisticsMaxSize = getInt(
|
||||||
|
@ -84,11 +84,7 @@ public void configure(Map<String, Object> configurationValues) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private PooledConnections buildPool(Map<String,Object> configurationValues, ServiceRegistryImplementor serviceRegistry) {
|
private PooledConnections buildPool(Map<String,Object> configurationValues, ServiceRegistryImplementor serviceRegistry) {
|
||||||
final boolean autoCommit = ConfigurationHelper.getBoolean(
|
final boolean autoCommit = ConfigurationHelper.getBoolean( AvailableSettings.AUTOCOMMIT, configurationValues );
|
||||||
AvailableSettings.AUTOCOMMIT,
|
|
||||||
configurationValues,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
final int minSize = ConfigurationHelper.getInt( MIN_SIZE, configurationValues, 1 );
|
final int minSize = ConfigurationHelper.getInt( MIN_SIZE, configurationValues, 1 );
|
||||||
final int maxSize = ConfigurationHelper.getInt( AvailableSettings.POOL_SIZE, configurationValues, 20 );
|
final int maxSize = ConfigurationHelper.getInt( AvailableSettings.POOL_SIZE, configurationValues, 20 );
|
||||||
final int initialSize = ConfigurationHelper.getInt( INITIAL_SIZE, configurationValues, minSize );
|
final int initialSize = ConfigurationHelper.getInt( INITIAL_SIZE, configurationValues, minSize );
|
||||||
@ -170,7 +166,7 @@ else if ( url != null ) {
|
|||||||
CONNECTIONS_MESSAGE_LOGGER.connectionProperties( ConfigurationHelper.maskOut( connectionProps, "password" ) );
|
CONNECTIONS_MESSAGE_LOGGER.connectionProperties( ConfigurationHelper.maskOut( connectionProps, "password" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean autoCommit = ConfigurationHelper.getBoolean( AvailableSettings.AUTOCOMMIT, configurationValues, false );
|
final boolean autoCommit = ConfigurationHelper.getBoolean( AvailableSettings.AUTOCOMMIT, configurationValues );
|
||||||
CONNECTIONS_MESSAGE_LOGGER.autoCommitMode( autoCommit );
|
CONNECTIONS_MESSAGE_LOGGER.autoCommitMode( autoCommit );
|
||||||
|
|
||||||
final Integer isolation = ConnectionProviderInitiator.extractIsolation( configurationValues );
|
final Integer isolation = ConnectionProviderInitiator.extractIsolation( configurationValues );
|
||||||
|
@ -26,9 +26,9 @@ public class SqlStatementLoggerInitiator implements StandardServiceInitiator<Sql
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SqlStatementLogger initiateService(Map<String, Object> configValues, ServiceRegistryImplementor registry) {
|
public SqlStatementLogger initiateService(Map<String, Object> configValues, ServiceRegistryImplementor registry) {
|
||||||
final boolean showSQL = ConfigurationHelper.getBoolean( Environment.SHOW_SQL, configValues, false );
|
final boolean showSQL = ConfigurationHelper.getBoolean( Environment.SHOW_SQL, configValues );
|
||||||
final boolean formatSQL = ConfigurationHelper.getBoolean( Environment.FORMAT_SQL, configValues, false );
|
final boolean formatSQL = ConfigurationHelper.getBoolean( Environment.FORMAT_SQL, configValues );
|
||||||
final boolean highlightSQL = ConfigurationHelper.getBoolean( Environment.HIGHLIGHT_SQL, configValues, false );
|
final boolean highlightSQL = ConfigurationHelper.getBoolean( Environment.HIGHLIGHT_SQL, configValues );
|
||||||
final long logSlowQuery = ConfigurationHelper.getLong( Environment.LOG_SLOW_QUERY, configValues, 0 );
|
final long logSlowQuery = ConfigurationHelper.getLong( Environment.LOG_SLOW_QUERY, configValues, 0 );
|
||||||
|
|
||||||
return new SqlStatementLogger( showSQL, formatSQL, highlightSQL, logSlowQuery );
|
return new SqlStatementLogger( showSQL, formatSQL, highlightSQL, logSlowQuery );
|
||||||
|
@ -201,7 +201,7 @@ public void configure(Type type, Properties parameters, ServiceRegistry serviceR
|
|||||||
int incrementSize = determineIncrementSize( parameters );
|
int incrementSize = determineIncrementSize( parameters );
|
||||||
final OptimizerDescriptor optimizationStrategy = determineOptimizationStrategy( parameters, incrementSize );
|
final OptimizerDescriptor optimizationStrategy = determineOptimizationStrategy( parameters, incrementSize );
|
||||||
|
|
||||||
boolean forceTableUse = getBoolean( FORCE_TBL_PARAM, parameters, false );
|
boolean forceTableUse = getBoolean( FORCE_TBL_PARAM, parameters );
|
||||||
final boolean physicalSequence = isPhysicalSequence( jdbcEnvironment, forceTableUse );
|
final boolean physicalSequence = isPhysicalSequence( jdbcEnvironment, forceTableUse );
|
||||||
|
|
||||||
incrementSize = adjustIncrementSize(
|
incrementSize = adjustIncrementSize(
|
||||||
|
@ -489,7 +489,7 @@ protected String determineSegmentValue(Properties params) {
|
|||||||
* @return The default segment value to use.
|
* @return The default segment value to use.
|
||||||
*/
|
*/
|
||||||
protected String determineDefaultSegmentValue(Properties params) {
|
protected String determineDefaultSegmentValue(Properties params) {
|
||||||
final boolean preferSegmentPerEntity = getBoolean( CONFIG_PREFER_SEGMENT_PER_ENTITY, params, false );
|
final boolean preferSegmentPerEntity = getBoolean( CONFIG_PREFER_SEGMENT_PER_ENTITY, params );
|
||||||
final String defaultToUse = preferSegmentPerEntity ? params.getProperty( TABLE ) : DEF_SEGMENT_VALUE;
|
final String defaultToUse = preferSegmentPerEntity ? params.getProperty( TABLE ) : DEF_SEGMENT_VALUE;
|
||||||
LOG.usingDefaultIdGeneratorSegmentValue( qualifiedTableName.render(), segmentColumnName, defaultToUse );
|
LOG.usingDefaultIdGeneratorSegmentValue( qualifiedTableName.render(), segmentColumnName, defaultToUse );
|
||||||
return defaultToUse;
|
return defaultToUse;
|
||||||
|
@ -1598,8 +1598,7 @@ private void maskOutIfSet(Map<String, Object> props, String setting) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logIfEmptyCompositesEnabled(Map<String, Object> props ) {
|
private void logIfEmptyCompositesEnabled(Map<String, Object> props ) {
|
||||||
final boolean isEmptyCompositesEnabled =
|
final boolean isEmptyCompositesEnabled = getBoolean( CREATE_EMPTY_COMPOSITES_ENABLED, props );
|
||||||
getBoolean( CREATE_EMPTY_COMPOSITES_ENABLED, props, false );
|
|
||||||
if ( isEmptyCompositesEnabled ) {
|
if ( isEmptyCompositesEnabled ) {
|
||||||
LOG.emptyCompositesEnabled();
|
LOG.emptyCompositesEnabled();
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,7 @@ public class MutableJpaComplianceImpl implements MutableJpaCompliance {
|
|||||||
public MutableJpaComplianceImpl(Map<?,?> configurationSettings) {
|
public MutableJpaComplianceImpl(Map<?,?> configurationSettings) {
|
||||||
this(
|
this(
|
||||||
configurationSettings,
|
configurationSettings,
|
||||||
ConfigurationHelper.getBoolean(
|
ConfigurationHelper.getBoolean( AvailableSettings.JPA_COMPLIANCE, configurationSettings )
|
||||||
AvailableSettings.JPA_COMPLIANCE,
|
|
||||||
configurationSettings,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,8 +166,7 @@ private EmbeddableMappingTypeImpl(
|
|||||||
|
|
||||||
this.createEmptyCompositesEnabled = ConfigurationHelper.getBoolean(
|
this.createEmptyCompositesEnabled = ConfigurationHelper.getBoolean(
|
||||||
Environment.CREATE_EMPTY_COMPOSITES_ENABLED,
|
Environment.CREATE_EMPTY_COMPOSITES_ENABLED,
|
||||||
creationContext.getServiceRegistry().getService( ConfigurationService.class ).getSettings(),
|
creationContext.getServiceRegistry().getService( ConfigurationService.class ).getSettings()
|
||||||
false
|
|
||||||
);
|
);
|
||||||
final AggregateColumn aggregateColumn = bootDescriptor.getAggregateColumn();
|
final AggregateColumn aggregateColumn = bootDescriptor.getAggregateColumn();
|
||||||
if ( aggregateColumn != null ) {
|
if ( aggregateColumn != null ) {
|
||||||
|
@ -61,7 +61,7 @@ public NamedQueryDescriptorBuilder(
|
|||||||
cacheMode = cacheable ? determineCacheMode( hints, sessionFactory ) : null;
|
cacheMode = cacheable ? determineCacheMode( hints, sessionFactory ) : null;
|
||||||
|
|
||||||
flushMode = determineFlushMode( hints, sessionFactory );
|
flushMode = determineFlushMode( hints, sessionFactory );
|
||||||
readOnly = ConfigurationHelper.getBoolean( HINT_READ_ONLY, hints, false );
|
readOnly = ConfigurationHelper.getBoolean( HINT_READ_ONLY, hints );
|
||||||
|
|
||||||
lockOptions = determineLockOptions( hints, sessionFactory );
|
lockOptions = determineLockOptions( hints, sessionFactory );
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ public void setComment(String comment) {
|
|||||||
|
|
||||||
private static boolean isCacheable(Map<String, Object> hints, SessionFactoryImplementor sessionFactory) {
|
private static boolean isCacheable(Map<String, Object> hints, SessionFactoryImplementor sessionFactory) {
|
||||||
return sessionFactory.getSessionFactoryOptions().isQueryCacheEnabled()
|
return sessionFactory.getSessionFactoryOptions().isQueryCacheEnabled()
|
||||||
&& ConfigurationHelper.getBoolean( HINT_CACHEABLE, hints, false );
|
&& ConfigurationHelper.getBoolean( HINT_CACHEABLE, hints );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String determineCacheRegion(Map<String, Object> hints, SessionFactoryImplementor sessionFactory) {
|
private static String determineCacheRegion(Map<String, Object> hints, SessionFactoryImplementor sessionFactory) {
|
||||||
|
@ -29,8 +29,7 @@ public class ParameterMarkerStrategyInitiator implements StandardServiceInitiato
|
|||||||
public ParameterMarkerStrategy initiateService(Map<String, Object> configurationValues, ServiceRegistryImplementor registry) {
|
public ParameterMarkerStrategy initiateService(Map<String, Object> configurationValues, ServiceRegistryImplementor registry) {
|
||||||
final boolean useNativeMarkers = ConfigurationHelper.getBoolean(
|
final boolean useNativeMarkers = ConfigurationHelper.getBoolean(
|
||||||
AvailableSettings.DIALECT_NATIVE_PARAM_MARKERS,
|
AvailableSettings.DIALECT_NATIVE_PARAM_MARKERS,
|
||||||
configurationValues,
|
configurationValues
|
||||||
false
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( useNativeMarkers ) {
|
if ( useNativeMarkers ) {
|
||||||
|
@ -45,7 +45,7 @@ public static JdbcMetadaAccessStrategy interpretSetting(Map options) {
|
|||||||
if ( options == null ) {
|
if ( options == null ) {
|
||||||
return interpretHbm2ddlSetting( null );
|
return interpretHbm2ddlSetting( null );
|
||||||
}
|
}
|
||||||
else if ( ConfigurationHelper.getBoolean( AvailableSettings.ENABLE_SYNONYMS, options, false ) ) {
|
else if ( ConfigurationHelper.getBoolean( AvailableSettings.ENABLE_SYNONYMS, options ) ) {
|
||||||
// Use of synonyms can cause issues during schema validation or schema update when GROUPED strategy is used (especially in Oracle)
|
// Use of synonyms can cause issues during schema validation or schema update when GROUPED strategy is used (especially in Oracle)
|
||||||
return INDIVIDUALLY;
|
return INDIVIDUALLY;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ public AbstractInformationExtractorImpl(ExtractionContext extractionContext) {
|
|||||||
final List<String> tableTypesList = new ArrayList<>();
|
final List<String> tableTypesList = new ArrayList<>();
|
||||||
tableTypesList.add( "TABLE" );
|
tableTypesList.add( "TABLE" );
|
||||||
tableTypesList.add( "VIEW" );
|
tableTypesList.add( "VIEW" );
|
||||||
if ( ConfigurationHelper.getBoolean( AvailableSettings.ENABLE_SYNONYMS, configService.getSettings(), false ) ) {
|
if ( ConfigurationHelper.getBoolean( AvailableSettings.ENABLE_SYNONYMS, configService.getSettings() ) ) {
|
||||||
if ( dialect instanceof DB2Dialect ) {
|
if ( dialect instanceof DB2Dialect ) {
|
||||||
tableTypesList.add( "ALIAS" );
|
tableTypesList.add( "ALIAS" );
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,7 @@ public static boolean interpretNamespaceHandling(Map<String,Object> configuratio
|
|||||||
//Then try the Hibernate ORM setting:
|
//Then try the Hibernate ORM setting:
|
||||||
ConfigurationHelper.getBoolean(
|
ConfigurationHelper.getBoolean(
|
||||||
AvailableSettings.HBM2DDL_CREATE_NAMESPACES,
|
AvailableSettings.HBM2DDL_CREATE_NAMESPACES,
|
||||||
configurationValues,
|
configurationValues
|
||||||
false
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -172,8 +171,7 @@ public static boolean interpretNamespaceHandling(Map<String,Object> configuratio
|
|||||||
public static boolean interpretFormattingEnabled(Map<String,Object> configurationValues) {
|
public static boolean interpretFormattingEnabled(Map<String,Object> configurationValues) {
|
||||||
return ConfigurationHelper.getBoolean(
|
return ConfigurationHelper.getBoolean(
|
||||||
AvailableSettings.FORMAT_SQL,
|
AvailableSettings.FORMAT_SQL,
|
||||||
configurationValues,
|
configurationValues
|
||||||
false
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ else if ( reader != null ) {
|
|||||||
if ( parameters.containsKey (NAMED ) ) {
|
if ( parameters.containsKey (NAMED ) ) {
|
||||||
indicators = new LocalJdbcTypeIndicators(
|
indicators = new LocalJdbcTypeIndicators(
|
||||||
// use ORDINAL as default for hbm.xml mappings
|
// use ORDINAL as default for hbm.xml mappings
|
||||||
getBoolean( NAMED, parameters, false ) ? STRING : ORDINAL,
|
getBoolean( NAMED, parameters ) ? STRING : ORDINAL,
|
||||||
false,
|
false,
|
||||||
columnLength
|
columnLength
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user