findIds

If you're only interested in the Ids of a given model, you can use the findIds method on the query. The following code retrieves a list of Ids:

List<Long> ids =
  new QCustomer()
    .name.ilike("Rob%")
    .findIds();

The generated SQL only selects the id from the table (even if you use the select clause)

select t0.id from Customer t0 where lower(t0.name) like 'Rob%'