HHH-18863 allow index creation to be disabled in processor

also cache enum results read from index
This commit is contained in:
Gavin King 2024-12-05 12:12:39 +01:00
parent 83110b4638
commit e4e1b59a1d
2 changed files with 5 additions and 4 deletions

View File

@ -291,7 +291,7 @@ public class HibernateProcessor extends AbstractProcessor {
context.setInclude( options.getOrDefault( INCLUDE, "*" ) ); context.setInclude( options.getOrDefault( INCLUDE, "*" ) );
context.setExclude( options.getOrDefault( EXCLUDE, "" ) ); context.setExclude( options.getOrDefault( EXCLUDE, "" ) );
context.setIndexing( parseBoolean( options.get( INDEX ) ) ); context.setIndexing( parseBoolean( options.getOrDefault( INDEX, "true" ) ) );
return parseBoolean( options.get( FULLY_ANNOTATION_CONFIGURED_OPTION ) ); return parseBoolean( options.get( FULLY_ANNOTATION_CONFIGURED_OPTION ) );
} }

View File

@ -134,7 +134,6 @@ public abstract class ProcessorSessionFactory extends MockSessionFactory {
} }
} }
@Override @Override
Type propertyType(String typeName, String propertyPath) { Type propertyType(String typeName, String propertyPath) {
final TypeElement type = findClassByQualifiedName(typeName); final TypeElement type = findClassByQualifiedName(typeName);
@ -226,8 +225,10 @@ public abstract class ProcessorSessionFactory extends MockSessionFactory {
} }
if ( indexing ) { if ( indexing ) {
final Set<String> indexed = getIndexedEnumTypesByValue(value); final Set<String> indexed = getIndexedEnumTypesByValue(value);
enumTypesByValue.put(value, indexed); if ( indexed != null ) {
return indexed; enumTypesByValue.put(value, indexed);
return indexed;
}
} }
//TODO: else do a full scan like in findEntityByUnqualifiedName() //TODO: else do a full scan like in findEntityByUnqualifiedName()
return null; return null;