Skip to content

Commit

Permalink
Merge pull request #875 from geoand/panache-field-access-microopt
Browse files Browse the repository at this point in the history
Don't use of Panache Field Enhancer when there are no enhanced models
  • Loading branch information
gsmet authored Feb 13, 2019
2 parents c0bf3da + 4fd9338 commit 217279f
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ void build(CombinedIndexBuildItem index,
for (String modelClass : modelClasses) {
transformers.produce(new BytecodeTransformerBuildItem(modelClass, modelEnhancer));
}

PanacheFieldAccessEnhancer panacheFieldAccessEnhancer = new PanacheFieldAccessEnhancer(modelEnhancer.entities);
for (ClassInfo classInfo : applicationIndex.getIndex().getKnownClasses()) {
String className = classInfo.name().toString();
if(!modelClasses.contains(className)) {
transformers.produce(new BytecodeTransformerBuildItem(className, panacheFieldAccessEnhancer));

if (!modelEnhancer.entities.isEmpty()) {
PanacheFieldAccessEnhancer panacheFieldAccessEnhancer = new PanacheFieldAccessEnhancer(modelEnhancer.entities);
for (ClassInfo classInfo : applicationIndex.getIndex().getKnownClasses()) {
String className = classInfo.name().toString();
if(!modelClasses.contains(className)) {
transformers.produce(new BytecodeTransformerBuildItem(className, panacheFieldAccessEnhancer));
}
}
}
}
Expand Down

0 comments on commit 217279f

Please sign in to comment.