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