ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oci <zarbi...@hotmail.com>
Subject Re: Problem with Complex Property
Date Mon, 30 Apr 2007 11:48:38 GMT

In fact, idProfil refers to the field id in the table profil :

table "utilisateur":
id
login
password
...
idProfil

table "profilutilisateur" :
id
profil
droits

idProfil refers to profilutilisateur.id

I have tried what your solution and it works with this request :

<select id="Utilisateur.getAllProfils" resultMap="ProfilUtilisateur.map"
parameterClass="Utilisateur.classe"> 
		SELECT DISTINCT(idProfil), p.id, profil, droits
		FROM utilisateur u INNER JOIN profilutilisateur p ON idProfil=p.id 
		<dynamic prepend="WHERE">	
		     <isNotEmpty prepend="AND" property="idEan">		
		           idEan=#idEan.id#		
		     </isNotEmpty>
		     <isNotEmpty prepend="AND" property="dateCreation">		
		           DATE_FORMAT(dateCreation,'%Y')=DATE_FORMAT(#dateCreation#,'%Y')		
		     </isNotEmpty>
      	</dynamic>
	</select>

Thanks for your answer.
-- 
View this message in context: http://www.nabble.com/Problem-with-Complex-Property-tf3668669.html#a10252194
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message