APT: Using APT in eclipse with the defaultOverwrite=true causes extended classes to loose the extensions

Bug #666442 reported by Luis Fernando Planella Gonzalez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
High
Timo Westkämper

Bug Description

I'm using Querydsl 2.0.1 in Eclipse, with the one-jar on the APT classpath, and the option defaultOverwrite=true.
I also have some query extensions (using @QueryDelegate) for Date and DateTime classes.
Anytime I change an entity, the extensions are lost (even on unrelated entities).
Here is an example:
    public final DateTimePath<java.sql.Timestamp> processDate = createDateTime("processDate", java.sql.Timestamp.class);
Should be:
    public final ext.java.sql.QTimestamp processDate = new ext.java.sql.QTimestamp(forProperty("processDate"));

Changed in querydsl:
importance: Undecided → Medium
importance: Medium → High
Changed in querydsl:
assignee: nobody → Timo Westkämper (timo-westkamper)
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Getting to know sources of http://github.com/hibernate/hibernate-metamodelgen, to see how they manage source code generation

Changed in querydsl:
status: New → In Progress
Revision history for this message
Luis Fernando Planella Gonzalez (luisfpg) wrote :

Actually, the classes are updated when an entity is changed.
However, the raw paths (DateTimePaths, BooleanPaths and so) are used on Q-types, not the extended versions.
Maybe the @QueryDelegate annotations are not being taken into account...

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

I was able to replicate the problem. The problem is that in Eclipse the APT processor gets to see only the modified sources when modifications occur, so more incremental runs the extensions are skipped.

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Luis, I just commited a fix to SVN trunk. Could you verify that it works for you?

Revision history for this message
Luis Fernando Planella Gonzalez (luisfpg) wrote :

Yes, it works!
Thanks once again!

Changed in querydsl:
status: In Progress → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.0.3

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.