You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by ibrahim demir <ib...@yahoo.com> on 2007/07/25 16:09:17 UTC

ibatis configuration

Hi all;
   
  I have  questions about configuring ibatis.
   
  1-Is there a way of blocking the code generation of some columns on
 some tables. For examle i have table_mytable and it has
   
  column_1
  column_2
  column_3
  column_4
   
  and i do not column_1 and column_2 to be mapped. Is there a way of
 excluidng these columns
   
  2-As you know ibatis DOA classes extends SQLMapDaoTemplate. but after
 generating these classes we manually go and change this to
 xxxSQLMapDaoTemplate which is a class that we want to be extended. Is there a way
 of changing the extended classes for the generated dao objects
   
  3-And the same thing for the ibatis-beans we maually make them extend
 XXXAbstractObject. So is there a way to make them automatically extend
 XXXAbstractObject.
   
  Thanks for the help.
   
  Yours


Ýbrahim DEMÝR
  jdbc_tr group moderator
  http://ibrahimdemir.wordpress.com
       
             
       
  

       
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. 

Re: ibatis configuration

Posted by Aram Mkhitaryan <ar...@googlemail.com>.
> and i do not column_1 and column_2 to be mapped. Is there a way of
>
> > excluidng these columns

If you mean iBATIS config files,
if you specify resultMap for your statement you can manually specify in that
map which columns should be mapped.

<statement id="..." resultMap="rm">
  ...
</statement>
<resultMap id="rm">
   <result property="..." column="..." /> //here will go everything except
column_1 and column_2
</resultMap>

Best,
Aram
________________________________
Aram Mkhitaryan

52, 25 Lvovyan, Yerevan 375000, Armenia

Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com

Re: ibatis configuration

Posted by Jeff Butler <je...@gmail.com>.
I assume you are talking about Abator - not iBATIS.  If so...

1. You can exclude any column from code generation using the <ignoreColumn>
element
2. You could write your own DAO generator - but this is probably more than
you want to do.
3. You can specify the "rootClass" property on the <javaModelGenerator>
element

Take a look at Abator documentation - it's all in there.

Jeff Butler



On 7/25/07, ibrahim demir <ib...@yahoo.com> wrote:
>
> Hi all;
>
>   I have  questions about configuring ibatis.
>
>   1-Is there a way of blocking the code generation of some columns on
> some tables. For examle i have table_mytable and it has
>
>   column_1
>   column_2
>   column_3
>   column_4
>
>   and i do not column_1 and column_2 to be mapped. Is there a way of
> excluidng these columns
>
>   2-As you know ibatis DOA classes extends SQLMapDaoTemplate. but after
> generating these classes we manually go and change this to
> xxxSQLMapDaoTemplate which is a class that we want to be extended. Is
> there a way
> of changing the extended classes for the generated dao objects
>
>   3-And the same thing for the ibatis-beans we maually make them extend
> XXXAbstractObject. So is there a way to make them automatically extend
> XXXAbstractObject.
>
>   Thanks for the help.
>
>   Yours
>
>
> *Ýbrahim DEMÝR*
> *jdbc_tr group moderator* <http://tech.groups.yahoo.com/group/jdbc_tr/>
> *http://ibrahimdemir.wordpress.com* <http://ibrahimdemir.wordpress.com/>
>
>
>
>
> ------------------------------
> Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge
> <http://us.rd.yahoo.com/evt=47093/*http://tv.yahoo.com/collections/222>to
> see what's on, when.
>
>

RE: ibatis configuration

Posted by "Yee, Richard K CTR DMDC" <Ri...@osd.pentagon.mil>.
With iBATIS, since you are supplying the SQL statements to execute, you have complete control over what values you return from the database and how the values are mapped to your result map/JavaBean.

-R

-----Original Message-----
From: ibrahim demir [mailto:ibrahimdemire@yahoo.com] 
Sent: Wednesday, July 25, 2007 7:09 AM
To: user-java@ibatis.apache.org
Subject: ibatis configuration

Hi all;
   
  I have  questions about configuring ibatis.
   
  1-Is there a way of blocking the code generation of some columns on some tables. For examle i have table_mytable and it has
   
  column_1
  column_2
  column_3
  column_4
   
  and i do not column_1 and column_2 to be mapped. Is there a way of excluidng these columns
   
  2-As you know ibatis DOA classes extends SQLMapDaoTemplate. but after generating these classes we manually go and change this to xxxSQLMapDaoTemplate which is a class that we want to be extended. Is there a way of changing the extended classes for the generated dao objects
   
  3-And the same thing for the ibatis-beans we maually make them extend XXXAbstractObject. So is there a way to make them automatically extend XXXAbstractObject.
   
  Thanks for the help.
   
  Yours



Ýbrahim DEMÝR