HHH-5645 - Fix Checkstyle errors
This commit is contained in:
parent
d330fdcfca
commit
877e790995
|
@ -36,11 +36,11 @@ public abstract class OuterJoinLoader extends BasicLoader {
|
||||||
protected String[] suffixes;
|
protected String[] suffixes;
|
||||||
protected String[] collectionSuffixes;
|
protected String[] collectionSuffixes;
|
||||||
|
|
||||||
private LoadQueryInfluencers loadQueryInfluencers;
|
private LoadQueryInfluencers loadQueryInfluencers;
|
||||||
|
|
||||||
protected final Dialect getDialect() {
|
protected final Dialect getDialect() {
|
||||||
return getFactory().getDialect();
|
return getFactory().getDialect();
|
||||||
}
|
}
|
||||||
|
|
||||||
public OuterJoinLoader(
|
public OuterJoinLoader(
|
||||||
SessionFactoryImplementor factory,
|
SessionFactoryImplementor factory,
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class CriteriaLoader extends OuterJoinLoader {
|
||||||
for ( int i=0, pos=0; i<result.length; i++ ) {
|
for ( int i=0, pos=0; i<result.length; i++ ) {
|
||||||
int numColumns = types[i].getColumnSpan( session.getFactory() );
|
int numColumns = types[i].getColumnSpan( session.getFactory() );
|
||||||
if ( numColumns > 1 ) {
|
if ( numColumns > 1 ) {
|
||||||
String[] typeColumnAliases = ArrayHelper.slice( columnAliases, pos, numColumns );
|
String[] typeColumnAliases = ArrayHelper.slice( columnAliases, pos, numColumns );
|
||||||
result[i] = types[i].nullSafeGet(rs, typeColumnAliases, session, null);
|
result[i] = types[i].nullSafeGet(rs, typeColumnAliases, session, null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -207,8 +207,8 @@ public class CriteriaLoader extends OuterJoinLoader {
|
||||||
|
|
||||||
if ( ( parameters.getLockOptions().getFollowOnLocking() == null && dialect.useFollowOnLocking( parameters ) ) ||
|
if ( ( parameters.getLockOptions().getFollowOnLocking() == null && dialect.useFollowOnLocking( parameters ) ) ||
|
||||||
( parameters.getLockOptions().getFollowOnLocking() != null && parameters.getLockOptions().getFollowOnLocking() ) ) {
|
( parameters.getLockOptions().getFollowOnLocking() != null && parameters.getLockOptions().getFollowOnLocking() ) ) {
|
||||||
final LockMode lockMode = determineFollowOnLockMode( lockOptions );
|
final LockMode lockMode = determineFollowOnLockMode( lockOptions );
|
||||||
if( lockMode != LockMode.UPGRADE_SKIPLOCKED ) {
|
if ( lockMode != LockMode.UPGRADE_SKIPLOCKED ) {
|
||||||
// Dialect prefers to perform locking in a separate step
|
// Dialect prefers to perform locking in a separate step
|
||||||
LOG.usingFollowOnLocking();
|
LOG.usingFollowOnLocking();
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public class CriteriaLoader extends OuterJoinLoader {
|
||||||
( (Session) session ).buildLockRequest( lockOptionsToUse )
|
( (Session) session ).buildLockRequest( lockOptionsToUse )
|
||||||
.lock( persister.getEntityName(), entity );
|
.lock( persister.getEntityName(), entity );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
parameters.setLockOptions( new LockOptions() );
|
parameters.setLockOptions( new LockOptions() );
|
||||||
return sql;
|
return sql;
|
||||||
|
|
|
@ -67,26 +67,26 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
|
||||||
private final Map<String, Criteria> associationPathCriteriaMap = new LinkedHashMap<String, Criteria>();
|
private final Map<String, Criteria> associationPathCriteriaMap = new LinkedHashMap<String, Criteria>();
|
||||||
private final Map<String, JoinType> associationPathJoinTypesMap = new LinkedHashMap<String,JoinType>();
|
private final Map<String, JoinType> associationPathJoinTypesMap = new LinkedHashMap<String,JoinType>();
|
||||||
private final Map<String, Criterion> withClauseMap = new HashMap<String, Criterion>();
|
private final Map<String, Criterion> withClauseMap = new HashMap<String, Criterion>();
|
||||||
private Set<String> associations;
|
private Set<String> associations;
|
||||||
|
|
||||||
private final SessionFactoryImplementor sessionFactory;
|
private final SessionFactoryImplementor sessionFactory;
|
||||||
private final SessionFactoryHelper helper;
|
private final SessionFactoryHelper helper;
|
||||||
|
|
||||||
public CriteriaQueryTranslator(
|
public CriteriaQueryTranslator(
|
||||||
final SessionFactoryImplementor factory,
|
final SessionFactoryImplementor factory,
|
||||||
final CriteriaImpl criteria,
|
final CriteriaImpl criteria,
|
||||||
final String rootEntityName,
|
final String rootEntityName,
|
||||||
final String rootSQLAlias,
|
final String rootSQLAlias,
|
||||||
CriteriaQuery outerQuery) throws HibernateException {
|
CriteriaQuery outerQuery) throws HibernateException {
|
||||||
this( factory, criteria, rootEntityName, rootSQLAlias );
|
this( factory, criteria, rootEntityName, rootSQLAlias );
|
||||||
outerQueryTranslator = outerQuery;
|
outerQueryTranslator = outerQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CriteriaQueryTranslator(
|
public CriteriaQueryTranslator(
|
||||||
final SessionFactoryImplementor factory,
|
final SessionFactoryImplementor factory,
|
||||||
final CriteriaImpl criteria,
|
final CriteriaImpl criteria,
|
||||||
final String rootEntityName,
|
final String rootEntityName,
|
||||||
final String rootSQLAlias) throws HibernateException {
|
final String rootSQLAlias) throws HibernateException {
|
||||||
this.rootCriteria = criteria;
|
this.rootCriteria = criteria;
|
||||||
this.rootEntityName = rootEntityName;
|
this.rootEntityName = rootEntityName;
|
||||||
this.sessionFactory = factory;
|
this.sessionFactory = factory;
|
||||||
|
@ -344,17 +344,17 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
|
||||||
final Type[] typeArray = ArrayHelper.toTypeArray( types );
|
final Type[] typeArray = ArrayHelper.toTypeArray( types );
|
||||||
return new QueryParameters(
|
return new QueryParameters(
|
||||||
typeArray,
|
typeArray,
|
||||||
valueArray,
|
valueArray,
|
||||||
lockOptions,
|
lockOptions,
|
||||||
selection,
|
selection,
|
||||||
rootCriteria.isReadOnlyInitialized(),
|
rootCriteria.isReadOnlyInitialized(),
|
||||||
( rootCriteria.isReadOnlyInitialized() && rootCriteria.isReadOnly() ),
|
( rootCriteria.isReadOnlyInitialized() && rootCriteria.isReadOnly() ),
|
||||||
rootCriteria.getCacheable(),
|
rootCriteria.getCacheable(),
|
||||||
rootCriteria.getCacheRegion(),
|
rootCriteria.getCacheRegion(),
|
||||||
rootCriteria.getComment(),
|
rootCriteria.getComment(),
|
||||||
rootCriteria.getQueryHints(),
|
rootCriteria.getQueryHints(),
|
||||||
rootCriteria.isLookupByNaturalKey(),
|
rootCriteria.isLookupByNaturalKey(),
|
||||||
rootCriteria.getResultTransformer()
|
rootCriteria.getResultTransformer()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,8 +375,8 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
|
||||||
public String getSelect() {
|
public String getSelect() {
|
||||||
return rootCriteria.getProjection().toSqlString(
|
return rootCriteria.getProjection().toSqlString(
|
||||||
rootCriteria.getProjectionCriteria(),
|
rootCriteria.getProjectionCriteria(),
|
||||||
0,
|
0,
|
||||||
this
|
this
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
|
||||||
@Override
|
@Override
|
||||||
public String[] getColumnsUsingProjection(
|
public String[] getColumnsUsingProjection(
|
||||||
Criteria subcriteria,
|
Criteria subcriteria,
|
||||||
String propertyName) throws HibernateException {
|
String propertyName) throws HibernateException {
|
||||||
|
|
||||||
//first look for a reference to a projection alias
|
//first look for a reference to a projection alias
|
||||||
final Projection projection = rootCriteria.getProjection();
|
final Projection projection = rootCriteria.getProjection();
|
||||||
|
@ -512,11 +512,11 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
|
||||||
@Override
|
@Override
|
||||||
public String[] getColumns(
|
public String[] getColumns(
|
||||||
String propertyName,
|
String propertyName,
|
||||||
Criteria subcriteria) throws HibernateException {
|
Criteria subcriteria) throws HibernateException {
|
||||||
return getPropertyMapping( getEntityName( subcriteria, propertyName ) )
|
return getPropertyMapping( getEntityName( subcriteria, propertyName ) )
|
||||||
.toColumns(
|
.toColumns(
|
||||||
getSQLAlias( subcriteria, propertyName ),
|
getSQLAlias( subcriteria, propertyName ),
|
||||||
getPropertyName( propertyName )
|
getPropertyName( propertyName )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,8 +549,8 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
|
||||||
//first look for a reference to a projection alias
|
//first look for a reference to a projection alias
|
||||||
final Projection projection = rootCriteria.getProjection();
|
final Projection projection = rootCriteria.getProjection();
|
||||||
Type[] projectionTypes = projection == null ?
|
Type[] projectionTypes = projection == null ?
|
||||||
null :
|
null :
|
||||||
projection.getTypes( propertyName, subcriteria, this );
|
projection.getTypes( propertyName, subcriteria, this );
|
||||||
|
|
||||||
if ( projectionTypes == null ) {
|
if ( projectionTypes == null ) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -683,8 +683,8 @@ public abstract class CollectionType extends AbstractType implements Association
|
||||||
// for a null target, or a target which is the same as the original, we
|
// for a null target, or a target which is the same as the original, we
|
||||||
// need to put the merged elements in a new collection
|
// need to put the merged elements in a new collection
|
||||||
Object result = ( target == null ||
|
Object result = ( target == null ||
|
||||||
target == original ||
|
target == original ||
|
||||||
target == LazyPropertyInitializer.UNFETCHED_PROPERTY ) ?
|
target == LazyPropertyInitializer.UNFETCHED_PROPERTY ) ?
|
||||||
instantiateResult( original ) : target;
|
instantiateResult( original ) : target;
|
||||||
|
|
||||||
//for arrays, replaceElements() may return a different reference, since
|
//for arrays, replaceElements() may return a different reference, since
|
||||||
|
|
Loading…
Reference in New Issue