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.

Reply via email to