>No, there are no SELECT-clause aliases in HQL (you don't need them, actually).
For the following query:
select distinct ticket.userSessionId, device, count(device)
from Ticket as ticket, Device as device
where ticket.state.name = 'Hit'
and ticket.deliveryPhone = device
order by count(device) desc
the generated sql does not use the aliases:
select distinct device1_.DEVICE_ID as DEVICE_ID, device1_.NAME as NAME, device1_.WAP_UA as WAP_UA, device1_.ICON_URL as ICON_URL, device1_.MAX_FILE_SIZE as MAX_FILE5_, device1_.DELIVERY_TYPE_ID as DELIVERY6_, device1_.NOTIFICATION_TYPE_ID as NOTIFICA7_, device1_.SCREEN_WIDTH as SCREEN_W8_, device1_.SCREEN_HEIGHT as SCREEN_H9_, device1_.COLOR_DEPTH as COLOR_D10_, device1_.IMAGE_TYPE_ID as IMAGE_T11_, device1_.MAX_IMAGE_WIDTH as MAX_IMA12_, device1_.MAX_IMAGE_HEIGHT as MAX_IMA13_, device1_.NB_MIDI_CHANNELS as NB_MIDI14_, device1_.MAX_MIDI_SIZE as MAX_MID15_, device1_.MAX_IMAGE_SIZE as MAX_IMA16_, mstticket0_.USER_SESSION_ID as x0_0_, device1_.DEVICE_ID as x1_0_, count(device1_.DEVICE_ID) as x2_0_ from MST_TICKET mstticket0_, DEVICE device1_, REF_DATA_ITEM refdataite2_ where (refdataite2_.NAME='DeliveryFirstHit' and mstticket0_.STATE_ID=refdataite2_.REF_DATA_ITEM_ID)and(mstticket0_.DELIVERY_DEVICE_ID=device1_.DEVICE_ID ) order by count(device1_.DEVICE_ID)desc
And this query does not work whereas using aliases for the select clause would work...
Mayby there is an other way to do...
|