ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: Abator generation features
Date Wed, 25 Jan 2006 13:42:13 GMT
As you've discovered, Abator does not trace relationships through your
database or generate this kind of a rich object model.  I've been thinking
about ways to add that feature, but it is a very complex problem to solve in
a general way.  So yes, you'll need to generate custom queries and objects
for this kind of model.

Abator can still be of use to you because it will generate correct insert,
update, and delete statements.  You should also be able to reference some of
the Abator generated select stuff too - for example, the result maps are
often reusable in more complex queries.

In my experience, Abator generates a good foundation for building on.  You
can (and usually should) generate custom queries to fill out the remainder
of your model.  You can add your custom queries to the same sql map files
and Abator won't overwrite them when/if you regenerate.

You can also see the "philosophy" page in the Eclipse documentation for more
thoughts about this subject.  Here's an SVN link if you're not using
Eclipse:

http://svn.apache.org/repos/asf/ibatis/trunk/java/mapper/mapper2/tools/abator/eclipse/org.apache.ibatis.abator.doc/html/gettingstarted/philosophy.html

HTH -
Jeff Butler



On 1/25/06, Davide Marche <javac@email.it> wrote:
>
> Hi everybody,
>
> I am new in the list and i have just started using Abator for my
> project. I have a question (i couldn't find the answer anywhere in the
> abator's documentation). In my database schema i have something like
>
> Product(...., id_category,...)
> Category(id,....)
>
> and of course Product.id_category references Category.id . With iBATIS
> documentation i am able to map this to my java classes so:
>
> public class Product{
>         ........
>         Category category;
>         .....
> }
> public class Category{
>          .....
> }
>
> With Abator i couldn't find a way to generate such a model, it still
> goes on generating
>
> public class Product{
>         ........
>         Integer id_category;
>         .....
> }
>
>
> Is there any way to solve the problem with Abator or should i start
> generating the files myself?
>
> Thanks in advance
>
>
>

Mime
View raw message