tags:

views:

394

answers:

1

Is it possible to run a query similar to this one in HQL without having to specify all of the column names.

select med, MAX(med.PrescriptionLines.Prescription.PrescriptionDate)
    from Medication med
    where med.Patient.PatientId = :patientId
    group by med

This query expands out all of the properties of the Medication object in the select, but in the group by only expands med to be med.MedicationId. I don't want to have to specify all of the properties of the medication object in the group by clause. Is there a way to do it?

I've tried replacing the group by med with group by med.* or group by {med.*} but that doesn't work.

Any ideas?

A: 

It's not implemented. See:

Mauricio Scheffer
The first link you send suggests that this was resolved in 1.2.0. this is clearly not the case, as I'm using 2.0.1.
Deeksy
Nope, take a good look, it says the *docs* were fixed to reflect the reality that it's *not* supported
Mauricio Scheffer
As much as I hate it, it's the right answer. Seems amazing that they haven't implemented it yet, or made it possible to do it (ie. \{med.\*\}). Thanks.
Deeksy