ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: Urgent help required
Date Fri, 10 Mar 2006 18:01:26 GMT
Do you mean using a DAO layer around iBATIS?

Larry


On 3/10/06, Hugh.Compton@mcnichols.com <Hugh.Compton@mcnichols.com> 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         user-java@ibatis.apache.org
>              orthi@USPTO.GOV>                                           cc
>
>              03/10/2006 12:41                                      Subject
>              PM                        Urgent help required
>
>
>              Please respond to
>              user-java@ibatis.
>                 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
>
>
>
>
>

Mime
View raw message