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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
*Sent:* Tuesday, January 16, 2007 6:44 PM
*To:* [email protected]
*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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
> *Sent:* Tuesday, January 16, 2007 6:10 PM
> *To:* [email protected]
> *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 <[EMAIL PROTECTED] > 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:[EMAIL PROTECTED]
> > *Sent:* Tuesday, January 16, 2007 6:03 PM
> > *To:* [email protected]
> > *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 <[EMAIL PROTECTED] > 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*
> > >
> >
> >
>

Reply via email to