How to create and use a PanacheEntity class in Quarkus Extension? #47672
-
Hello, I am writing an extension that contains a custom @BuildStep
AdditionalIndexedClassesBuildItem test(){
return new AdditionalIndexedClassesBuildItem(
FooEntity.class.getName(), BarEntity.class.getName()
);
} Then, both entities' static methods get properly enhanced, and getters/setters added (can be examined via debugger), but, whenever my runtime module tries to modify the said entities, for example: var foo = FooEntity.findById(1L);
foo.someMember = "changed"; // breakpoint here
foo.persistAndFlush(); Nothing happens. From further investigation, it turns out that So, what else should I do, so that I can properly use Panache in the Quarkus Extension code? P.S. Registering the entities via |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
/cc @FroMage (panache), @loicmathieu (panache) |
Beta Was this translation helpful? Give feedback.
-
Your extension runtime should be indexed. See https://stackoverflow.com/a/55513723/56994 for how to make sure your runtime is indexed. Once it's indexed, your classes which use the entities via field access will be found and enhanced by Let me know if that helps? |
Beta Was this translation helpful? Give feedback.
Your extension runtime should be indexed. See https://stackoverflow.com/a/55513723/56994 for how to make sure your runtime is indexed.
Once it's indexed, your classes which use the entities via field access will be found and enhanced by
PanacheHibernateCommonResourceProcessor.replaceFieldAccesses()
.Let me know if that helps?