Skip to content
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

Compile error in generated query class for an Entity which uses Inheritance in multi-module Maven project #196

Closed
wrungel opened this issue Jul 11, 2012 · 4 comments

Comments

@wrungel
Copy link

@wrungel wrungel commented Jul 11, 2012

The error occurs in the following situation:

3 Entities are spread over two Maven projects: ProjectA and ProjectB.

Maven ProjectA contains two entities: Entity A and Entity Tenant.
A extends an abstract base class and references Tenant.

Maven ProjectB contans Entity B which extends from A.

The Query class for Entity B is generated with compile error.

The following example project demostrates the error:
https://github.com/wrungel/qdsl-bug

[ERROR] D:\tmp\q-bug\example-b\target\generated-sources\apt\b\QBImpl.java:[23,35] cannot find symbol
symbol : constructor QAImpl(b.QBImpl)
location: class a.QAImpl

No error occurs if Entity B is moved to the project A.

@timowest
Copy link
Member

@timowest timowest commented Jul 11, 2012

You can use the QueryEntities annotation in a package of project A to trigger processing of external classes like this

@QueryEntities({A.class, Tenant.class})
package com.mysema.query.domain;

import com.mysema.query.annotations.*;

It is not possible to make this reliably in APT without declaring which external classes to process.

@timowest timowest closed this Jul 11, 2012
@wrungel
Copy link
Author

@wrungel wrungel commented Jul 12, 2012

I added package-info.java with @QueryEntities annotation to project A: no changes.
Then I added package-info.java with @QueryEntities annotation to project B: also no changes, the same error occurs.
See
wrungel/qdsl-bug@8888adf

@timowest
Copy link
Member

@timowest timowest commented Jul 12, 2012

QueryEntities was not used in JPAAnnotationProcessor and for external entities the constructor invocation was also incorrect. Both have been fixed now. Your example project works with the version from master.

@timowest
Copy link
Member

@timowest timowest commented Jul 17, 2012

Released in 2.7.1

@timowest timowest closed this Jul 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants