HHH-12617 - Improved cache warning on non-root entity configurations.
This commit is contained in:
parent
898f900a87
commit
ae890b4623
|
@ -622,7 +622,11 @@ public class EntityBinder {
|
|||
}
|
||||
else {
|
||||
if ( explicitCacheAnn != null ) {
|
||||
LOG.cacheOrCacheableAnnotationOnNonRoot( persistentClass.getClassName() );
|
||||
LOG.cacheOrCacheableAnnotationOnNonRoot(
|
||||
persistentClass.getClassName() == null
|
||||
? annotatedClass.getName()
|
||||
: persistentClass.getClassName()
|
||||
);
|
||||
}
|
||||
else if ( explicitCacheableAnn == null && persistentClass.getSuperclass() != null ) {
|
||||
// we should inherit our super's caching config
|
||||
|
|
|
@ -1770,7 +1770,8 @@ public interface CoreMessageLogger extends BasicLogger {
|
|||
void unknownJavaTypeNoEqualsHashCode(Class javaType);
|
||||
|
||||
@LogMessage(level = WARN)
|
||||
@Message(value = "@org.hibernate.annotations.Cache used on a non-root entity: ignored for %s", id = 482)
|
||||
@Message(value = "@org.hibernate.annotations.Cache used on a non-root entity: ignored for [%s]. Please " +
|
||||
"see the Hibernate documentation for proper usage.", id = 482)
|
||||
void cacheOrCacheableAnnotationOnNonRoot(String className);
|
||||
|
||||
@LogMessage(level = WARN)
|
||||
|
|
Loading…
Reference in New Issue