Re: String parameter problem

2009-07-08 Thread Cax
Hi,i turn on Log4j,but i can't see what is the problem in the log file..here is the result in the log file : 2009-07-08 21:59:12,422 DEBUG main com.ibatis.common.jdbc.SimpleDataSource com.ibatis.common.logging.jakarta.JakartaCommonsLoggingImpl - Created connection 35293. 2009-07-08 21:59:12,438 D

AW: String parameter problem

2009-07-08 Thread Benjamin Klatt
Hi cax, have you tried to execute the query directly on the database to ensure there is a result for your query? br Benjamin -Ursprüngliche Nachricht- Von: Cax [mailto:cahyadiherma...@gmail.com] Gesendet: Mittwoch, 8. Juli 2009 17:31 An: user-java@ibatis.apache.org Betreff: Re: String

Re: AW: String parameter problem

2009-07-08 Thread Cax
yes,of course.there is a record which match the query. When i try to change the data type to Long,it works.but if String,return null value. And then,when i change the WHERE clause condition,to based on other field which the data type is String also like this : select PX_IR025_PAN as pan,

Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread David Brown
Hello Begin, Goodin and Meadors, having read (and reread) the Begin book, and in particular, the ch. 13 Unit testing only seems to cover the use of Mock objects. I don't dispute the need and usefulness of Mock objects but I would like to JUnit test my iBatis/MySql development using a live databa

AW: AW: String parameter problem

2009-07-08 Thread Benjamin Klatt
No there should not be any limitation that you will have to worry about. What data type do you use in the database for the PX_IR025_PAN field? Can you try to explicitly define your sql data type in the query? Like: where PX_IR025_PAN = #pan:VARCHAR# -Ursprüngliche Nachricht- Von: Cax [

RE: Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread Burke.Kevin
David, If you are using Spring to wire up your iBatis configuration, there is an abstract Spring class for performing DAO tests that encapsulates transaction management around each test. You can perform the necessary iBatis calls, and Spring will rollback all of the test changes. If you require

Re: Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread Jeff Butler
You could look at the Ibatis or Ibator builds - they both unit test with JUnit against a "live" database (hsqldb). The Ibator build uses generated DAO layer, JUnit, hsqldb - seems like just what you are asking for. Jeff Butler On Wed, Jul 8, 2009 at 12:52 PM, David Brown wrote: > Hello Begin, G

Re: Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread Clinton Begin
JPetStore also has unit tests that hit the database directly. Clinton On Wed, Jul 8, 2009 at 12:03 PM, Jeff Butler wrote: > You could look at the Ibatis or Ibator builds - they both unit test with > JUnit against a "live" database (hsqldb). > The Ibator build uses generated DAO layer, JUnit, hsq

IsEmpty inside Iterate Tag

2009-07-08 Thread DavidCAIT
Hi, I am having trouble determining the correct syntax to use with the isEmpty tag when iterating over a list. My program has a large list of objects with potentially null fields and I need to customize my insert statements based on whether or not a particular object has a certain field set to nu

RE: IsEmpty inside Iterate Tag

2009-07-08 Thread Poitras Christian
Hi, Can you make it work if you put the list inside a map (under key "list") and use this? Insert into someTable (field1, field2, field3) Values (#list[].field1#, #list[].field2#, NULL, #list[].field3#) Christian -Original Message- From: DavidC

RE: IsEmpty inside Iterate Tag

2009-07-08 Thread DavidCAIT
Yes, that did work. It seems like a bit of a waste to create a Hashmap simply to store a duplicate of the List, but it does resolve the problem. Thanks again for your help. Poitras Christian wrote: > > Hi, > > Can you make it work if you put the list inside a map (under key "list") > and use

Re: Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread David Brown
Hello Jeff, thanks for the reply. I'm not sure what you mean by the IBatis builds (build IBatis from source?). In any case I accepted the Clinton Begin advice (challange) and I built the JPetstore. I'm not confident in the use of in-memory DBs even if it is hsql. And, my requirements are for: My

Re: Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread Jeff Butler
Yes - I mean building from source. The Ibator build includes hundreds of tests that utilize DAO, JUnit, Spring (in some cases), and hsqldb. If you are looking for code examples, then either of the builds offers a wealth of examples. Both run from the command line. Jeff Butler On Wed, Jul 8,

Re: Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread David Brown
Hello Kevin, thanks for the reply (helpful and informative). I am using Spring for the JUnit testing but all via imports. And, I am using annotations: @Rollback, @Test and @Transactional. I have annotated: @Rollback(value=true) as this has been the problem: rollbacks. My problem is the record is

RE: Begin book addresses mock object testing only (alternatives?)

2009-07-08 Thread Burke.Kevin
No problem. The beauty of the Spring transactional manager is you don't have to manage it. It maintains a transaction for the entire test, so any parent records created inside the test method via inserts are all part of the same transaction as the child records. Hence, you should not receive any