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 Ashok Madhavan <as...@gmail.com> on 2007/05/09 16:12:39 UTC

Abator rootClass question

Hi all,

i want to have a common super class for some of my data objects. this will
contain common info like id, createdBy, createdDate, modifiedBy,
modifiedDate etc.

Abator does give a option called 'rootClass' in which u can specify this.
But Abator creates new setter and getter instead of just using hte super
classes's methods.

is there a way by which we can tell Abator to use the super's methods when
it is present in the super.

regards
Ashok

Re: Abator rootClass question

Posted by je...@gmail.com.
I would guess that this is moderately complex.  Besides the complexity
of the introspection, there could be difficult class path issues if
the base class is not in abator's class path.  But this is the beauty
of open source...you can give it a try and see how well it works.  You
would need to implement the JavaModelGenerator interface and plug it
in to abator.

Good luck!

Jeff Butler


On 5/9/07, Ashok Madhavan <as...@gmail.com> wrote:
> Just curious,
>
> will this be difficult to implement. can i implement this in my local and if
> it works give it back ?
>
> ashok
>
> On 5/9/07, jeffgbutler@gmail.com <je...@gmail.com> wrote:
> >
> > Abator does not introspect the base classes to see if there is a match
> > or not.  So no, abator will not do what you are asking for at present.
> > It is an interesting idea however.
> >
> > Jeff Butler
> >
> >
> > On 5/9/07, Ashok Madhavan <as...@gmail.com> wrote:
> > > Hi all,
> > >
> > > i want to have a common super class for some of my data objects. this
> > will
> > > contain common info like id, createdBy, createdDate, modifiedBy,
> > > modifiedDate etc.
> > >
> > > Abator does give a option called 'rootClass' in which u can specify
> > this.
> > > But Abator creates new setter and getter instead of just using hte super
> > > classes's methods.
> > >
> > > is there a way by which we can tell Abator to use the super's methods
> > when
> > > it is present in the super.
> > >
> > > regards
> > > Ashok
> > >
> >
>

Re: Abator rootClass question

Posted by Ashok Madhavan <as...@gmail.com>.
Hi Meindert,
those columns which i had mentioned are common across all tables. Having a
common base class also helps as i can reuse a lot. The other important thing
i gain is alongwith namespaces and spring support it is possible to have as
less code as possible. My action classes, DAO, DAO impl wont change at all.
it will be a common action, common dao, common dao impl. Only the namespace,
DTO, xml, jsp fill will vary. And the namespace will be injected thro
spring. this sorta nicely rolls up. when i need a specific thing which is
differnt for a particular entity, then i extend the base Action class and
add a method and corresponding iBatis chunks.

regards
ashok


On 5/10/07, Meindert <me...@pastelebusiness.com> wrote:
>
>  Not to be nasty but wouldn't it be better to normalize the database and
> put createBy, createDate, modifiedBy etc in his own table/class?
>
> That's what I like about ibatis, I will only fetch this kind of data when
> I actual going to use it.
>
>
>
>
>
> On 5/9/07, Ashok Madhavan < ashok.madhavan@gmail.com> wrote:
> > Hi all,
> >
> > i want to have a common super class for some of my data objects. this
> will
> > contain common info like id, createdBy, createdDate, modifiedBy,
> > modifiedDate etc.
> >
> > Abator does give a option called 'rootClass' in which u can specify
> this.
> > But Abator creates new setter and getter instead of just using hte super
> > classes's methods.
> >
> > is there a way by which we can tell Abator to use the super's methods
> when
> > it is present in the super.
> >
> > regards
> > Ashok
> >
>
>
>

RE: Abator rootClass question

Posted by Meindert <me...@pastelebusiness.com>.
Not to be nasty but wouldn't it be better to normalize the database and put
createBy, createDate, modifiedBy etc in his own table/class?

That's what I like about ibatis, I will only fetch this kind of data when I
actual going to use it.

 

 

On 5/9/07, Ashok Madhavan < ashok.madhavan@gmail.com> wrote:
> Hi all,
>
> i want to have a common super class for some of my data objects. this will
> contain common info like id, createdBy, createdDate, modifiedBy, 
> modifiedDate etc.
>
> Abator does give a option called 'rootClass' in which u can specify this.
> But Abator creates new setter and getter instead of just using hte super
> classes's methods. 
>
> is there a way by which we can tell Abator to use the super's methods when
> it is present in the super.
>
> regards
> Ashok
>

 


Re: Abator rootClass question

Posted by Ashok Madhavan <as...@gmail.com>.
Just curious,

will this be difficult to implement. can i implement this in my local and if
it works give it back ?

ashok

On 5/9/07, jeffgbutler@gmail.com <je...@gmail.com> wrote:
>
> Abator does not introspect the base classes to see if there is a match
> or not.  So no, abator will not do what you are asking for at present.
> It is an interesting idea however.
>
> Jeff Butler
>
>
> On 5/9/07, Ashok Madhavan <as...@gmail.com> wrote:
> > Hi all,
> >
> > i want to have a common super class for some of my data objects. this
> will
> > contain common info like id, createdBy, createdDate, modifiedBy,
> > modifiedDate etc.
> >
> > Abator does give a option called 'rootClass' in which u can specify
> this.
> > But Abator creates new setter and getter instead of just using hte super
> > classes's methods.
> >
> > is there a way by which we can tell Abator to use the super's methods
> when
> > it is present in the super.
> >
> > regards
> > Ashok
> >
>

Re: Abator rootClass question

Posted by je...@gmail.com.
Abator does not introspect the base classes to see if there is a match
or not.  So no, abator will not do what you are asking for at present.
 It is an interesting idea however.

Jeff Butler


On 5/9/07, Ashok Madhavan <as...@gmail.com> wrote:
> Hi all,
>
> i want to have a common super class for some of my data objects. this will
> contain common info like id, createdBy, createdDate, modifiedBy,
> modifiedDate etc.
>
> Abator does give a option called 'rootClass' in which u can specify this.
> But Abator creates new setter and getter instead of just using hte super
> classes's methods.
>
> is there a way by which we can tell Abator to use the super's methods when
> it is present in the super.
>
> regards
> Ashok
>