Hi,
I Have created a Layout like below in one of my jsp
prjectPidCostCentres Pojo is dependented in projectRegionInfo
Here at first the data related to projectRegionInfo is coming from actionclass (runs query and stores the data into request.object)
<layout:select key="head.projectName" property="proId">
<layout:option value=""/>
<layout:options collection="projectRegionInfo" property="proId" labelProperty="regionCode" sourceOf="ccId"/>
</layout:select>
<layout:select key="head.costCentre" property="ccId">
<layout:optionsDependent collection="projectPidCostCentres" property="ccId" dependsFrom="proId" labelProperty="costCentreCode"/>
</layout:select>
My doubt is when the page is loading the records related to projectRegionInfo is laoding quickly in respective combo boxes but when it is try to bring the projectPidCostCentres data(having costcentres for a perticular proId) there are lot’s of HQL queries are running for each proId.
Note:V_PROJECT,V_PROJECT_COST_CENTRE are Views
E.g:
Hibernate: select projectpid0_.PRO_PRO_ID as PRO3___, projectpid0_.CC_CC_ID as CC1___, projectpid0_.CC_CC_ID as CC1_0_, projectpid0_.COST_CENTRE_CODE as COST2_38_0_, projectpid0_.PRO_PRO_ID as PRO3_38_0_ from V_PROJECT_COSTCENTRE projectpid0_ where projectpid0_.PRO_PRO_ID=?
Hibernate: select projectpid0_.PRO_PRO_ID as PRO3___, projectpid0_.CC_CC_ID as CC1___, projectpid0_.CC_CC_ID as CC1_0_, projectpid0_.COST_CENTRE_CODE as COST2_38_0_, projectpid0_.PRO_PRO_ID as PRO3_38_0_ from V_PROJECT_COSTCENTRE projectpid0_ where projectpid0_.PRO_PRO_ID=?
:
:
:
Etc 498 Lines nearly
How can I reduce this repeated query when the page is loading(without refreshing) Please suggest me any logic on this soon. It is a performance issue(I can’t use Ajax)
Regards
Srini
_________________ Cnu
|