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 NehaP <ne...@gmail.com> on 2007/08/24 14:47:01 UTC

Question about Abator

Hi,

I wasnt able to find a forum for Abator, hope this is the right forum for
this question.

Before using Abator, I had a set of beans, say of User and Address, that
looked like this

[code]
public class Address
{
   private String city, street;
   private int zipCode;
   // Getters and setters....
}

public class User
{
   private Address adr;
   // Other fields.. 
   // Getters and Setters
}

[/code]

And my db has all these fields in the same table- User

When I try to use Abator to generate the required xml files and the DAOs,
the model bean that gets generated for the User class is obviously not
identical to my class. Modifying the generated code is not a good practice,
so I cant use the generated code and have to use my custom DAOs and xml
files.

If only there were a way to specify to Abator to not generate model beans,
and to use my beans instead (I could provide the mapping), I could use the
generated DAOs and xml files. Is there a way of doing this?

Thanks!
Neha.

PS: I'm a newbie at both- iBATIS  and Abator :-)
-- 
View this message in context: http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311608
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Question about Abator

Posted by Ole Trenner <ol...@gmx.de>.
NehaP wrote:
> The xml files, DAOs and particularly the Example file generated by Abator
> are very useful, hand-coding these would be more difficult than having them
> generated by Abator. The flexibility of Abator is limited only due to the
> fact that we cannot specify a custom Model bean. If we could, then giving
> Abator the mapping between the custom bean and the existing database columns
> would be as tough as simply specifying a resultMap in an SQLMap file (and
> not as tough as writing the whole SQLMap file itself).


In what way do the abator generated model classes differ from yours?

If only the property names are different, you can configure every
property using columnOverride or columnIgnore statements.

If abator just adds code you don't wnat to see, you might consider
inheriting from the abtorgenerated model classes.

If abator ignores your own inheritance scheme, you can set a base class
for your generated model files.

Cheers,
Ole.

Re: Question about Abator

Posted by NehaP <ne...@gmail.com>.
Hi,

The xml files, DAOs and particularly the Example file generated by Abator
are very useful, hand-coding these would be more difficult than having them
generated by Abator. The flexibility of Abator is limited only due to the
fact that we cannot specify a custom Model bean. If we could, then giving
Abator the mapping between the custom bean and the existing database columns
would be as tough as simply specifying a resultMap in an SQLMap file (and
not as tough as writing the whole SQLMap file itself).

Any opinions?

Thanks!
Neha.


Jeff Butler-2 wrote:
> 
> Abator doesn't do this.
> 
> Supplying such a mapping to Abator would be about the same level of
> difficulty as writing your own SqlMap files for your existing beans.  If
> you
> have a set of existing beans, then I suggest that you hand code the SqlMap
> files - it's pretty simple.
> 
> Jeff Butler
> 
> 
> On 8/24/07, NehaP <ne...@gmail.com> wrote:
>>
>>
>> But it should be possible.
>>
>> I guess this could be a feature request?
>>
>> Neha.
>>
>>
>> Yuvraj Shinde wrote:
>> >
>> > I think,
>> >
>> >  You cannot customize the abator.xml.you have to manually do it your
>> > self.
>> >
>> > Regards
>> > yuvraj
>> >
>> > -----Original Message-----
>> > From: NehaP [mailto:nehagp2@gmail.com]
>> > Sent: Friday, August 24, 2007 6:17 PM
>> > To: user-java@ibatis.apache.org
>> > Subject: Question about Abator
>> >
>> >
>> > Hi,
>> >
>> > I wasnt able to find a forum for Abator, hope this is the right forum
>> > for
>> > this question.
>> >
>> > Before using Abator, I had a set of beans, say of User and Address,
>> that
>> > looked like this
>> >
>> > [code]
>> > public class Address
>> > {
>> >    private String city, street;
>> >    private int zipCode;
>> >    // Getters and setters....
>> > }
>> >
>> > public class User
>> > {
>> >    private Address adr;
>> >    // Other fields..
>> >    // Getters and Setters
>> > }
>> >
>> > [/code]
>> >
>> > And my db has all these fields in the same table- User
>> >
>> > When I try to use Abator to generate the required xml files and the
>> > DAOs,
>> > the model bean that gets generated for the User class is obviously not
>> > identical to my class. Modifying the generated code is not a good
>> > practice,
>> > so I cant use the generated code and have to use my custom DAOs and xml
>> > files.
>> >
>> > If only there were a way to specify to Abator to not generate model
>> > beans,
>> > and to use my beans instead (I could provide the mapping), I could use
>> > the
>> > generated DAOs and xml files. Is there a way of doing this?
>> >
>> > Thanks!
>> > Neha.
>> >
>> > PS: I'm a newbie at both- iBATIS  and Abator :-)
>> > --
>> > View this message in context:
>> > http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311608
>> > Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> >
>> >
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311906
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Abator-tf4323332.html#a12323703
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Question about Abator

Posted by Jeff Butler <je...@gmail.com>.
Abator doesn't do this.

Supplying such a mapping to Abator would be about the same level of
difficulty as writing your own SqlMap files for your existing beans.  If you
have a set of existing beans, then I suggest that you hand code the SqlMap
files - it's pretty simple.

Jeff Butler


On 8/24/07, NehaP <ne...@gmail.com> wrote:
>
>
> But it should be possible.
>
> I guess this could be a feature request?
>
> Neha.
>
>
> Yuvraj Shinde wrote:
> >
> > I think,
> >
> >  You cannot customize the abator.xml.you have to manually do it your
> > self.
> >
> > Regards
> > yuvraj
> >
> > -----Original Message-----
> > From: NehaP [mailto:nehagp2@gmail.com]
> > Sent: Friday, August 24, 2007 6:17 PM
> > To: user-java@ibatis.apache.org
> > Subject: Question about Abator
> >
> >
> > Hi,
> >
> > I wasnt able to find a forum for Abator, hope this is the right forum
> > for
> > this question.
> >
> > Before using Abator, I had a set of beans, say of User and Address, that
> > looked like this
> >
> > [code]
> > public class Address
> > {
> >    private String city, street;
> >    private int zipCode;
> >    // Getters and setters....
> > }
> >
> > public class User
> > {
> >    private Address adr;
> >    // Other fields..
> >    // Getters and Setters
> > }
> >
> > [/code]
> >
> > And my db has all these fields in the same table- User
> >
> > When I try to use Abator to generate the required xml files and the
> > DAOs,
> > the model bean that gets generated for the User class is obviously not
> > identical to my class. Modifying the generated code is not a good
> > practice,
> > so I cant use the generated code and have to use my custom DAOs and xml
> > files.
> >
> > If only there were a way to specify to Abator to not generate model
> > beans,
> > and to use my beans instead (I could provide the mapping), I could use
> > the
> > generated DAOs and xml files. Is there a way of doing this?
> >
> > Thanks!
> > Neha.
> >
> > PS: I'm a newbie at both- iBATIS  and Abator :-)
> > --
> > View this message in context:
> > http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311608
> > Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311906
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

RE: Question about Abator

Posted by NehaP <ne...@gmail.com>.
But it should be possible. 

I guess this could be a feature request?

Neha.


Yuvraj Shinde wrote:
> 
> I think,
> 
>  You cannot customize the abator.xml.you have to manually do it your
> self.
> 
> Regards
> yuvraj
> 
> -----Original Message-----
> From: NehaP [mailto:nehagp2@gmail.com] 
> Sent: Friday, August 24, 2007 6:17 PM
> To: user-java@ibatis.apache.org
> Subject: Question about Abator
> 
> 
> Hi,
> 
> I wasnt able to find a forum for Abator, hope this is the right forum
> for
> this question.
> 
> Before using Abator, I had a set of beans, say of User and Address, that
> looked like this
> 
> [code]
> public class Address
> {
>    private String city, street;
>    private int zipCode;
>    // Getters and setters....
> }
> 
> public class User
> {
>    private Address adr;
>    // Other fields.. 
>    // Getters and Setters
> }
> 
> [/code]
> 
> And my db has all these fields in the same table- User
> 
> When I try to use Abator to generate the required xml files and the
> DAOs,
> the model bean that gets generated for the User class is obviously not
> identical to my class. Modifying the generated code is not a good
> practice,
> so I cant use the generated code and have to use my custom DAOs and xml
> files.
> 
> If only there were a way to specify to Abator to not generate model
> beans,
> and to use my beans instead (I could provide the mapping), I could use
> the
> generated DAOs and xml files. Is there a way of doing this?
> 
> Thanks!
> Neha.
> 
> PS: I'm a newbie at both- iBATIS  and Abator :-)
> -- 
> View this message in context:
> http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311608
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311906
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


RE: Question about Abator

Posted by Yuvraj Shinde <Yu...@sos.sungard.com>.
I think,

 You cannot customize the abator.xml.you have to manually do it your
self.

Regards
yuvraj

-----Original Message-----
From: NehaP [mailto:nehagp2@gmail.com] 
Sent: Friday, August 24, 2007 6:17 PM
To: user-java@ibatis.apache.org
Subject: Question about Abator


Hi,

I wasnt able to find a forum for Abator, hope this is the right forum
for
this question.

Before using Abator, I had a set of beans, say of User and Address, that
looked like this

[code]
public class Address
{
   private String city, street;
   private int zipCode;
   // Getters and setters....
}

public class User
{
   private Address adr;
   // Other fields.. 
   // Getters and Setters
}

[/code]

And my db has all these fields in the same table- User

When I try to use Abator to generate the required xml files and the
DAOs,
the model bean that gets generated for the User class is obviously not
identical to my class. Modifying the generated code is not a good
practice,
so I cant use the generated code and have to use my custom DAOs and xml
files.

If only there were a way to specify to Abator to not generate model
beans,
and to use my beans instead (I could provide the mapping), I could use
the
generated DAOs and xml files. Is there a way of doing this?

Thanks!
Neha.

PS: I'm a newbie at both- iBATIS  and Abator :-)
-- 
View this message in context:
http://www.nabble.com/Question-about-Abator-tf4323332.html#a12311608
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.