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 Paul Carr <Pa...@express-gifts.co.uk> on 2006/02/22 19:01:34 UTC

abator for eclipse generates *Examples classes

Hi , newb to ibatis , Just used abator for eclipse to generate DAO's for
a simple table and I got :-
 
TableSQLmap                - the sqlMap
Table.java                      - the value object
TableExample.java         - some class with the same data as the value
object, but everythings an int, This is where I'm getting confused
TableDAO interface        - the DAO interface
TableDAOImpl               -  implements the above interface, but
doesn't use the generated value objects.... Uses the value object
Examples ???
 
Has anyone got a good example of how all these hang together in a stand
alone java app ?  In particular, what you do with the TableExample
classes  ?
 
Cheers
Paul 
 
 

Re: abator for eclipse generates *Examples classes

Posted by Jeff Butler <je...@gmail.com>.
The example class is used in the selectByExample and deleteByExample methods
- it's used to implement "query by example" functionality.  There's another
recent thread on this list where I show an example of using these methods.

In a stand alone (or any) app, you'll need to do these things:

1. Create an SqlMapConfig.xml file that references the generated SqlMap
files
2. Create a dao.xml file that references the SqlMapConfig.xml and declares
all the generated DAOs
3. Initialize the DaoManager
4. Use the DAOs

This information is all covered in the regular iBATIS documentation for the
Sql Map framework and the DAO framework.  Step 1 would be in the SqlMap
documentation, steps 2-4 are in the DAO documentation.  Any tutorial on
iBATIS would also cover these steps.

Jeff Butler


On 2/22/06, Paul Carr <Pa...@express-gifts.co.uk> wrote:
>
>  Hi , newb to ibatis , Just used abator for eclipse to generate DAO's for
> a simple table and I got :-
>
>
>
> TableSQLmap                - the sqlMap
>
> Table.java                      - the value object
>
> TableExample.java         - some class with the same data as the value
> object, but everythings an int, This is where I'm getting confused
>
> TableDAO interface        - the DAO interface
>
> TableDAOImpl               -  implements the above interface, but doesn't
> use the generated value objects…. Uses the value object Examples ???
>
>
>
> Has anyone got a good example of how all these hang together in a stand
> alone java app ?  In particular, what you do with the TableExample classes
> ?
>
>
>
> Cheers
>
> Paul
>
>
>
>
>