ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos de Luna Saenz <cdelunasa...@yahoo.com.mx>
Subject Re: Rv: Rv: iterate syntax problem
Date Mon, 05 Nov 2007 18:00:16 GMT
Thanks for the response, it worked the way you say... sorry for the delay but we were in "death's
day" vacations here in Mexico (you should come and see the celebration on those days)....
yo already won 5 "pancholares"... 
Greetings 
Carlos de Luna 


----- Mensaje original ---- 
De: Jeff Butler <jeffgbutler@gmail.com> 
Para: user-java@ibatis.apache.org 
Enviado: miércoles, 31 de octubre, 2007 14:50:46 
Asunto: Re: Rv: Rv: iterate syntax problem 


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> 









Comparte video en la ventana de tus mensajes (y también tus fotos de Flickr). 
Usa el nuevo Yahoo! Messenger versión Beta. 
Visita http://e1.beta.messenger.yahoo.com/


      Comparte video en la ventana de tus mensajes (y también tus fotos de Flickr). Usa el
nuevo Yahoo! Messenger versión Beta.
http://e1.beta.messenger.yahoo.com/


Mime
View raw message