From user-cs-return-2312-apmail-ibatis-user-cs-archive=ibatis.apache.org@ibatis.apache.org Thu Apr 26 14:37:44 2007 Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 54038 invoked from network); 26 Apr 2007 14:37:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2007 14:37:43 -0000 Received: (qmail 82450 invoked by uid 500); 26 Apr 2007 14:37:50 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 82430 invoked by uid 500); 26 Apr 2007 14:37:49 -0000 Mailing-List: contact user-cs-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-cs@ibatis.apache.org Delivered-To: mailing list user-cs@ibatis.apache.org Received: (qmail 82410 invoked by uid 99); 26 Apr 2007 14:37:49 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 07:37:49 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [200.167.168.130] (HELO aridesa.com.br) (200.167.168.130) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 07:37:42 -0700 BrmaOutput: afortaleza [10.1.0.174] Received: from andersonfor (afortaleza [10.1.0.174]) by aridesa.com.br (8.12.11.20060308/8.12.11) with SMTP id l3QEg29V005417 for ; Thu, 26 Apr 2007 11:42:02 -0300 Message-ID: <003601c78810$55e42da0$ae00010a@aridesa.com.br> From: "Anderson Fortaleza" To: Subject: Result lazyloaded but whole tree being selected Date: Thu, 26 Apr 2007 11:36:54 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0033_01C787F7.308FC9B0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------=_NextPart_000_0033_01C787F7.308FC9B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have the following ResultMap: And the following statement: I call the select statement in my code: IList SerieEmpresa =3D = Mapper.Instance().QueryForList("qrySeriePorEmpresaID", = ddlSede.SelectedItem.Value); ddlSerie.DataSource =3D SerieEmpresa; ddlSerie.DataBind(); I'm checking the queries requested in my SQL Server with Profiler and = the select "qryCursoPorID" lazyloaded on the result is executed (N + 1 = problem is taking place), despite the lazyload attribute. I don't use = any Curso property or anything, actually checking the SerieEmpresa = object right after the filling of that object brings me the whole object = tree. Lazyloaded is being completly ignored. I'm using DataMapper 1.5.1. Am I = doing something wrong or fogetting something ? thank you Anderson Fortaleza ------=_NextPart_000_0033_01C787F7.308FC9B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi, I have the following = ResultMap:
 
    <resultMap = id=3D"rmSerie"=20 class=3D"Serie">
      <result=20 property=3D"SerieID" = column=3D"SerieID"/>
     =20 <result property=3D"Descricao"=20 column=3D"Descricao"/>
      <result=20 property=3D"Abreviacao" = column=3D"Abreviacao"/>
     =20 <result property=3D"Sigla"=20 column=3D"Sigla"/>
      <result=20 property=3D"Curso" column=3D"CursoID" select=3D"qryCursoPorID"=20 lazyLoad=3D"true"/>
      <result=20 property=3D"TurnoIntegral" = column=3D"TurnoIntegral"/>
   =20 </resultMap>
And the following = statement:
 
    <select=20 id=3D"qrySeriePorEmpresaID" resultMap=3D"rmSerie"=20 parameterClass=3D"int">
     =20 <![CDATA[
        SELECT = DISTINCT=20 Serie.SerieID, Serie.Descricao, Serie.Abreviacao, Serie.Sigla, = Serie.CursoID,=20 Serie.TurnoIntegral
        FROM = V_Serie=20 Serie
         JOIN V_Curso = Curso ON=20 (Serie.CursoID =3D=20 Curso.CursoID)
         JOIN=20 V_Empresa Empresa ON (Curso.EmpresaID =3D=20 Empresa.EmpresaID)
         = JOIN=20 V_Turma Turma ON (Turma.SerieID =3D=20 Serie.SerieID)
         JOIN=20 V_PeriodoLetivo PeriodoLetivo ON (Turma.PeriodoLetivoID =3D=20 PeriodoLetivo.PeriodoLetivoID)
      &nb= sp;=20 WHERE Empresa.EmpresaID =3D=20 #EmpresaID#
          = AND=20 Curso.TipoCurso =3D = 'N'
         =20 AND Ano =3D=20 YEAR(GETDATE())
         = AND=20 TurnoIntegral =3D 0
        ORDER = BY=20 Serie.Sigla
      ]]> =20
    </select>
 
I call the select statement in my=20 code:
 
IList<Serie> SerieEmpresa =3D=20 Mapper.Instance().QueryForList<Serie>("qrySeriePorEmpresaID",=20 ddlSede.SelectedItem.Value);
ddlSerie.DataSource =3D=20 SerieEmpresa;
ddlSerie.DataBind();
I'm checking the queries requested in = my SQL Server=20 with Profiler and the select "qryCursoPorID" lazyloaded on the result is = executed (N + 1 problem is taking place), despite the lazyload = attribute. I=20 don't use any Curso property or anything, actually checking the = SerieEmpresa=20 object right after the filling of that object brings me the whole object = tree.
 
Lazyloaded is being completly ignored. = I'm using=20 DataMapper 1.5.1. Am I doing something wrong or fogetting something=20 ?
 
thank you
Anderson = Fortaleza
------=_NextPart_000_0033_01C787F7.308FC9B0--