0
我有以下複雜的查詢,它是視圖,我們想消除視圖並直接映射到表,我們使用Hibernate2。是否有可能將多個表映射到Hibernate2中的一個類?這是我的查詢。Hibernate2映射單個類到多個表
SELECT DISTINCT
r.id,
rtype.name AS model_object_type_name,
rtype.id AS model_object_type_id,
c.id AS case_id,
r.source_item_id AS person_id,
c.file_number,
c.start_date,
a.app_start_date AS app_date,
a.app_start_time,
a.outcome_type AS app_outcome,
c.primary_reference_id,
aval.string_value AS last_mncis_refresh
FROM my.case_file AS c INNER JOIN
my.relation AS r ON c.id = r.target_item_id INNER JOIN
my.item_type AS rtype ON r.item_type_id = rtype.id INNER JOIN
my.person AS p ON p.id = r.source_item_id INNER JOIN
my.relation AS rc ON c.id = rc.target_item_id INNER JOIN
my.attr_value AS aval ON c.id = aval.item_id AND aval.name='test'
INNER JOIN my.item_type AS ptype ON p.item_type_id = ptype.id
WHERE (ptype.name = 'Test')
AND (rtype.name = 'Test1' OR rtype.name = 'Test2' OR rtype.name = 'Test3')
AND (rc.name = 'Test4')
謝謝。