Generated QClasses do not compile under certain circumstances

Bug #841795 reported by Torben Knerr on 2011-09-05
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

After upgrading from 2.2.0.beta5 to 2.2.0 or 2.2.1 we got a compilation error in the generated Query classes, e.g. similar to that one:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
C:\W\xxx\test-client\target\generated-sources\java\test\QSomeEntity.java:[42,22] cannot find symbol
symbol : constructor QSomeMappedSuperClassHavingMyEmbeddable(java.lang.Class<capture#849 of ? extends test.SomeEntity>,com.mysema.query.types.PathMetadata<capture#485 of ?>,com.mysema.query.types.path.PathInits)
location: class base.QSomeMappedSuperClassHavingMyEmbeddable

This one was really hard to create a test case for. The most minimal setup I could find to produce this bug involves 3 separate maven projects, an @Embeddable implementing Comparable and having at least one attribute, a @MappedSuperClass referencing the @Embeddable and another reference to the @Embeddable... weird, I know!

The attached example maven multimodule project should fail with a compilation error when you mvn clean install it.

Circumstances under which it compiles:
- remove the foo attribute from MyEmbeddable
- or: do not implement Comparable in MyEmbeddable
- or: make the SomeMappedSuperClassHavingMyEmbeddable and @Entity instead of a @MappedSuperClass
- or: remove the reference to MyEmbeddable in A
- or: move either SomeMappedSuperClassHavingMyEmbeddable or MyEmbeddable to the test-client maven project (most likely any other moves will do as well - I could only reproduce it with at least 3 maven projects)

Unfortunately, none of the above workarounds is a viable fix for us :-(

Torben Knerr (torben-knerr) wrote :
Torben Knerr (torben-knerr) wrote :

Environment:

C:\W\querydsl-does-not-compile-testcase>mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_24
Java home: C:\Program Files\Java\jdk1.6.0_24\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"

Changed in querydsl:
status: New → In Progress

I haven't yet found an easy fix for this, but this is still on my TODO list.

Fixed commited

Changed in querydsl:
status: In Progress → Fix Committed

Released in 2.2.3

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers