diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/EntitiesConfigurations.java b/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/EntitiesConfigurations.java index 03d47c3931..683e3826cb 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/EntitiesConfigurations.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/internal/entities/EntitiesConfigurations.java @@ -97,7 +97,8 @@ public class EntitiesConfigurations { final EntityConfiguration entCfg; if ( isVersioned( entityName ) ) { entCfg = get( entityName ); - } else { + } + else { entCfg = getNotVersionEntityConfiguration( entityName ); } final RelationDescription relDesc = entCfg.getRelationDescription( propertyName ); diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/QueryBuilder.java b/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/QueryBuilder.java index 49e4ea7cf9..b010ec2673 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/QueryBuilder.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/QueryBuilder.java @@ -158,7 +158,8 @@ public class QueryBuilder { final String effectivePropertyName = propertyName == null ? "" : ".".concat( propertyName ); if ( function == null ) { projections.add( (distinct ? "distinct " : "") + alias + effectivePropertyName ); - } else { + } + else { projections.add( function + "(" + (distinct ? "distinct " : "") + alias + effectivePropertyName + ")" @@ -193,7 +194,8 @@ public class QueryBuilder { if (first) { sb.append( " where " ); first = false; - } else { + } + else { sb.append( " and " ); } params.build( sb, queryParamValues ); diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/AbstractAuditQuery.java b/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/AbstractAuditQuery.java index fc3627a62d..9424d0be83 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/AbstractAuditQuery.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/AbstractAuditQuery.java @@ -284,7 +284,8 @@ public abstract class AbstractAuditQuery implements AuditQueryImplementor { // qr is the value of the projection itself final Pair projection = projections.get( 0 ); result.add( projection.getSecond().convertQueryResult( enversService, entityInstantiator, projection.getFirst(), revision, qr ) ); - } else { + } + else { // qr is an array where each of its components holds the value of corresponding projection Object[] qresults = (Object[]) qr; Object[] tresults = new Object[qresults.length]; @@ -295,7 +296,8 @@ public abstract class AbstractAuditQuery implements AuditQueryImplementor { result.add( tresults ); } } - } else { + } + else { entityInstantiator.addInstancesFromVersionsEntities( entityName, result, queryResult, revision ); } return result; diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/EntitiesModifiedAtRevisionQuery.java b/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/EntitiesModifiedAtRevisionQuery.java index d6eb0ee740..ab54d82a06 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/EntitiesModifiedAtRevisionQuery.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/query/internal/impl/EntitiesModifiedAtRevisionQuery.java @@ -71,11 +71,11 @@ public class EntitiesModifiedAtRevisionQuery extends AbstractAuditQuery { } for (final AuditAssociationQueryImpl associationQuery : associationQueries) { - associationQuery.addCriterionsToQuery(versionsReader); + associationQuery.addCriterionsToQuery( versionsReader ); } Query query = buildQuery(); List queryResult = query.list(); - return applyProjections(queryResult, revision); + return applyProjections( queryResult, revision ); } }