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

Bug #666442 reported by Luis Fernando Planella Gonzalez on 2010-10-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
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)

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

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...

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.

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

Yes, it works!
Thanks once again!

Changed in querydsl:
status: In Progress → Fix Committed

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  Edit
Everyone can see this information.

Other bug subscribers