Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,26 @@ public boolean isMetamodelManagedType(Class<?> type) {
*/
@Nullable
private Metamodel getMetamodelFor(Class<?> type) {

for (Metamodel model : metamodels) {

try {
Metamodel currentModel = null;
try {
for (Metamodel model : metamodels) {
currentModel = model;
model.managedType(type);
return model;
} catch (IllegalArgumentException o_O) {

// Fall back to inspect *all* managed types manually as Metamodel.managedType(…) only
// returns for entities, embeddables and managed superclasses.

for (ManagedType<?> managedType : model.getManagedTypes()) {
}
} catch (IllegalArgumentException o_O) {

// Fall back to inspect *all* managed types manually as Metamodel.managedType(…) only
// returns for entities, embeddables and managed superclasses.

if (currentModel != null) {
for (ManagedType<?> managedType : currentModel.getManagedTypes()) {
if (type.equals(managedType.getJavaType())) {
return model;
return currentModel;
}
}
}
}

return null;
}
}
Expand Down