Hello,
I'm confused by what hibernate (v3) is doing to one of my HQL queries when it processes it. The query is:
Code:
select
tm.townMeetingId,
tm.meetingTime,
tm.location1,
tm.location2,
tm.address1,
tm.address2,
tm.city,
tm.state,
tm.zip,
tm.county,
(select sum(att.numAttendees)
from TownMeetingAttendance as att where
att.townMeetingId=tm.townMeetingId)
from
TownMeeting as tm
Hibernate seems to ignore the sub-select (final column of the query). The SQL that hibernate is generating is this:
Code:
select
townmeetin0_.town_meeting_id as col_0_0_,
townmeetin0_.meeting_datetime as col_1_0_,
townmeetin0_.location_name1 as col_2_0_,
townmeetin0_.location_name2 as col_3_0_,
townmeetin0_.address1 as col_4_0_,
townmeetin0_.address2 as col_5_0_,
townmeetin0_.city as col_6_0_,
townmeetin0_.state as col_7_0_,
townmeetin0_.zip as col_8_0_,
townmeetin0_.county as col_9_0_
from
CCTS.TOWN_MEETING townmeetin0_
There are no errors generated by my HQL or any other indications that something might be wrong for that matter. It just quietly drops the final column of my query.
If relevant, I can post the mapping documents for TownMeeting and TownMeetingAttendance.
Can anyone please shed some light on this?