HHH-10070 - Deprecate use of "collection properties" in HQL
(cherry picked from commit d85fd04eb0
)
This commit is contained in:
parent
1873ffa9a4
commit
cd2c07d3a5
|
@ -20,6 +20,7 @@ import org.hibernate.hql.internal.NameGenerator;
|
|||
import org.hibernate.hql.internal.antlr.HqlSqlTokenTypes;
|
||||
import org.hibernate.internal.CoreLogging;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
import org.hibernate.internal.log.DeprecationLogger;
|
||||
import org.hibernate.internal.util.collections.ArrayHelper;
|
||||
import org.hibernate.param.ParameterSpecification;
|
||||
import org.hibernate.persister.collection.CollectionPropertyMapping;
|
||||
|
@ -385,6 +386,7 @@ class FromElementType {
|
|||
// this is hacky, but really this is difficult to handle given the current codebase.
|
||||
if ( persister != propertyMapping ) {
|
||||
// we want the subquery...
|
||||
DeprecationLogger.DEPRECATION_LOGGER.logDeprecationOfCollectionPropertiesInHql( path, fromElement.getClassAlias() );
|
||||
return getCollectionPropertyReference( path ).toColumns( tableAlias );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -177,4 +177,12 @@ public interface DeprecationLogger {
|
|||
"See Hibernate Domain Model Mapping Guide for details."
|
||||
)
|
||||
void deprecatedTableGenerator(String generatorImpl);
|
||||
|
||||
@LogMessage(level = WARN)
|
||||
@Message(
|
||||
id = 90000016,
|
||||
value = "Found use of deprecated 'collection property' syntax in HQL/JPQL query [%2$s.%1$s]; " +
|
||||
"use collection function syntax instead [%1$s(%2$s)]."
|
||||
)
|
||||
void logDeprecationOfCollectionPropertiesInHql(String collectionPropertyName, String alias);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue