ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Shelley" <12gaugeme...@gmail.com>
Subject Re: Does Abator from trunk override user added methods to the DAO/DAOImpl files on regen?
Date Tue, 04 Mar 2008 20:28:39 GMT
I created a "Custom" DAO that extends the Abator generated DAO.  That gave
me the ability to rebuild the Abator DAOs on the fly, and still have custom
methods for handling custom queries, translating between custom extended
Models, etc.  So I have a custom DAO that extends the Abator DAO, a custom
SQL Maps file that is included in my Spring SQL Maps Config XML, and if I
need to extend the Model to provide functionality that's outside the scope
of the Data tier, I'll create a custom Model extended from the Abator
generated Model and convert between the two in the custom DAO.  And since
the custom model would be extended from the original Abator generated Model,
passing the custom model back to an abator generated DAO should be fine if
you cast back to the original Abator generated model.

I'm not sure if that's the best way to do it, but it's working for me.

-Ryan

On Fri, Feb 29, 2008 at 1:37 PM, Jared Blitzstein <
mailing-list@blitzstein.net> wrote:

> Is there a recommend way to extend everything so I wouldn't have edit
> source files? For instance I have a table called "actor" and the generated
> class is "Actor". Everything is cool but I need to override Actor.equals(),
> so I was thinking of making a ActorCustom extends Actor class so I don't
> have to touch Actor, but the _SqlMap.xml still will be referencing Actor.
> I'm already extending the DAO to prevent this, but not sure how to do it
> with the _SqlMap.xml file. Any pointers?
>
>
> On Feb 28, 2008, at 3:28 PM, Jeff Butler wrote:
>
> Members added to Java files are preserved with the Eclipse plugin only.
> So you would need to rebuild the plugin to make this work.  Outside of
> Eclipse, you have to do a manual merge.
>
> Some day I'll learn Antlr and fix this for good!  It's just too easy in
> Eclipse :)
>
> Jeff Butler
>
>
>
> On Thu, Feb 28, 2008 at 12:23 PM, Jared Blitzstein <
> mailing-list@blitzstein.net> wrote:
>
> > (Sorry if this is a repost (or possibly a 3 post), something is messed
> > up with my out going email but I think I fixed it)
> >
> > I'm pretty sure adding methods in the generated spring DAO impl/
> > interface in the current abator release were preserved when you
> > regenerated, but they're not being preserved when doing a regen from
> > trunk. Can anyone confirm if that is what is supposed to happen?
> >
>
>
>

Mime
View raw message