[JIRA] (HHH-16469) Hibernate repeatedly issues identical SELECT queries to load an optional one-to-one association
by Andrea Boriero (JIRA)
Andrea Boriero ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HHH-16469 ( https://hibernate.atlassian.net/browse/HHH-16469?atlOrigin=eyJpIjoiMTZlZG... )
Re: Hibernate repeatedly issues identical SELECT queries to load an optional one-to-one association ( https://hibernate.atlassian.net/browse/HHH-16469?atlOrigin=eyJpIjoiMTZlZG... )
Hi Puhong You ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) ,
I updated the test following your suggestions ( see https://github.com/dreab8/hibernate-test-case-templates/blob/HHH-16469/or... ) and Hibernate executes 4 queries
select
a1_0.AGENCY_ID,
a2_0.AGENCY_ID,
a2_0.AGENCY_DETAIL,
a1_0.AGENCY_TXT
from
AGENCY_TABLE a1_0
left join
AGENCY_DETAIL_TABLE a2_0
on a2_0.AGENCY_ID=a1_0.AGENCY_ID
where
a1_0.AGENCY_ID=?
select
u1_0.AGENCY_ID,
u1_0.USER_ID,
u1_0.USER_NAME
from
USER_TABLE u1_0
where
u1_0.AGENCY_ID=?
select
g1_0.AGENCY_ID,
g1_0.GROUP_ID,
g1_0.GROUP_NAME
from
GROUP_TABLE g1_0
where
g1_0.AGENCY_ID=?
select
u1_0.GROUP_ID,
u1_1.USER_ID,
a1_0.AGENCY_ID,
a2_0.AGENCY_ID,
a2_0.AGENCY_DETAIL,
a1_0.AGENCY_TXT,
u1_1.USER_NAME
from
GROUP_USER u1_0
join
USER_TABLE u1_1
on u1_1.USER_ID=u1_0.USER_ID
left join
AGENCY_TABLE a1_0
on a1_0.AGENCY_ID=u1_1.AGENCY_ID
left join
AGENCY_DETAIL_TABLE a2_0
on a2_0.AGENCY_ID=a1_0.AGENCY_ID
where
u1_0.GROUP_ID in(select
g1_0.GROUP_ID
from
GROUP_TABLE g1_0
where
g1_0.AGENCY_ID=?)
( https://hibernate.atlassian.net/browse/HHH-16469#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16469#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100222- sha1:57eb20e )
1 year, 6 months