Re: [iBatis 3] insert/update via annotation w/ object example

2009-08-26 Thread Clinton Begin
Can you submit a JIRA ticket with the NPE? iBATIS should never throw an NPE... Clinton On Wed, Aug 26, 2009 at 4:55 PM, Douglas Bell wrote: > Answered my own question... In case anyone is wondering. > > I had to set both useGeneratedKeys to true and the keyProperty value. > > @Insert("INSERT I

Re: iBATIS 3.0 selectOne SessionException if no data found

2009-08-26 Thread Clinton Begin
Rick's suggestion is correct. That was the idea. Honestly, we don't have to throw the exception, but it is a good in practice IMHO... But you all tell me, do you really want to return null? Clinton On Wed, Aug 26, 2009 at 11:07 AM, Rick wrote: > Maybe a bit of a hack but ... > > public inter

Re: Calling oracle procedure from Java using iBatis

2009-08-26 Thread Anta
Thanks for Reply.. After a hour of debugging I resolved the issue by removing the "parameterClass" attribute from the procedure element in sqlmap. Then it works fine. Once again thanks for your replies Regards, Ant Anta wrote: > > > Hi All, > > I have a stored procedure as like below in or

Re: Calling oracle procedure from Java using iBatis

2009-08-26 Thread Ellis Miller
Or pass/create procedure with out parameter and could test returning "constant" to determine if missing return value is related to error. Otherwise, use a Function as function requires return value and, again, could simplify the testing regarding the prior post. On Aug 26, 2009 3:28 PM, "Dan Turke

RE: [iBatis 3] insert/update via annotation w/ object example

2009-08-26 Thread Douglas Bell
Answered my own question... In case anyone is wondering. I had to set both useGeneratedKeys to true and the keyProperty value. @Insert("INSERT INTO test (test_value) VALUES (#{value})") @Options(useGeneratedKeys = true, keyProperty = "id") void insert(TestObj testObj); -Original Message-

Re: Using the foreach statement in iBatis 3.0

2009-08-26 Thread Jeff Butler
The "collection" attribute of the tag should the property of the parameter object that holds the list of values. From what's below, iBATIS is expecting a "public List getList()" method in the BAFselectByDateRange object. Jeff Butler On Wed, Aug 26, 2009 at 1:43 PM, Richard Bibb wrote: > > Hell

RE: [iBatis 3] insert/update via annotation w/ object example

2009-08-26 Thread Douglas Bell
Thanks Rick, It was a typo on my part :| works as expected now. One last question. I have an Object with two parameters id and value. ID is a generated key I want that key to be populated in the object on insert. Reading through the docs it looks like this is the correct solution... @Insert("I

Re: Calling oracle procedure from Java using iBatis

2009-08-26 Thread Dan Turkenkopf
Hi Ant, I'm not tremendously familiar with PL/SQL stored procedures, but it doesn't look like you're returning anything from yours. I think what's happening is the queryForObject method is looking for a return parameter and not finding anything. If the procedure really doesn't need to return any

Using the foreach statement in iBatis 3.0

2009-08-26 Thread Richard Bibb
Hello I'm trying to do a select along the lines of select rec_date, int_field, data_value from back_adj_future where feed = #{feed} and instrument = #{instrument} and periodicity = #{periodicity}

Re: [iBatis 3] insert/update via annotation w/ object example

2009-08-26 Thread Rick
On Wed, Aug 26, 2009 at 1:10 PM, Douglas Bell wrote: > > I’ve been through the user guide and the test cases but don’t see a good > example of doing an insert or update with a Object using a annotation > @Update(“INSERT INTO foo (bar_1, bar_2) VALUES (#{bar1}, #{bar2})”) > > void update(SomeObje

[iBatis 3] insert/update via annotation w/ object example

2009-08-26 Thread Douglas Bell
I've been through the user guide and the test cases but don't see a good example of doing an insert or update with a Object using a annotation e.g. @Update("INSERT INTO foo (bar_1, bar_2) VALUES (#{bar1}, #{bar2})") void update(SomeObject obj); What am I missing? -Doug From: An

Re: iBATIS 3.0 selectOne SessionException if no data found

2009-08-26 Thread Rick
Maybe a bit of a hack but ... public interface UserMapper { public List getUserIds(String email); } Keep the dao method the same... public long getUserId(String email) { but just do a quick check in there on the size of the List returned, and do what you want with it (throw you own exception i

iBATIS 3.0 selectOne SessionException if no data found

2009-08-26 Thread Thomas G. Schuessler
In my MySQL db, I have a table 'users' with (amongst others) these fields: `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `email` varchar(120) NOT NULL, In UserMapper.java I have the following method public interface UserMapper { public long getUserId(String email); } In UserMapper.xml

Calling oracle procedure from Java using iBatis

2009-08-26 Thread Anta
Hi All, I have a stored procedure as like below in oracle db create or replace PROCEDURE employee_to_delete (i_condition VARCHAR2) IS TYPE r_cursor IS REF CURSOR; actiontypeVARCHAR2 (20) := 'DELETING'; del_cur_temp r_cursor;

Calling oracle procedure from Java using iBatis

2009-08-26 Thread Anta
Hi All, I have a stored procedure as like below in oracle db create or replace PROCEDURE employee_to_delete (i_condition VARCHAR2) IS TYPE r_cursor IS REF CURSOR; actiontypeVARCHAR2 (20) := 'DELETING'; del_cur_temp r_cursor;

Calling oracle procedure from Java using iBatis

2009-08-26 Thread Anta
Hi All, I have a stored procedure as like below in oracle db create or replace PROCEDURE employee_to_delete (i_condition VARCHAR2) IS TYPE r_cursor IS REF CURSOR; actiontypeVARCHAR2 (20) := 'DELETING'; del_cur_temp r_cursor;

Re: Why in Application is worked, but in JSP don't worked?

2009-08-26 Thread bhaa
Hi, All! The problem is resolved. Has transferred business logic in beans. In JSP now there were only structures and EL, "it is dream of the designer". All great thanks. P.S. I ask to excuse for above written code. It was silly ;-)) bhaa wrote: > > Yes, I have looked. To some extent it so.