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("INSERT INTO test (test_value) VALUES (#{value})")
@Options(keyProperty = "id")
void insert(TestObj testObj);
... But I get a null pointer.
-----Original Message-----
From: Rick [mailto:[email protected]]
Sent: Wednesday, August 26, 2009 10:34 AM
To: [email protected]
Subject: Re: [iBatis 3] insert/update via annotation w/ object example
On Wed, Aug 26, 2009 at 1:10 PM, Douglas Bell <[email protected]> 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(SomeObject obj);
> What am I missing?
Did you try it? Works fine for me (I'd use @Insert though for inserts,
but @Update works as well.)
I do agree though that it probably should be shown in the docs.
Clinton, I'll add that to the wiki.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]