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

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jul 11, 2012

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@wrungel

wrungel 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

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jul 12, 2012

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jul 17, 2012

Member

Released in 2.7.1

Member

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