-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Query Bean Generator Generates Non-Compilable Code When Entity Uses @Embeddable Inner Class For Primary Key Type #3234
Comments
404 page not found for the link above. |
Need to see how this is different from https://github.com/ebean-orm/ebean/blob/master/ebean-querybean/src/test/java/org/example/domain/MyInner.java#L14-L35 |
Hi @rbygrave. My apologies. I created the repo in private mode and forgot to make it public after I posted the issue. Please try again now. I've taken a look at the inner class example you gave and the only difference I can see is that I have a single if field of the inner type which I annotated with Is the example the preferred way to model primary key in ebean? |
…y Uses @embeddable Inner Class For Primary Key Type
#3234 - Query Bean Generator Generates Non-Compilable Code When Entit…
Yeah cool. I have reproduced it and fixed it. Thanks !! |
I would not say that its not preferred but pretty close to 50/50 with no major advantages for either style as I see it. |
Thanks @rbygrave for the quick fix! |
Expected behavior
Generated query bean should compile when
@Entity
class uses@Embeddable
inner class for primary key.Actual behavior
When generating the query bean for entities that use
@Embeddable
inner class for primary keys (e.g.embedded.example.OrderItem
with embeddable primary key classembedded.example.OrderItem.Key
), it generates the following non-compilable code.Q<ENTITY_NAME>$<EMBEDDABLE_CLASS_NAME>
class is generated for the embeddable primary key class but this class is not referenced by any of the generated code (e.g.QOrderItem$Key.java
is generated under the package pathquery
for classKey
).query.Q<ENTITY_NAME>
class references a non-existentQ<EMBEDDABLE_CLASS_NAME>
class without an import clause possibly expecting it to be in the same package (e.g.query.QOrderItem
refers to the classQKey
)Steps to reproduce
ebean version:
13.22.1
Please refer to example project https://github.com/integrated-application-development/query-bean-generator-issue.
The text was updated successfully, but these errors were encountered: