ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Rv: Rv: iterate syntax problem
Date Wed, 31 Oct 2007 20:50:46 GMT
iBATIS won't do what you want with the TO as is.  Actually, I think your TO
is a bit incorrect anyway because it appears from your query that epocas and
salas are linked somehow.  This will work:

public class EpocaSalaTO {
  private Integer epoca;
  private Integer sala;
  // getters, setters
}

public class EpocasTO {
  private Integer epoca;
  private List<EpocaSalaTO> epocaSalas;
  private int sala;
  private int actualizacion;
  private int tipoAct;
  private int procedencia;
  private int acuerdoEpoca;
  // getters, setters
}

<select id="porEpoca" resultMap="tesisTO" parameterClass="EpocasTO">
  select Parte, Consec, IUS, Rubro, Texto, Precedentes,Epoca,
            Sala, Fuente, Volumen, Tesis, Pagina, TA_TJ, Materia1,
            Materia2,Materia3,IdGenealogia,VolOrden, ConsecIndx,IdTCC,
InfAnexos,
            LocAbr, NumLetra,ConsecLetra, Instancia,ConsecInst
  from Tesis where
  <iterate open = "(" close = ")" conjunction="OR" property="epocaSalas">
    epoca =#epoca[]# AND sala = #sala[]#
  </iterate>
</select>


Jeff Butler


On 10/31/07, Carlos de Luna Saenz <cdelunasaenz@yahoo.com.mx> wrote:
>
> I am still getting the error no mater if i use the #epoca[]# or the
> #epocas[]# or the #epoca#
> public class EpocasTO {
> public Integer epoca;
> public List<Integer> epocas;
> private int sala;
> public List<Integer> salas;
> private int actualizacion;
> private int tipoAct;
> private int procedencia;
> private int acuerdoEpoca;
>
> Getters and setters are public fore each property.
>
> On tesisMap.xml:
> <select id="porEpoca" resultMap="tesisTO">
> select Parte, Consec, IUS, Rubro, Texto, Precedentes,Epoca,
> Sala, Fuente, Volumen, Tesis, Pagina, TA_TJ, Materia1,
> Materia2,Materia3,IdGenealogia,VolOrden, ConsecIndx,IdTCC, InfAnexos,
> LocAbr, NumLetra,ConsecLetra, Instancia,ConsecInst
> from Tesis where
> <iterate open = "(" close = ")" conjunction="OR">
> epoca =#epoca[]# AND sala = #sala[]#
> </iterate>
> </select>
>
>
>

Mime
View raw message