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 Odilon Oliveira <od...@gmail.com> on 2006/10/18 19:53:42 UTC

Abator: Custom DAO

Hello,

I'm trying add a custom method to my DAO interface, like retrieveAll() to
return all objects from database.
Looking at documentation, the AbstractDAOTemplate class doesnt provide a way
to do this.

Taking a look at BaseDAOGenerator class we have
getExtraImplementationMethods method, but nothing related
to add new methods in DAO interface.

Any clue ?

-- 
---
dilas.com.br

Re: Abator: Custom DAO

Posted by Odilon Oliveira <od...@gmail.com>.
Jeff,

Would be interesting have methods like that.
So in your templates you have precise control about what will be exposed to
the interface.

Thanks for the example. =)

* Let me know if you implement that features.

On 10/18/06, Jeff Butler <je...@gmail.com> wrote:
>
> retrieveAll methods are simple to write:
>
> List retrieveAll() {
>   XXXExample example = new XXXExample();
>   return selectByExample(example);
> }
>
> I did not include support for them in the base Abator code because I think
> it's kind of unusual to use them.
>
> Nevertheless, if you are trying to build a custom DAO generator that will
> always generate them then I haven't made it easy for you.  I'll add a call
> to enable you to add methods to the interface also.  I'll add something
> similar to the SqlMapGenerator and the JavaModeGenerator too in case that
> would be useful to anyone.
>
> Jeff Butler
>
>
> On 10/18/06, Odilon Oliveira <od...@gmail.com> wrote:
> >
> > Hello,
> >
> > I'm trying add a custom method to my DAO interface, like retrieveAll()
> > to return all objects from database.
> > Looking at documentation, the AbstractDAOTemplate class doesnt provide a
> > way to do this.
> >
> > Taking a look at BaseDAOGenerator class we have
> > getExtraImplementationMethods method, but nothing related
> > to add new methods in DAO interface.
> >
> > Any clue ?
> >
> > --
> > ---
> > dilas.com.br
>
>
>


-- 
---
dilas.com.br

Re: Abator: Custom DAO

Posted by Jeff Butler <je...@gmail.com>.
retrieveAll methods are simple to write:

List retrieveAll() {
  XXXExample example = new XXXExample();
  return selectByExample(example);
}

I did not include support for them in the base Abator code because I think
it's kind of unusual to use them.

Nevertheless, if you are trying to build a custom DAO generator that will
always generate them then I haven't made it easy for you.  I'll add a call
to enable you to add methods to the interface also.  I'll add something
similar to the SqlMapGenerator and the JavaModeGenerator too in case that
would be useful to anyone.

Jeff Butler


On 10/18/06, Odilon Oliveira <od...@gmail.com> wrote:
>
> Hello,
>
> I'm trying add a custom method to my DAO interface, like retrieveAll() to
> return all objects from database.
> Looking at documentation, the AbstractDAOTemplate class doesnt provide a
> way to do this.
>
> Taking a look at BaseDAOGenerator class we have
> getExtraImplementationMethods method, but nothing related
> to add new methods in DAO interface.
>
> Any clue ?
>
> --
> ---
> dilas.com.br