Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 59237 invoked from network); 3 Nov 2005 21:16:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Nov 2005 21:16:37 -0000 Received: (qmail 31811 invoked by uid 500); 3 Nov 2005 21:16:33 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 31692 invoked by uid 500); 3 Nov 2005 21:16:31 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 31678 invoked by uid 99); 3 Nov 2005 21:16:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Nov 2005 13:16:30 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [216.27.20.73] (HELO exchange01.reged.com) (216.27.20.73) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Nov 2005 13:16:23 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C5E0BB.CDD87624" Subject: Sub-List in Result Map Problem. Date: Thu, 3 Nov 2005 16:16:05 -0500 Message-ID: <2FB8D8645C82124AB549A2641FC2E3D404FE0FDE@exchange01.reged.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Sub-List in Result Map Problem. Thread-Index: AcXgu81UeszuLEz0SmaUpWTnm0LDfQ== From: "Bret Gregory" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C5E0BB.CDD87624 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am having a problem with nested resultmaps and the sub-lists. I have 2 Result Maps. One contains a collection Of the second map. The second map maps a complex property. When I execute the query and the are no properties that are Related, I still get a property in the properties collection. The property is not persisted and is all default or NULL values.=20 I want the properties property of CronJobDefinition to be empty if not matches are found in the database. Is this possible in iBatis? Below are my result map definitions: =09 =09 ------_=_NextPart_001_01C5E0BB.CDD87624 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sub-List in Result Map Problem.

I am = having a problem with nested resultmaps and the sub-lists.  I have = 2 Result Maps.  One contains a collection

Of = the second map.  The second map maps a complex property.  When = I execute the query and the are no properties that are

Related, I still get a property in the properties = collection.  The property is not persisted and is all default or = NULL values.

I = want the properties property of CronJobDefinition to be empty if not = matches are found in the database.  Is this possible in = iBatis?

Below = are my result map definitions:

<resultMap id=3D"CronJobDefinition" class=3D"com.reged.model.cron.CronJobDefinition" groupBy=3D"cronJobId">

     =    <result = property=3D"cronJobId" column=3D"cronJobId" javaType=3D"int" jdbcType=3D"NUMERIC" nullValue=3D"-1"/>

     =    <result = property=3D"className" column=3D"jobClass" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

     =    <result = property=3D"frequency.frequencyId" column=3D"frequencyId" javaType=3D"int" jdbcType=3D"NUMERIC" nullValue=3D"-1"/>

     =    <result = property=3D"frequency.type" column=3D"frequencyType" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

     =    <result = property=3D"frequency.description" column=3D"frequencyDescription" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

     =    <result = property=3D"description" column=3D"jobDescription" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

     =    <result = property=3D"active" = column=3D"Active" = javaType=3D"boolean" = jdbcType=3D"BIT" = nullValue=3D"false"/>

     =    <result = property=3D"companyId" column=3D"CompanyId" javaType=3D"int" jdbcType=3D"NUMERIC" nullValue=3D"-1"/>

<result property=3D"properties" resultMap=3D"CronJob.CronJobPropertyDefinition"/>     =      

</resultMap>

<resultMap id=3D"CronJobPropertyDefinition" class=3D"com.reged.model.cron.CronJobPropertyDefinition">

    =     <result = property=3D"cronJobPropertyId" column=3D"cronJobPropertyId" javaType=3D"int" jdbcType=3D"NUMERIC" nullValue=3D"-1"/>

     =    <result = property=3D"className" column=3D"propertyClass" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

        <result property=3D"key" column=3D"key" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

        <result property=3D"value" column=3D"Value" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>   =     

<result property=3D"description" column=3D"propertyDescription" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

        <result property=3D"type.cronJobPropertyTypeId" column=3D"typeId" javaType=3D"int" jdbcType=3D"NUMERIC" nullValue=3D"-1"/>

        <result property=3D"type.type" column=3D"type" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

        <result property=3D"type.description" column=3D"typeDescription" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

        <result property=3D"type.className"  column=3D"propertyClass" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

        <result property=3D"type.keyLabel" column=3D"keyLabel" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

        <result property=3D"type.isAttribute" column=3D"attribute" javaType=3D"boolean" jdbcType=3D"BIT" nullValue=3D"false"/>

        <result property=3D"type.valueLabel" column=3D"valueLabel" javaType=3D"java.lang.String" jdbcType=3D"VARCHAR"/>

</resultMap>

------_=_NextPart_001_01C5E0BB.CDD87624--