-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Transformer error Groovy hibernate reactive panache entity cannot persist #111
Comments
The link https://docs.quarkiverse.io/quarkus-groovy/dev/index.html#_usage has an explanation that only the repository standard is supported. "All static methods in PanacheEntityBase (such as find, findAll, list, listAll, count…) that depend on bytecode injection have been removed due to a side effect of the static compilation that by-pass the generated methods. As workaround, the methods in the corresponding repository must be used." |
@fernando88to Thanks for your immediate response. I appreciate it the most. Here is with the repo I tried. Still the same exception
Http post with json body
|
@fernando88to Any approaches or suggestions? |
Thx for the ticket, I will try to find a long-term solution for this problem ASAP. As a workaround, I encourage you to enable the static compilation by adding Please note that the equivalent of the code of your class
|
I'm not a mutiny expert but I believe that the code should rather be more or less like this:
|
@essobedo Thanks for your response. I have tried both of your suggestions. Still I get the same error. If I make Book as a simple POJO it just works. This seems to be a reflection issue with Panache and this plugin way of handling it. Some reference - from Groovy transformations, but this seems to be fixed. Also, to see if this one can be replicated with JDK 11, I tried running this, but there were other compatibility issues. SO I dropped that idea. |
@dixie-tcpl did you add This code works on my side:
|
Regarding the problem itself, it is due to the dynamic type resolution when using the Groovy dynamic compiler with beans with a normal scope like This also means that as second workaround, you can change the scope of the My goal will be as long-term solution to manage this use case directly in the extension |
This is one works well. Thanks for this. I am kind of relived here. |
Totally understand this. This is a convenience for the framework.
I tried this with Singleton annotation earlier before I posted this issue. For some reason, with the code without @CompileStatic worked without any Groovy transformation errors, but the Entity (Book) did not persist.
Awesome. Let me know if you need any testing support from my side to validate this scenario when you implement this. |
Greetings. I have been trying to persist a simple entity but facing issues.
Quarkus version: 3.9.1
Exception at bookService.save(book)
Some research shows this was a groovy language transformer issue, but seemed to be fixed in prior versions of groovy.
The current groovy version on quarkus extension is 4.0.20.
Any guidance here is much appreciated.
The text was updated successfully, but these errors were encountered: