HHH-13565 Formatting improvements
This commit is contained in:
parent
bc5b3c028f
commit
457e9b61fa
|
@ -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() );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue