ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashok Madhavan" <ashok.madha...@gmail.com>
Subject Taking care of different databases
Date Sun, 06 May 2007 01:18:51 GMT
Hi all,

Our product can be deployed in different app servers and different
databases. Presently we have a existing inhouse DB library which takes care
of this. it takes care of inserts in different databases properly. it
basically checks for the type of database and gets the id of the just
inserted record accordingly.

I understand in iBatis i can do this but for a given type of database at a
given time. if i need to use the same xml for inserting records across
databases, how do i do it ? i can use Abator to generate xml but it assumes
i use only one type of database.

like for postgres
    <insert id="insertColorSize" parameterClass="com.xxx.ProductColorSize" >
        insert into tb_products_color_sizechart ( company_id, product_uid,
product_number, color_code_uid, size_chart_uid,
        image_url, carryover, sku, upc, description, top_seller )
        values
        ( #companyId:NUMERIC#, #productUID:NUMERIC#,
#productNumber:VARCHAR#, #colorCodeUID:NUMERIC#, #sizeChartUID:NUMERIC#,
#imageUrl:VARCHAR#,
        #carryOver:VARCHAR#, #sku:VARCHAR#, #upc:VARCHAR#,
#description:VARCHAR#, #topSeller:VARCHAR#  )
        <selectKey keyProperty="productColorSizeChartUID"
resultClass="long">
            select
currval('tb_products_color_sizechart_product_color_size_chart_uid_seq')
        </selectKey>
    </insert>

can ibatis automatically take care of this ?

any pointers, advice, suggestions would be welcome.

regards
Ashok

Mime
View raw message