SQL with complex collection properties not executing
----------------------------------------------------
Key: IBATIS-294
URL: http://issues.apache.org/jira/browse/IBATIS-294
Project: iBatis for Java
Type: Bug
Components: SQL Maps
Versions: 2.1.7
Environment: Windows XP, Java 1.4.2_09, AMD Athlon 2500+, 1GB ram, MS SQL
Server 2000
Reporter: Mark H. Land
As noted in the snippet below, all of the SQL statements to generate the beans
are being executed EXCEPT for the "noteList" property. No SQL is reaching the
server for this. The itemResult is being populated correctly in the
application except for the collection of notes (defined with proper getters and
setters in the ItemBean as private Collection noteList; ).
>From this result-map definition:
<result-map
name="itemWithDependentObjectsResult"
class="com.esm.model.expense.ItemBean"
extends="itemResult">
<!-- generated SQL statement below not executing! -->
<property
name="noteList"
column="{targetUid=uid, relType=itemType1}"
mapped-statement="EventLog.getEventLogListByTargetUid"
lazy-load="false" />
<!-- generated SQL statements below are executing -->
<property
name="department"
column="groupDepartmentUidFk"
mapped-statement="Item.getItemGroupByUid"
lazy-load="false" />
<property
name="division"
column="groupDivisionUidFk"
mapped-statement="Item.getItemGroupByUid"
lazy-load="false" />
<property
name="paymentMethod"
column="groupPaymentMethodUidFk"
mapped-statement="Item.getItemGroupByUid"
lazy-load="false" />
<property
name="vendorCompany"
column="companyVendorUidFk"
mapped-statement="Company.getCompanyByUid"
lazy-load="false" />
<property
name="clientCompany"
column="companyClientUidFk"
mapped-statement="Company.getCompanyByUid"
lazy-load="false" />
<property
name="category"
column="generalCategoryUidFk"
mapped-statement="Category.getCategoryByUid"
lazy-load="false" />
<property
name="project"
column="projectUidFk"
mapped-statement="Item.getItemProjectByUid"
lazy-load="false" />
</result-map>
The mapped-statement for noteList is:
<mapped-statement
name="getEventLogListByTargetUid"
result-map="eventLogResult">
select targetUid,
actorUid,
eventType,
relType,
eventDate,
notes,
createDate,
modifiedDate,
modifiedBy
from tblEventLog
where targetUid = #targetUid#
and relType = #relType#
order by eventDate
-- getEventLogListByTargetUid
</mapped-statement>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira