Shortcut for

Bug #633128 reported by Samppa Saarela on 2010-09-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Timo Westkämper

Bug Description

Instead of

PNumber<Long> countAlias = new PNumber<Long>(Long.class, "rowCount");
// ...use countAlias in e.g. having clause...

Something like this:

ENumber<Long> count = entity.column.count().as("count");
// ...use count in e.g. having clause...

In this latter form "count" would be serialized in full form in select and from clauses and through the alias in other query parts.

Changed in querydsl:
importance: Undecided → Medium
Changed in querydsl:
assignee: nobody → Timo Westkämper (timo-westkamper)
status: New → In Progress

Added shortcut into ESimple and subclasses. Usage examples :

    public void path_alias(){
        expectedQuery = "select e.LASTNAME, sum(e.SALARY) as salarySum from EMPLOYEE2 e group by e.LASTNAME having salarySum > ?";

        ENumber<BigDecimal> salarySum = employee.salary.sum().as("salarySum");
        .list(employee.lastname, salarySum);

The alias is serialized in full form in select and from parts and in short form everywhere else

Changed in querydsl:
status: In Progress → Fix Committed

Released in 1.9.6

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