ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugh.Comp...@mcnichols.com
Subject Re: Urgent help required
Date Fri, 10 Mar 2006 17:58:28 GMT
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

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 );
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.

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

             (Raytheon)"                                                To 
             <Sruthi.Krishnamo         user-java@ibatis.apache.org         
             orthi@USPTO.GOV>                                           cc 
             03/10/2006 12:41                                      Subject 
             PM                        Urgent help required                
             Please respond to                                             

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.

Sruthi Krishnamoorthi
537 A - (Raytheon) Location

View raw message