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()

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

select from Customer t0 where lower( like 'Rob%'