Hi,
I have a stored procedure,which is proforming multiple joins on various tables and returinng me as result some fields from those joined tables.
The query goes as follows:
CREATE OR REPLACE FUNCTION pg_admin_user_list()
RETURNS refcursor AS
$BODY$
DECLARE
memberInfo refcursor;
BEGIN
OPEN memberInfo FOR
select m.member_id,m.username,m.first_name,m.last_name,
mr.member_role_desc,
t.team_desc,
tm.start_date,tm.end_date,
mf.pref_type,mf.pref_name,mf.pref_value,
ap.first_name As artistFName,ap.last_name As artistLName
from team_member tm,member_role mr,member m,member_pref mf,team t, artist_pool ap
where tm.member_id=m.member_id And tm.team_id=t.team_id And tm.member_role_id=mr.member_role_id
And mf.pref_name='artist_id'
and mf.pref_value = ap.artist_id;
RETURN memberInfo;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION pg_admin_user_list() OWNER TO postgres;
My question is as the result is returning selected fields from multiple tables how to relate it to the Hibernate DTO objects.
I am using Hibernate3.0.
Please help.It is very urgent.
Thanks.
|