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 Gilles Schlienger <s_...@yahoo.com> on 2008/11/14 14:59:40 UTC

Re : Change package of Example classes generated by iBator ?

Thanks Dan,
I'm actually looking to use the Example classes but having them in a different package.

I will look at the "Java Generator". 
I was hoping someone had had the same need and had already addressed it :)

Thanks again
Gilles




________________________________
De : Dan Turkenkopf <dt...@gmail.com>
À : user-java@ibatis.apache.org
Envoyé le : Vendredi, 14 Novembre 2008, 14h21mn 06s
Objet : Re: Change package of Example classes generated by iBator ?

Hi Gilles,

I'm not sure if you're trying not to generate the Example classes at all, or if you want them in a different package.

If you're looking not to generate the Example classes at all, the <table> object has lots of attributes you can add that allow you to change  what gets generated.  For example, setting all the enableXXXbyExample to "false" should stop the Example classes from being generated.  Details on all the attributes can be found here: http://ibatis.apache.org/docs/tools/abator/configreference/table.html

If you want to put them in a different package than your domain classes, then I think you'll need to create your own Java Generator, at least in the Abator.  Some initial instructions can be found here: http://ibatis.apache.org/docs/tools/abator/

If you're willing to build from source and upgrade from trunk, you could create a plugin that implements themodelExampleClassGenerated(TopLevelClass, IntrospectedTable) method which might allow you to change the package for the TopLevelClass passed into it.

Hope this helps,

Dan Turkenkopf
 

On Fri, Nov 14, 2008 at 7:54 AM, Gilles Schlienger <s_...@yahoo.com> wrote:

Hi all,

I'm currently using Abator to generate my model and the daos associated. It is very useful.

I'm looking for a way to AVOID getting the Example classes generated in the same package of my domain classes ?

Would anyone have any tip about this ?

Thanks in advance
Regards
Gilles


      

Re : Re : Change package of Example classes generated by iBator ?

Posted by Gilles Schlienger <s_...@yahoo.com>.
Thanks a lot Jeff,

I'm thinking of adding a default "criteria" directory under the model classes directory.
Do you think that would make sense to be commited to the project ?

Are there other people interested in that feature out there ?
Please anyone, reply if you think this would be interesting to you!

Thanks 
Gilles




________________________________
De : Jeff Butler <je...@gmail.com>
À : user-java@ibatis.apache.org
Envoyé le : Vendredi, 14 Novembre 2008, 16h27mn 50s
Objet : Re: Re : Change package of Example classes generated by iBator ?

With Abator, you'll have to extend one of the built in
JavaModelGenerator implementation and override the getExampleType()
method.

With ibator, you'll have to override one of the built in
IntrospectedTable implementations and override the getExampleType()
method.

Same concept in both, just a different methods for doing it.  An
ibator plugin won't work - it's too late in the generation cycle when
the plugin method is called.

Jeff Butler


On Fri, Nov 14, 2008 at 7:59 AM, Gilles Schlienger <s_...@yahoo.com> wrote:
> Thanks Dan,
> I'm actually looking to use the Example classes but having them in a
> different package.
>
> I will look at the "Java Generator".
> I was hoping someone had had the same need and had already addressed it :)
>
> Thanks again
> Gilles
>
> ________________________________
> De : Dan Turkenkopf <dt...@gmail.com>
> À : user-java@ibatis.apache.org
> Envoyé le : Vendredi, 14 Novembre 2008, 14h21mn 06s
> Objet : Re: Change package of Example classes generated by iBator ?
>
> Hi Gilles,
>
> I'm not sure if you're trying not to generate the Example classes at all, or
> if you want them in a different package.
>
> If you're looking not to generate the Example classes at all, the <table>
> object has lots of attributes you can add that allow you to change  what
> gets generated.  For example, setting all the enableXXXbyExample to "false"
> should stop the Example classes from being generated.  Details on all the
> attributes can be found here:
> http://ibatis.apache.org/docs/tools/abator/configreference/table.html
>
> If you want to put them in a different package than your domain classes,
> then I think you'll need to create your own Java Generator, at least in the
> Abator.  Some initial instructions can be found here:
> http://ibatis.apache.org/docs/tools/abator/
>
> If you're willing to build from source and upgrade from trunk, you could
> create a plugin that implements the
> modelExampleClassGenerated(TopLevelClass, IntrospectedTable) method which
> might allow you to change the package for the TopLevelClass passed into it.
>
> Hope this helps,
>
> Dan Turkenkopf
>
> On Fri, Nov 14, 2008 at 7:54 AM, Gilles Schlienger <s_...@yahoo.com>
> wrote:
>>
>> Hi all,
>>
>> I'm currently using Abator to generate my model and the daos associated.
>> It is very useful.
>>
>> I'm looking for a way to AVOID getting the Example classes generated in
>> the same package of my domain classes ?
>>
>> Would anyone have any tip about this ?
>>
>> Thanks in advance
>> Regards
>> Gilles
>>
>
>
>



      

Re: Re : Change package of Example classes generated by iBator ?

Posted by Jeff Butler <je...@gmail.com>.
With Abator, you'll have to extend one of the built in
JavaModelGenerator implementation and override the getExampleType()
method.

With ibator, you'll have to override one of the built in
IntrospectedTable implementations and override the getExampleType()
method.

Same concept in both, just a different methods for doing it.  An
ibator plugin won't work - it's too late in the generation cycle when
the plugin method is called.

Jeff Butler


On Fri, Nov 14, 2008 at 7:59 AM, Gilles Schlienger <s_...@yahoo.com> wrote:
> Thanks Dan,
> I'm actually looking to use the Example classes but having them in a
> different package.
>
> I will look at the "Java Generator".
> I was hoping someone had had the same need and had already addressed it :)
>
> Thanks again
> Gilles
>
> ________________________________
> De : Dan Turkenkopf <dt...@gmail.com>
> À : user-java@ibatis.apache.org
> Envoyé le : Vendredi, 14 Novembre 2008, 14h21mn 06s
> Objet : Re: Change package of Example classes generated by iBator ?
>
> Hi Gilles,
>
> I'm not sure if you're trying not to generate the Example classes at all, or
> if you want them in a different package.
>
> If you're looking not to generate the Example classes at all, the <table>
> object has lots of attributes you can add that allow you to change  what
> gets generated.  For example, setting all the enableXXXbyExample to "false"
> should stop the Example classes from being generated.  Details on all the
> attributes can be found here:
> http://ibatis.apache.org/docs/tools/abator/configreference/table.html
>
> If you want to put them in a different package than your domain classes,
> then I think you'll need to create your own Java Generator, at least in the
> Abator.  Some initial instructions can be found here:
> http://ibatis.apache.org/docs/tools/abator/
>
> If you're willing to build from source and upgrade from trunk, you could
> create a plugin that implements the
> modelExampleClassGenerated(TopLevelClass, IntrospectedTable) method which
> might allow you to change the package for the TopLevelClass passed into it.
>
> Hope this helps,
>
> Dan Turkenkopf
>
> On Fri, Nov 14, 2008 at 7:54 AM, Gilles Schlienger <s_...@yahoo.com>
> wrote:
>>
>> Hi all,
>>
>> I'm currently using Abator to generate my model and the daos associated.
>> It is very useful.
>>
>> I'm looking for a way to AVOID getting the Example classes generated in
>> the same package of my domain classes ?
>>
>> Would anyone have any tip about this ?
>>
>> Thanks in advance
>> Regards
>> Gilles
>>
>
>
>