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 13:54:04 UTC

Change package of Example classes generated by iBator ?

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: bitmap fields

Posted by David McReynolds <dm...@secureworks.com>.
Dude, don't ask me why. We are introducing java into a C shop. C programmers love bitmaps (I know, I programmed in C/Unix for 7 years). I think the rational is that it makes the "if" statements simpler.

Not to worry. After we get through this initial transition, the bitmaps are going to be on the short list. OTH, I am having a bit of fun extending ibator to handle some of the other things we must deal with (like primary and secondary databases/datasources.  If I attempt an operation against the primary and it fails, my dao has to retry against a different database)

In C zero is considered false so you can write stuff like I am about to show you.

        if(0x0044 & foo.getPermission())  . . .

where a java programmer (or more accurately, a non-embedded/non-real-time systems programmer) would be more likely to write.

     if(foo.isReadableByGroup() && foo.isReadableByOwner())

-----Original Message-----
From: Larry Meadors [mailto:larry.meadors@gmail.com]
Sent: Friday, November 14, 2008 9:29 AM
To: user-java@ibatis.apache.org
Subject: Re: bitmap fields

I don't know. :)

[OT] I am curious why you would do this instead of using multiple named fields.

Larry


On Fri, Nov 14, 2008 at 7:24 AM, David McReynolds
<dm...@secureworks.com> wrote:
> Has anyone used ibator with bitmaps? We've got several bitmaps in various
> tables and so far, I've resorted to writing custom mappings for queries that
> need to interrogate those fields. I'd love to be able to use the generated
> xxxByExample mappings but I have no idea what the criteria would be because
> of the way one has to deal with bit maps (where foo & 8 > 0, for example,
> returns true only if the the 4th bit(2^3) is set).
>
>
>
> --dlm

Re: bitmap fields

Posted by Larry Meadors <la...@gmail.com>.
I don't know. :)

[OT] I am curious why you would do this instead of using multiple named fields.

Larry


On Fri, Nov 14, 2008 at 7:24 AM, David McReynolds
<dm...@secureworks.com> wrote:
> Has anyone used ibator with bitmaps? We've got several bitmaps in various
> tables and so far, I've resorted to writing custom mappings for queries that
> need to interrogate those fields. I'd love to be able to use the generated
> xxxByExample mappings but I have no idea what the criteria would be because
> of the way one has to deal with bit maps (where foo & 8 > 0, for example,
> returns true only if the the 4th bit(2^3) is set).
>
>
>
> --dlm

bitmap fields

Posted by David McReynolds <dm...@secureworks.com>.
Has anyone used ibator with bitmaps? We've got several bitmaps in various tables and so far, I've resorted to writing custom mappings for queries that need to interrogate those fields. I'd love to be able to use the generated xxxByExample mappings but I have no idea what the criteria would be because of the way one has to deal with bit maps (where foo & 8 > 0, for example, returns true only if the the 4th bit(2^3) is set).

--dlm

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
>>
>
>
>

Re : Change package of Example classes generated by iBator ?

Posted by Gilles Schlienger <s_...@yahoo.com>.
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: Change package of Example classes generated by iBator ?

Posted by Dan Turkenkopf <dt...@gmail.com>.
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
>
>