Actually, what I have written does not take the place of a DAO layer per
say,,,
All that it does it completely turn it into an object database type layer,
without having to pass strings into the statements. It completely abstracts
you from Ibatis, is all, so you have a generic Datastore interface, with a
concrete factory that creates an instance of that implementation. Mine is
IbatisDataStore.java.
That way, instead of using
sqlMapClient.insert("insertPerson", arg1),, or whatever,,, you just have
DataStore.insert (Person );
Much cleaner, and better abstraction in my opinion. You clients, or
whatever have no idea about ibatis, or anything, which you could put in a
dao layer, whatever. We certainly over enginner things here. I worked a
little on the JDO spec and used Hibernate tons, I just hated having to pass
"function" names into the methods, when nobody else does this.
Hugh
"Larry Meadors"
<[EMAIL PROTECTED]
org> To
Sent by: [email protected]
[EMAIL PROTECTED] cc
il.com
Subject
Re: Urgent help required
03/10/2006 01:01
PM
Please respond to
[EMAIL PROTECTED]
apache.org
Do you mean using a DAO layer around iBATIS?
Larry
On 3/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> You would actually prefer to receive the object back right? just that it
is
> not null tells you that something was inserted. WIth the object being
> returned you can see additional things that your SQL might have done,
like
> if you are calling a stored proc, or if you are using the <selectKey>
proc
> in your <insert> then that field in you object would have the value in it
> too......
>
> Beter in my opinion....
>
>
> Anyone ever thought of writing an abstraction layer with Ibatus? i.e.
>
>
> /////////////////////////////////////
> DataStore ds = new DatastoreFactory.getDataStore(Widget.class);
> Widget w = new Widget();
> ...
>
> Collection c = ds.findAll( )
> Widget w1 = ds.find( new Object[] { new String( " WHERE PK = 2 ") } )
>
> ds.insert( w );
> w.modifySomething();
> ds.update( w );
> ds.delete( w );
> //////////////////
>
>
> I got one of these written, works slick. The reason why, only thing I
> REALLY hate about Ibatis is having to pass the string names into the
> update, inserts, etc.
>
> NEXT::
> I hate the SQL grammer coupling I introduced on the finder methods. This
> actually causes you to have to KNOW column names, which is not ideal. I
am
> going to generate a EL language that will parse through the xml files and
> get the column - > property names so you can do this findAll("
> accountBalance > 20.00 "), (where accountBalance is the actuall POJO
> property name, NOT the column name.....
>
> Any takers / thoughts?
>
>
> Hugh Compton
>
>
>
>
>
> "Krishnamoorthi,
> Sruthi
> (Raytheon)"
To
> <Sruthi.Krishnamo [email protected]
> [EMAIL PROTECTED]>
cc
>
> 03/10/2006 12:41
Subject
> PM Urgent help required
>
>
> Please respond to
> [EMAIL PROTECTED]
> apache.org
>
>
>
>
>
>
> The docs says
>
>
> int rows = sqlMap.insert ("insertProduct", product);
>
>
> returns a int value
>
>
>
>
>
> When I code it ,the return value is object. I am not able to get the int
> return value. Please help me out.
>
>
>
>
>
> Thanks,
> Sruthi Krishnamoorthi
> 703-562-9732(Work)
> 537 A - (Raytheon) Location
>
>
>
>
>