HHH-13565 Formatting improvements

This commit is contained in:
Sanne Grinovero 2019-08-12 20:28:25 +01:00
parent bc5b3c028f
commit 457e9b61fa
2 changed files with 15 additions and 15 deletions

View File

@ -423,7 +423,7 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont
this
);
}
if ( !isClosed() || (waitingForAutoClose && factory.isOpen()) ) {
if ( !isClosed() || ( waitingForAutoClose && factory.isOpen() ) ) {
getTransactionCoordinator().pulse();
}
return this.currentHibernateTransaction;
@ -902,7 +902,7 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont
@SuppressWarnings({"WeakerAccess", "unchecked"})
protected <T> NativeQueryImplementor createNativeQuery(NamedSQLQueryDefinition queryDefinition, Class<T> resultType) {
if ( resultType != null && !Tuple.class.equals(resultType)) {
if ( resultType != null && !Tuple.class.equals( resultType ) ) {
resultClassChecking( resultType, queryDefinition );
}
@ -911,8 +911,8 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont
this,
factory.getQueryPlanCache().getSQLParameterMetadata( queryDefinition.getQueryString(), false )
);
if (Tuple.class.equals(resultType)) {
query.setResultTransformer(new NativeQueryTupleTransformer());
if ( Tuple.class.equals( resultType ) ) {
query.setResultTransformer( new NativeQueryTupleTransformer() );
}
query.setHibernateFlushMode( queryDefinition.getFlushMode() );
query.setComment( queryDefinition.getComment() != null ? queryDefinition.getComment() : queryDefinition.getName() );

View File

@ -30,21 +30,21 @@ public abstract class ConfigurationHelper {
public static FlushMode getFlushMode(Object value, FlushMode defaultFlushMode) {
final FlushMode flushMode;
if (value instanceof FlushMode) {
if ( value instanceof FlushMode ) {
flushMode = (FlushMode) value;
}
else if (value instanceof javax.persistence.FlushModeType) {
flushMode = ConfigurationHelper.getFlushMode( (javax.persistence.FlushModeType) value);
else if ( value instanceof javax.persistence.FlushModeType ) {
flushMode = ConfigurationHelper.getFlushMode( (javax.persistence.FlushModeType) value );
}
else if (value instanceof String) {
flushMode = ConfigurationHelper.getFlushMode( (String) value);
else if ( value instanceof String ) {
flushMode = ConfigurationHelper.getFlushMode( (String) value );
}
else {
flushMode = defaultFlushMode;
}
if (flushMode == null) {
throw new PersistenceException("Unable to parse org.hibernate.flushMode: " + value);
if ( flushMode == null ) {
throw new PersistenceException( "Unable to parse org.hibernate.flushMode: " + value );
}
return flushMode;
@ -55,21 +55,21 @@ public abstract class ConfigurationHelper {
}
private static FlushMode getFlushMode(String flushMode) {
if (flushMode == null) {
if ( flushMode == null ) {
return null;
}
flushMode = flushMode.toUpperCase(Locale.ROOT);
flushMode = flushMode.toUpperCase( Locale.ROOT );
return FlushMode.valueOf( flushMode );
}
private static FlushMode getFlushMode(FlushModeType flushMode) {
switch(flushMode) {
switch ( flushMode ) {
case AUTO:
return FlushMode.AUTO;
case COMMIT:
return FlushMode.COMMIT;
default:
throw new AssertionFailure("Unknown FlushModeType: " + flushMode);
throw new AssertionFailure( "Unknown FlushModeType: " + flushMode );
}
}