ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Hall" <JH...@cihi.ca>
Subject SQL Map Configuration with Many tables and Domain classes
Date Wed, 13 Apr 2005 15:11:52 GMT

I have about 200 tables and what i've done is group certain child tables in a logical domain.
Don't want to deal with so many scattered xml files for each table.

For example:

If I had parent table PERSON and 3 child tables say PERSON_CHILD1, PERSON_CHILD2, PERSON_CHILD3

can I create one sqlmap file say Person.xml

and then in the file will be ...

<sqlMap namespace="person">

         <!-- PERSON -->
<typeAlias alias="person" type="com.yah.nah.Person" />

<insert id="insertPerson" parameterClass="person" > 

    insert into ......	


         <!-- PERSON_CHILD1 -->
<typeAlias alias="personchild1" type="com.yah.nah.PersonChild1" />

<insert id="insertPersonChild1" parameterClass="personchild1" > 

    insert into ......	


         <!-- PERSON_CHILD2 -->
<typeAlias alias="personchild2" type="com.yah.nah.PersonChild2" />

<insert id="insertPersonChild2" parameterClass="personchild2" > 

    insert into ......	


         <!-- PERSON_CHILD3 -->
<typeAlias alias="personchild3" type="com.yah.nah.PersonChild3" />

<insert id="insertPersonChild3" parameterClass="personchild3" > 

    insert into ......	



So is this legal to do with using many typeAliases and using  parameterClass for 3 different
domain classes as noted in the example ?
Also can the namespace be anything other than the actual domain you are acting on for example
if the domain is Person can the namespace be Personer(just want to know if this is possible)?

please help.


Jason Hall

View raw message