Hi all,
let's say I'm performing a simple single column fetch. Example:

--------------------------------------------------
List<Object[]> customers = ObjectSelect
        .query( Customer.class )
        .columns( Customer.CPRNR )
        .select( oc );

System.out.println( "Customers: " + customers.size() );
--------------------------------------------------

This generates the following output:

--------------------------------------------------
- --- transaction started.
- SELECT "t0"."cprnr" FROM "nb_customer" "t0" 
- === returned 462653 rows. - took 210 ms.
- +++ transaction committed.
Customers: 169770
--------------------------------------------------

As you can see, the fetch returns 462.653 rows which is the number of customers 
in the DB, and the number I expected.
However, the resulting list only contains 169.770 objects—the number of 
distinct values of CPRNR.

Why? It's not a distinct fetch. I'm feeling particularly stupid today, and I'm 
definitely missing something here, I just don't understand what :).

Cheers,
- hugi

Reply via email to