public void assertThatEntitiesAreBytecodeEnhanced() {
if (Boolean.parseBoolean(getHibernateConfiguration().getProperties()
.getProperty(AvailableSettings.USE_SECOND_LEVEL_CACHE, FALSE))) {
for (ClassMetadata clazz : getFactory().getAllClassMetadata().values()) {
try (Stream<Class<?>> s = Arrays.stream(clazz.getMappedClass().getInterfaces())) {
if (!s.anyMatch(c -> equalsAny(c, ManagedEntity.class, ManagedComposite.class))) {
throw new HibernateException(
"Bytecode enhancement was not performed properly in "
+ clazz.getEntityName() + "!\nThis is required because '" + AvailableSettings.USE_SECOND_LEVEL_CACHE
+ "' is true, but Blobs are not cacheable without bytecode enhancement.\nAvailable interfaces: "
+ JAFStringUtils.join(clazz.getMappedClass().getInterfaces(), ", "));
}
}
}
}
}