RE: Please help in resultmapping on ibatis

21 views
Skip to first unread message

Poitras Christian

unread,
Oct 18, 2012, 8:51:14 AM10/18/12
to mybati...@googlegroups.com

Hi,

 

What version of MyBatis/iBatis are you using? This seems like iBatis 2 code.

If it’s a new project, please use MyBatis 3 since we offer no more bug fix for iBatis 2.

 

Christian

 

De : mybati...@googlegroups.com [mailto:mybati...@googlegroups.com] De la part de Juanito Lansangan
Envoyé : October-17-12 10:02 PM
À : mybati...@googlegroups.com
Objet : Please help in resultmapping on ibatis

 

Please help in my error. any suggestions is much appreciated

There is no READABLE property named 'description' in class 'model.ProductUom'

 

 

Here is my sqlMap

<sqlMap namespace="ProductMaster">

 

    <resultMap id="Product" class="model.ProductMaster">

        <result property="description" column="description"/>        

    </resultMap>

    

    <resultMap id="Stock" class="model.ProductStock">

        <result property="stocks" column="stocks"/>

    </resultMap>

    

    <resultMap id="ProdUom" class="model.ProductUom">

        <result property="barCode" column="barCode"/>

        <result property="price" column="price"/>

        <result property="uom" resultMap="ProductMaster.Uom"/>

        <result property="prodMaster" resultMap="ProductMaster.Product"/>

        <result property="prodStock" resultMap="ProductMaster.Stock"/>

    </resultMap>

    

    <resultMap id="Uom" class="model.UomMaster">        

        <result property="uomName" column="uom"/>

    </resultMap>

    

    <select id="getSellingProducts" resultMap="ProductMaster.ProdUom">        

        SELECT

            a.PRODID        AS prodId,

            a.BARCODE       AS barCode,

            a.DESCRIPTION   AS description,            

            a.STOCKS        AS stocks,

            a.UOM           AS uom,

            a.SELLING_PRICE AS price

        FROM PRODUCT_DETAILS a               

        WHERE 

         a.BARCODE LIKE '%$barCode$%' OR

         a.DESCRIPTION LIKE '%$description$%'  OR

         a.UOM LIKE '%$uomName$%'

    </select>

</sqlMap>

 

 

sorry for my english.. :)

 

Jose María Zaragoza

unread,
Oct 18, 2012, 3:46:30 PM10/18/12
to mybati...@googlegroups.com
2012/10/18 Juanito Lansangan <juanito....@gmail.com>:
> Please help in my error. any suggestions is much appreciated
> There is no READABLE property named 'description' in class
> 'model.ProductUom'

Looks like your query returns a field that cannot be mapped into
ProdUom resultMap, because it doesn't exist
Reply all
Reply to author
Forward
0 new messages