Re: Error setting property in case of a null value - How to map correctly ?

2007-11-02 Thread Thorsten Elfert
thanks for the hint. I have done the changes as suggested and I added the Java type information in the resultmap section: However, it still get the same error: Caused by: java.lang.RuntimeException: Error setting property 'setRepurchaseFeeId' of 'XYZ ( [EMAIL

Re: Error setting property in case of a null value - How to map correctly ?

2007-11-02 Thread Larry Meadors
Yeah, you can't set an int to null. int x = null; // <- this won't compile You need to either use a wrapped type (Integer) or 'magic value' (like 0) to handle null. I'd suggest changing the type to Integer instead of int. Larry On 11/2/07, Thorsten Elfert <[EMAIL PROTECTED]> wrote: > > thanks

Re: Error setting property in case of a null value - How to map correctly ?

2007-11-02 Thread Larry Meadors
You are not thinking this through. :-) Boxing means that you can push an int value into an Integer. Unboxing means you can pull an int value out of an Integer. If the Integer is null, what do you pull out of it? Try this code: Integer i = 5; // this is boxing. int j = i;// this is

Re: Error setting property in case of a null value - How to map correctly ?

2007-11-02 Thread Thorsten Elfert
Hi, thanks, I just read the docs and it seems this should work anyway: *** Primitive types such as int, boolean and float cannot be directly supported as primitive types, as the iBATIS Database Layer is a fully Object Oriented approach. Therefore all parameters and results must be an Object at

Re: Ibatis freezing on insert

2007-11-02 Thread Rich Midwinter
No, I'll try and put one together sometime soon. I've tried it with hsqldb now and that worked fine. Rich On 11/2/07, Larry Meadors <[EMAIL PROTECTED]> wrote: > > Do you have a simple unit test that reproduces this? > > Larry > > > On 11/1/07, Rich Midwinter <[EMAIL PROTECTED]> wrote: > > I get t

Re: HowTo add parameter to part of regex in select

2007-11-02 Thread Larry Meadors
You could to this: SELECT * FROM table WHERE REGEXP_LIKE (id, '^($id$)\-[0]{4}[0-9][0-9][A-Z][0-9]{2}[A-Z]$$') Doing this will open you up to SQL injection, so if id = " ');drop table some_important_data; --", you'll be pissed. I'd build the regex in java code and pass it in that way. Larry O

Re: HowTo add parameter to part of regex in select

2007-11-02 Thread Heinrich Götzger
Larry Meadors wrote: > You could to this: > > SELECT * >>FROM table > WHERE REGEXP_LIKE (id, '^($id$)\-[0]{4}[0-9][0-9][A-Z][0-9]{2}[A-Z]$$') > > Doing this will open you up to SQL injection, so if id = " ');drop > table some_important_data; --", you'll be pissed. > > I'd build the regex in java

Re: Error setting property in case of a null value - How to map correctly ?

2007-11-02 Thread Thorsten Elfert
Hi, sorry, I have forgotten to mention ist: it is an int. "Larry Meadors" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 01.11.2007 17:40 Please respond to [email protected] To [email protected] cc Subject Re: Error setting prop

RE: infinite loop in the method 'moveToNextResultsIfPresent'

2007-11-02 Thread Hemant . Kamatgi
We had used ojdbc.jar to configure our datasource. We changed it to classes12.zip and then the bug was resolved. Thanks for the suggestions, anyways. -Original Message- From: Niels Beekman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 31, 2007 10:05 PM To: [email protected]

Re: Ibatis freezing on insert

2007-11-02 Thread Larry Meadors
The reason I ask is that sometimes when you cut out all of the other tools and frameworks, it can help isolate where the problem is located. Besides iBATIS and MySQL, what else is involved? Larry On 11/2/07, Rich Midwinter <[EMAIL PROTECTED]> wrote: > No, I'll try and put one together sometime s

Re: HowTo add parameter to part of regex in select

2007-11-02 Thread Dave . Derry
I'm far from being an expert, so I could be *way* off here. But I suspect that the quoted string is what's causing problems with the variable replacement. Maybe string concatenation would work; something like SELECT * FROM table WHERE REGEXP_LIKE (id, '^(' || #id# || ')\-[0]{4}[0-9][0

HowTo add parameter to part of regex in select

2007-11-02 Thread Heinrich Götzger
Hi, is there a possibility to get following to run with iBATIS? SELECT * FROM table WHERE REGEXP_LIKE (id, '^(#id#)\-[0]{4}[0-9][0-9][A-Z][0-9]{2}[A-Z]$') (remark: this is not working) or would I need to prepare the regexp in the java-part and use it like: SELECT * FROM table WHERE

Re: HowTo add parameter to part of regex in select

2007-11-02 Thread Heinrich Götzger
Dave, [EMAIL PROTECTED] wrote: > I'm far from being an expert, so I could be *way* off here. But I suspect > that the quoted string is what's causing problems with the variable > replacement. Maybe string concatenation would work; something like > > SELECT * FROM table WHERE > REGEXP