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 maomaode <ma...@gmail.com> on 2007/09/05 04:38:02 UTC

Abator - Generated beans extend a base model?

Hi,

I ready have a base model, and is it possible to generate the java beans 
and those beans extend the base model?

Let say i have a blog.post table, and abator will generate a Post bean, 
but most of the attributes in the Post, already exist in Entry class

So, I'm wondering, if it's possible to customize the generated Post 
bean, and generate a bean like this

public class Post extends Entry {
 ...
}

Thanks in advance,
James

Re: Abator - Generated beans extend a base model?

Posted by maomaode <ma...@gmail.com>.
> you can use the rootClass attribute.
>
>     <javaModelGenerator targetPackage="com.xx.yyy"  
> targetProject="ForeSight" >
>         <property name="rootClass" 
> value="com.foresight.base.AbstractBaseModel " />
>     </javaModelGenerator>

Oh, great, thanks, I thought it's in the table, ok, Now, it's clear, but 
i think if it'll be greater if it's in the table level

>
> it will do the "public class Post extends Entry ..." stuff. but it 
> will also override all the methods even if those exist in the parent 
> class.

I can use *ignore*, to exclude those methods, right?

I'll give it a try.

Thanks
James
>
> regards
> Ashok
> On 9/5/07, *maomaode* <maomaode@gmail.com <ma...@gmail.com>> 
> wrote:
>
>     Hi,
>
>     I ready have a base model, and is it possible to generate the java
>     beans
>     and those beans extend the base model?
>
>     Let say i have a blog.post table, and abator will generate a Post
>     bean,
>     but most of the attributes in the Post, already exist in Entry class
>
>     So, I'm wondering, if it's possible to customize the generated Post
>     bean, and generate a bean like this
>
>     public class Post extends Entry {
>     ...
>     }
>
>     Thanks in advance,
>     James
>
>

Re: Abator - Generated beans extend a base model?

Posted by Ashok Madhavan <as...@gmail.com>.
you can use the rootClass attribute.

    <javaModelGenerator targetPackage="com.xx.yyy"
targetProject="ForeSight" >
        <property name="rootClass" value="
com.foresight.base.AbstractBaseModel" />
    </javaModelGenerator>

it will do the "public class Post extends Entry ..." stuff. but it will also
override all the methods even if those exist in the parent class.

regards
Ashok
On 9/5/07, maomaode <ma...@gmail.com> wrote:
>
> Hi,
>
> I ready have a base model, and is it possible to generate the java beans
> and those beans extend the base model?
>
> Let say i have a blog.post table, and abator will generate a Post bean,
> but most of the attributes in the Post, already exist in Entry class
>
> So, I'm wondering, if it's possible to customize the generated Post
> bean, and generate a bean like this
>
> public class Post extends Entry {
> ...
> }
>
> Thanks in advance,
> James
>