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 Zoran Avtarovski <zo...@sparecreative.com> on 2008/04/14 06:05:34 UTC

[ABATOR]: Question and feedback

I used Abator for the time last week on a small project that I was trying to
get out the door in hurry.

First impressions are great, it helped me the base code  out in no time flat
and allowed me to focus on the stuff that needed it. This is a great tool
Jeff.

I have a couple of questions / suggestions:

1. Is there any way of easily changing the code templates to modify the
generated code? Not only the java code, but things like the sqlmap xml
files. 
2. Can I manually specify foreign key relationships? I couldn¹t find any
information about this, but it would be great if I could specify any
relationships and their type (eg 1:1, 1:n ) which would allow abator to
generate some boilerplate code.
3. Related to the previous point I¹d like to be able to specify an alias for
a table (eg Table Users as U) and then the associated ByExample model would
use that alias in the generated code (eg where U.name = Œx¹). The big
advantage will be extending the ByExample  to easily cater to foreign key
relationships

I don¹t want to come across as the sort of person who¹s complaining about
the lack of features in an OS product. I think it¹s great and I¹d love to
help where I can. I didn¹t want to charge off making changes without getting
a feel for what the roadmap for abator is and what others are already doing.

Is there a contributors guide to the code? It would be nice to have an
overview of what¹s happening where.

Z.

Re: [ABATOR]: Question and feedback

Posted by Jeff Butler <je...@gmail.com>.
1. Abator can be extended in a number of ways.  The basic idea is to provide
your own implementation of one of the key interfaces (JavaModelGenerator,
SqlMapGenerator, etc.).  You can either subclass one of the existing
implementations, or write your own.  There is a page in the documentation
that describes the basic process.
2. Abator does not do relationships - this is code you will have to write
manually.
3. You can specify an alias on the <table> element.

People have posted velocity and freemarker implementations of the Abator
code generators to the list previously.  If you want to make a contribution,
the best ways are these:

1. Make a patch file and attach it to a JIRA request
2. Make an extension available somewhere and mention it on the list, or on
the Wiki 3rd party contributions page.

Jeff Butler

On Sun, Apr 13, 2008 at 11:05 PM, Zoran Avtarovski <zo...@sparecreative.com>
wrote:

> I used Abator for the time last week on a small project that I was trying
> to get out the door in hurry.
>
> First impressions are great, it helped me the base code  out in no time
> flat and allowed me to focus on the stuff that needed it. This is a great
> tool Jeff.
>
> I have a couple of questions / suggestions:
>
>
>    1. Is there any way of easily changing the code templates to modify
>    the generated code? Not only the java code, but things like the sqlmap xml
>    files.
>    2. Can I manually specify foreign key relationships? I couldn't find
>    any information about this, but it would be great if I could specify any
>    relationships and their type (eg 1:1, 1:n ) which would allow abator to
>    generate some boilerplate code.
>    3. Related to the previous point I'd like to be able to specify an
>    alias for a table (eg Table Users as U) and then the associated ByExample
>    model would use that alias in the generated code (eg where U.name = 'x').
>    The big advantage will be extending the ByExample  to easily cater to
>    foreign key relationships
>
>
> I don't want to come across as the sort of person who's complaining about
> the lack of features in an OS product. I think it's great and I'd love to
> help where I can. I didn't want to charge off making changes without getting
> a feel for what the roadmap for abator is and what others are already doing.
>
> Is there a contributors guide to the code? It would be nice to have an
> overview of what's happening where.
>
> Z.
>