ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prospa <mpros...@yahoo.com>
Subject Re: Error with dynamic sql and hastable
Date Thu, 13 Jul 2006 14:32:59 GMT

<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="CdeaemettreMap"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMap.xsd">

  <alias>
	<typeAlias alias="CdeAEmettre" assembly="GJCommon.dll"
type="GJCommon.vo.CdeAEmettreVO" />
</alias>
  
<resultMaps>
<resultMap id="CdeaemettreResult" class="CdeAEmettre">
    <result property="NumEmettre" column="NUM_EMETTRE" type="int"
dbType="Int"/>
    <result property="CodePortefeuille" column="CODE_PORTEFEUILLE"/>
    <result property="CodeRayon" column="CODE_RAYON"/>
    <result property="GcdFabricant" column="GCD_FABRICANT"/>
    <result property="NomFournisseur" column="NOM_FOURNISSEUR"/>
    <result property="QteAcommander" column="QTE_ACOMMANDER"/>
    <result property="RemBase" column="REM_BASE"/>
    <result property="RemException" column="REM_EXCEPTION"/>
    <result property="PrixAchatHt" column="PRIX_ACHAT_HT"/>
    <result property="NomOperation" column="NOM_OPERATION"/>
    <result property="StatutCde" column="STATUT_CDE"/>
  </resultMap>
</parameterMaps>

<statements>
 <select id="FindCdeAEmettre" parameterClass="Hashtable"
resultClass="CdeAEmettre">
    SELECT     CDEAEMETTRE.NUM_EMETTRE, CDEAEMETTRE.CODE_PORTEFEUILLE,
CDEAEMETTRE.CODE_RAYON,
    CDEAEMETTRE.GCD_FABRICANT, CDEAEMETTRE.NOM_FOURNISSEUR,
CDEAEMETTRE.QTE_ACOMMANDER,
    CDEAEMETTRE.REM_BASE, CDEAEMETTRE.REM_EXCEPTION,
CDEAEMETTRE.PRIX_ACHAT_HT, CDEAEMETTRE.NOM_OPERATION,
    CDEAEMETTRE.STATUT_CDE, STOCK.STOCK_RAYON, PRODUIT.LIB_PRODUIT,
PRODUIT.NOM_AUTEUR,
    PRODUIT.NOM_EDITEUR, PRODUIT.NOM_COLLECTION,
FOURNISSEUR.TYPE_TRANSMISSION,
    PRODUIT.GJ_CODEDISPONIBILITE
    FROM         STOCK INNER JOIN
    PRODUIT ON STOCK.GCD_FABRICANT = PRODUIT.GCD_FABRICANT INNER JOIN
    CDEAEMETTRE ON STOCK.CODE_RAYON = CDEAEMETTRE.CODE_RAYON AND
    STOCK.GCD_FABRICANT = CDEAEMETTRE.GCD_FABRICANT INNER JOIN
    FOURNISSEUR ON CDEAEMETTRE.NOM_FOURNISSEUR = FOURNISSEUR.NOM_FOURNISSEUR
    <dynamic prepend="where">
      <isParameterPresent>
        <isNotEmpty prepend="and" property="nomFournisseur" >
          CDEAEMETTRE.NOM_FOURNISSEUR = #nomFournisseur#
        </isNotEmpty>
        <isNotEmpty prepend="and" property="codePorteFeuille" >
          CDEAEMETTRE.CODE_PORTEFEUILLE = #codePorteFeuille#
        </isNotEmpty>
        <isNotEmpty prepend="and" property="nomOperation"  >
          CDEAEMETTRE.NOM_OPERATION = #nomOperation#
        </isNotEmpty>
        
        <isNotEmpty prepend="and" property="listeRayon"  >
          CDEAEMETTRE.CODE_RAYON IN
          <iterate open="(" close=")" conjunction=",">
            #listeRayon[]#
          </iterate>
        </isNotEmpty>
        <isNotEmpty prepend="and" property="Num" >
          CDEAEMETTRE.NUM_EMETTRE = #Num#
        </isNotEmpty>
      </isParameterPresent>
    </dynamic>

  </select >
</statements>
</sqlMap>

Thanks
-- 
View this message in context: http://www.nabble.com/Error-with-dynamic-sql-and-hastable-tf1936564.html#a5309399
Sent from the iBATIS - User - Cs forum at Nabble.com.


Mime
View raw message