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 Hofri Yehuda <Ye...@comverse.com> on 2007/01/16 10:56:53 UTC
Using select by example in abator
Hi,
I've managed to create lots of objects using the abator but haven't
manage to create one using the select by example,
Please send me an example of usi ng that.
10x
Hofri
Re: Using select by example in abator
Posted by Jeff Butler <je...@gmail.com>.
Look in the generated code that comes out of Abator. You should see:
1. In the generated DAO interface and implementation classes a
"selectByExample" method
2. In the generated Domain objects a class <<TableName>>Example
3. In the generated SQL an <sql> element with the
id="abatorgenerated_Example_Where_Clause" and a <select> clause with the
id="abatorgenerated_selectByExample"
All these elements work together to generate the queries for select by
example functionality. You use the classes as described in the
documentation I referenced earlier. The <sql> element is where the custom
where clause gets generated - it's pretty advanced iBATIS dynamic SQL.
Hope that helps -
Jeff Butler
On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
>
> then i'm lost in translation with terminology, i had this figured as a
> means of generating code according to some proprietary sql query.
> 10x
> ------------------------------
> *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> *Sent:* Tuesday, January 16, 2007 6:44 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: Using select by example in abator
>
>
> selectByExample statements and code are generated for all tables unless
> you explicitly disable their generation.
>
> The selectByExampleQueryId just inserts something into the ggenerated
> SQL. For example, if you specify selectByExampleQueryId="query27", then the
> generated SQL will have this:
>
> select 'query27' as queryid, ....
>
> This is for DBAs who sometimes want to be able to uniquely identify
> queries running in the DB.
>
> I think you probably have the selectByExample stuff already generated.
>
> Jeff Butler
>
>
>
> On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
> >
> > sure,
> > the abatorConfig.xml file, holds <table> segments where we define the
> > attributes of the code we want to generate - datasource, table etc' and so
> > it also offers
> > using "selectByExampleQueryId=" , i'm trying to use this option but it
> > doesn't work!!!
> >
> > ------------------------------
> > *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> > *Sent:* Tuesday, January 16, 2007 6:10 PM
> > *To:* user-java@ibatis.apache.org
> > *Subject:* Re: Using select by example in abator
> >
> >
> > Sorry - I don't understand what you mean. Can you give a few more
> > details?
> >
> > Jeff Butler
> >
> >
> >
> > On 1/16/07, Hofri Yehuda <Yehuda.Hofri@comverse.com > wrote:
> > >
> > > Hi,
> > > ..it does show a hardcode ex. of code generation but i'm looking for
> > > an examople of generating the dao layer according to a query.
> > > 10x
> > > Hofri
> > >
> > > ------------------------------
> > > *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> > > *Sent:* Tuesday, January 16, 2007 6:03 PM
> > > *To:* user-java@ibatis.apache.org
> > > *Subject:* Re: Using select by example in abator
> > >
> > >
> > > Here's a page from the online docs:
> > >
> > > http://ibatis.apache.org/docs/tools/abator/generatedobjects/exampleClassUsage.html
> > >
> > >
> > > Does this help?
> > >
> > > Jeff Butler
> > >
> > >
> > > On 1/16/07, Hofri Yehuda <Yehuda.Hofri@comverse.com > wrote:
> > > >
> > > > Hi,
> > > >
> > > > I've managed to create lots of objects using the abator but haven't
> > > > manage to create one using the select by example,
> > > >
> > > > Please send me an example of usi ng that.
> > > >
> > > > 10x
> > > >
> > > > *Hofri*
> > > >
> > >
> > >
> >
>
RE: Using select by example in abator
Posted by Hofri Yehuda <Ye...@comverse.com>.
then i'm lost in translation with terminology, i had this figured as a
means of generating code according to some proprietary sql query.
10x
________________________________
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Tuesday, January 16, 2007 6:44 PM
To: user-java@ibatis.apache.org
Subject: Re: Using select by example in abator
selectByExample statements and code are generated for all tables unless
you explicitly disable their generation.
The selectByExampleQueryId just inserts something into the ggenerated
SQL. For example, if you specify selectByExampleQueryId="query27", then
the generated SQL will have this:
select 'query27' as queryid, ....
This is for DBAs who sometimes want to be able to uniquely identify
queries running in the DB.
I think you probably have the selectByExample stuff already generated.
Jeff Butler
On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
sure,
the abatorConfig.xml file, holds <table> segments where we
define the attributes of the code we want to generate - datasource,
table etc' and so it also offers
using "selectByExampleQueryId=" , i'm trying to use this option
but it doesn't work!!!
________________________________
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Tuesday, January 16, 2007 6:10 PM
To: user-java@ibatis.apache.org
Subject: Re: Using select by example in abator
Sorry - I don't understand what you mean. Can you give a few
more details?
Jeff Butler
On 1/16/07, Hofri Yehuda <Yehuda.Hofri@comverse.com > wrote:
Hi,
..it does show a hardcode ex. of code generation but i'm
looking for an examople of generating the dao layer according to a
query.
10x
Hofri
________________________________
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Tuesday, January 16, 2007 6:03 PM
To: user-java@ibatis.apache.org
Subject: Re: Using select by example in abator
Here's a page from the online docs:
http://ibatis.apache.org/docs/tools/abator/generatedobjects/exampleClass
Usage.html
Does this help?
Jeff Butler
On 1/16/07, Hofri Yehuda <Yehuda.Hofri@comverse.com >
wrote:
Hi,
I've managed to create lots of objects using the
abator but haven't manage to create one using the select by example,
Please send me an example of usi ng that.
10x
Hofri
Re: Using select by example in abator
Posted by Jeff Butler <je...@gmail.com>.
selectByExample statements and code are generated for all tables unless you
explicitly disable their generation.
The selectByExampleQueryId just inserts something into the ggenerated SQL.
For example, if you specify selectByExampleQueryId="query27", then the
generated SQL will have this:
select 'query27' as queryid, ....
This is for DBAs who sometimes want to be able to uniquely identify queries
running in the DB.
I think you probably have the selectByExample stuff already generated.
Jeff Butler
On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
>
> sure,
> the abatorConfig.xml file, holds <table> segments where we define the
> attributes of the code we want to generate - datasource, table etc' and so
> it also offers
> using "selectByExampleQueryId=" , i'm trying to use this option but it
> doesn't work!!!
>
> ------------------------------
> *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> *Sent:* Tuesday, January 16, 2007 6:10 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: Using select by example in abator
>
>
> Sorry - I don't understand what you mean. Can you give a few more
> details?
>
> Jeff Butler
>
>
>
> On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
> >
> > Hi,
> > ..it does show a hardcode ex. of code generation but i'm looking for an
> > examople of generating the dao layer according to a query.
> > 10x
> > Hofri
> >
> > ------------------------------
> > *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> > *Sent:* Tuesday, January 16, 2007 6:03 PM
> > *To:* user-java@ibatis.apache.org
> > *Subject:* Re: Using select by example in abator
> >
> >
> > Here's a page from the online docs:
> >
> > http://ibatis.apache.org/docs/tools/abator/generatedobjects/exampleClassUsage.html
> >
> >
> > Does this help?
> >
> > Jeff Butler
> >
> >
> > On 1/16/07, Hofri Yehuda <Yehuda.Hofri@comverse.com > wrote:
> > >
> > > Hi,
> > >
> > > I've managed to create lots of objects using the abator but haven't
> > > manage to create one using the select by example,
> > >
> > > Please send me an example of usi ng that.
> > >
> > > 10x
> > >
> > > *Hofri*
> > >
> >
> >
>
RE: Using select by example in abator
Posted by Hofri Yehuda <Ye...@comverse.com>.
sure,
the abatorConfig.xml file, holds <table> segments where we define the
attributes of the code we want to generate - datasource, table etc' and
so it also offers
using "selectByExampleQueryId=" , i'm trying to use this option but it
doesn't work!!!
________________________________
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Tuesday, January 16, 2007 6:10 PM
To: user-java@ibatis.apache.org
Subject: Re: Using select by example in abator
Sorry - I don't understand what you mean. Can you give a few more
details?
Jeff Butler
On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
Hi,
..it does show a hardcode ex. of code generation but i'm looking
for an examople of generating the dao layer according to a query.
10x
Hofri
________________________________
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Tuesday, January 16, 2007 6:03 PM
To: user-java@ibatis.apache.org
Subject: Re: Using select by example in abator
Here's a page from the online docs:
http://ibatis.apache.org/docs/tools/abator/generatedobjects/exampleClass
Usage.html
Does this help?
Jeff Butler
On 1/16/07, Hofri Yehuda <Yehuda.Hofri@comverse.com > wrote:
Hi,
I've managed to create lots of objects using the abator
but haven't manage to create one using the select by example,
Please send me an example of usi ng that.
10x
Hofri
Re: Using select by example in abator
Posted by Jeff Butler <je...@gmail.com>.
Sorry - I don't understand what you mean. Can you give a few more details?
Jeff Butler
On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
>
> Hi,
> ..it does show a hardcode ex. of code generation but i'm looking for an
> examople of generating the dao layer according to a query.
> 10x
> Hofri
>
> ------------------------------
> *From:* Jeff Butler [mailto:jeffgbutler@gmail.com]
> *Sent:* Tuesday, January 16, 2007 6:03 PM
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: Using select by example in abator
>
>
> Here's a page from the online docs:
>
>
> http://ibatis.apache.org/docs/tools/abator/generatedobjects/exampleClassUsage.html
>
> Does this help?
>
> Jeff Butler
>
>
> On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
> >
> > Hi,
> >
> > I've managed to create lots of objects using the abator but haven't
> > manage to create one using the select by example,
> >
> > Please send me an example of usi ng that.
> >
> > 10x
> >
> > *Hofri*
> >
>
>
RE: Using select by example in abator
Posted by Hofri Yehuda <Ye...@comverse.com>.
Hi,
..it does show a hardcode ex. of code generation but i'm looking for an
examople of generating the dao layer according to a query.
10x
Hofri
________________________________
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Tuesday, January 16, 2007 6:03 PM
To: user-java@ibatis.apache.org
Subject: Re: Using select by example in abator
Here's a page from the online docs:
http://ibatis.apache.org/docs/tools/abator/generatedobjects/exampleClass
Usage.html
Does this help?
Jeff Butler
On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
Hi,
I've managed to create lots of objects using the abator but
haven't manage to create one using the select by example,
Please send me an example of usi ng that.
10x
Hofri
Re: Using select by example in abator
Posted by Jeff Butler <je...@gmail.com>.
Here's a page from the online docs:
http://ibatis.apache.org/docs/tools/abator/generatedobjects/exampleClassUsage.html
Does this help?
Jeff Butler
On 1/16/07, Hofri Yehuda <Ye...@comverse.com> wrote:
>
> Hi,
>
> I've managed to create lots of objects using the abator but haven't manage
> to create one using the select by example,
>
> Please send me an example of usi ng that.
>
> 10x
>
> *Hofri*
>