Skip to content

Commit 308ab45

Browse files
committed
squash! HHH-18863 change the way enum types -> values are cached to avoid lookups
1 parent cad0aec commit 308ab45

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -521,25 +521,4 @@ public void addEnumValue(
521521
private void addEnumValue(String qualifiedTypeName, String value) {
522522
enumTypesByValue.computeIfAbsent( value, s -> new TreeSet<>() ).add( qualifiedTypeName );
523523
}
524-
525-
public @Nullable TypeElement entityType(String entityName) {
526-
final Elements elementUtils = getElementUtils();
527-
final String qualifiedName = qualifiedNameForEntityName(entityName);
528-
if ( qualifiedName != null ) {
529-
return elementUtils.getTypeElement(qualifiedName);
530-
}
531-
TypeElement symbol =
532-
findEntityByUnqualifiedName( entityName,
533-
elementUtils.getModuleElement("") );
534-
if ( symbol != null ) {
535-
return symbol;
536-
}
537-
for ( ModuleElement module : elementUtils.getAllModuleElements() ) {
538-
symbol = findEntityByUnqualifiedName( entityName, module );
539-
if ( symbol != null ) {
540-
return symbol;
541-
}
542-
}
543-
return null;
544-
}
545524
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private static JdbcType enumJdbcType(Element member) {
219219

220220
@Override @Nullable
221221
Set<String> getEnumTypesForValue(String value) {
222-
Set<String> result = allowedEnumLiteralsToEnumTypeNames.get(value);
222+
Set<String> result = enumTypesByValue.get(value);
223223
if ( result != null ) {
224224
return result;
225225
}

0 commit comments

Comments
 (0)