Skip to content

Commit e4e1b59

Browse files
committed
HHH-18863 allow index creation to be disabled in processor
also cache enum results read from index
1 parent 83110b4 commit e4e1b59

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tooling/metamodel-generator/src/main/java/org/hibernate/processor/HibernateProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ && packagePresent(quarkusOrmPanachePackage) ) {
291291
context.setInclude( options.getOrDefault( INCLUDE, "*" ) );
292292
context.setExclude( options.getOrDefault( EXCLUDE, "" ) );
293293

294-
context.setIndexing( parseBoolean( options.get( INDEX ) ) );
294+
context.setIndexing( parseBoolean( options.getOrDefault( INDEX, "true" ) ) );
295295

296296
return parseBoolean( options.get( FULLY_ANNOTATION_CONFIGURED_OPTION ) );
297297
}

tooling/metamodel-generator/src/main/java/org/hibernate/processor/validation/ProcessorSessionFactory.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ else if (isElementCollectionProperty(property)) {
134134
}
135135
}
136136

137-
138137
@Override
139138
Type propertyType(String typeName, String propertyPath) {
140139
final TypeElement type = findClassByQualifiedName(typeName);
@@ -226,8 +225,10 @@ Set<String> getEnumTypesForValue(String value) {
226225
}
227226
if ( indexing ) {
228227
final Set<String> indexed = getIndexedEnumTypesByValue(value);
229-
enumTypesByValue.put(value, indexed);
230-
return indexed;
228+
if ( indexed != null ) {
229+
enumTypesByValue.put(value, indexed);
230+
return indexed;
231+
}
231232
}
232233
//TODO: else do a full scan like in findEntityByUnqualifiedName()
233234
return null;

0 commit comments

Comments
 (0)