Re: Populating existing beans...

2006-09-12 Thread Diran Ayandele
Sorry, misunderstood.  I see what you're saying, but I can't answer that one.  Diran Daniel Pitts wrote: To clarify more, I have a bunch of beans of different classes.  There is a table for each class of bean, with columns that correspond directly to bean properties. This makes

RE: Populating existing beans...

2006-09-12 Thread Daniel Pitts
I could (and in fact that is what I have been doing) But, it's a pity to do the same work that iBATIS does already when it knows the class beforehand. -Original Message- From: Chris Lamey [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 2:22 PM To: user-java@ibatis.apache.org

RE: Populating existing beans...

2006-09-12 Thread Chris Lamey
On Tue, 2006-09-12 at 13:49 -0700, Daniel Pitts wrote: > To clarify more, > I have a bunch of beans of different classes. There is a table for > each class of bean, with columns that correspond directly to bean > properties. This makes it easy to do things like id="getAuthors" resultClass="author

Re: How to pass a parameter with DECIMAL data type

2006-09-12 Thread Brad Balmer
If you are using MySQL 5, could this be an issue using strict sql mode? [EMAIL PROTECTED] wrote: I am passing a parameter for DECIMAL(5, 2) to a stored procedure. I have the following parameterMap.     {call sp_getInfo(?)} When I call the stored procedure using DAO object, I got

RE: Populating existing beans...

2006-09-12 Thread Daniel Pitts
To clarify more, I have a bunch of beans of different classes.  There is a table for each class of bean, with columns that correspond directly to bean properties. This makes it easy to do things like SELECT * from authors   What I'd like to do is something like SELECT * FROM $table$ From: D

RE: Populating existing beans...

2006-09-12 Thread Poitras Christian
Try using the discriminator tag in your resultMap.   Christian From: Daniel Pitts [mailto:[EMAIL PROTECTED] Sent: Tuesday, 12 September 2006 16:42To: user-java@ibatis.apache.orgSubject: RE: Populating existing beans... Thanks for the reply.  I'm well aware of queryForMap, but the problem i

How to pass a parameter with DECIMAL data type

2006-09-12 Thread Cs2000xli
I am passing a parameter for DECIMAL(5, 2) to a stored procedure. I have the following parameterMap.     {call sp_getInfo(?)} When I call the stored procedure using DAO object, I got the following error sql error with the cause. --- Cause: com.mysql.jdbc.MysqlDataTruncation: Data tru

Re: Populating existing beans...

2006-09-12 Thread Chris Lamey
I think he's saying he wants iBATIS to populate already existing beans in a map rather than create new beans. So basically "Bean b = byId.get(beanId)" rather than "new Bean()". I guess the iBATIS call would be something like populateMap(statementName, parameterObject, key, mapWithExistingObjects)

RE: Populating existing beans...

2006-09-12 Thread Daniel Pitts
Thanks for the reply.  I'm well aware of queryForMap, but the problem isn't grouping the objects.   Basically, I have a bean "graph" (or tree, or whatever) that has been constructed before there is enough information to run the final query. Also, I don't know the bean class before hand (and d

Re: Populating existing beans...

2006-09-12 Thread Diran Ayandele
Daniel, there is queryForMap functionality in iBatis.  It looks like this: SqlMapExecutor.queryForMap(statementName, parameterObject, key).  The key will be a column in your result map which could be your bean.id property after the result map populates the bean.  I am not sure what you mean by

Populating existing beans...

2006-09-12 Thread Daniel Pitts
I have a Map byId; Which was built by "byId.put(myBean.getId(), myBean);" MyBean is the base class, there are many types of "MyBean" objects. Is there a away to tell iBATIS to use the bean in "byId" map as the result object? Or do I have to get the result, and copy the values over myself? I know

Re: Search screen : HOW TO

2006-09-12 Thread Fabio Insaccanebbia
Ok, I was talking about an Oracle behaviour: a different plan if you were writing the real value in the sql (as in TOAD) or as a bind variable (as in iBatis / JDBC)I had thought it could be related to your problem... but I was wrong :-) On 9/12/06, Paul Carr <[EMAIL PROTECTED]> wrote:

RE: Search screen : HOW TO

2006-09-12 Thread Paul Carr
It is indexed, but wouldn’t I see the same problem through TOAD if it was down an index ? (running DB2 btw)   Anyway, I’ve changed to use the dynamic tags, as recommended by Muthu, the problem has gone away, and my valueObject looks much prettier without the ‘noentrynoentrynoentrynoentry’

Re: Search screen : HOW TO

2006-09-12 Thread Fabio Insaccanebbia
Just a couple of questions..Is the pmp.MANUFACTURE_PROCESS_ID field indexed? Are the field values equally distributed? If the answers are (yes, no) and you're using Oracle, maybe you're having a problem with a skewed index. Added each "dynamic" line in one by one, and it was ok until I addedpmp.MA

RE: Search screen : HOW TO

2006-09-12 Thread Poitras Christian
I suggest you enable logging in iBATIS, then take the query that is run from the logging and run it into TOAD. This may help locate where the problem is. Btw, if some search parameters can be empty, it will be faster to use tags like to limit the number of tables in the join. Christian -Ori

Re: How to use sqlmap to create an object with not empty construnctor

2006-09-12 Thread Anthony Hong
Thanks Gareth, It's clear for me now.

RE: Search screen : HOW TO

2006-09-12 Thread M Muthukumaran
In that case you may want to check the execution plan but it may less likely to solve your problem on using pmp.MANUFACTURE_PROCESS_ID in query. But it can provide some hint. I think the query is compiled everytime and it is not using the bind variable's. Can we confirm this from logs ? Thanks M

RE: Search screen : HOW TO

2006-09-12 Thread Paul Carr
I have tried modifying the query so that the only "dynamic" bit is (jow.JOB_STATUS_C =#jobStatC:INTEGER# or #jobStatC:INTEGER# = -1) I.E. I ripped out (mr.RETAILER_GROUP_ID like #groupId:VARCHAR# or #groupId:VARCHAR# = 'noentrynoentrynoentrynoentrynoentry') and (mrl.BARCODE_T LIKE #barcode:VAR

RE: Search screen : HOW TO

2006-09-12 Thread M Muthukumaran
For furthur clarification, What happens when we hardcode the JOB_STATUS_C in xml file like <.."jow.JOB_STATUS_C = 0 or #jobStatC:INTEGER# = -1".> Also why not you can make use of tag's like I don't know the exa

Search screen : HOW TO

2006-09-12 Thread Paul Carr
HiAll, I'm developing a JSP screen to allow users to search a database of orders on various criteria. There are several text boxes on the screen where you can enter things like Item id Barcode id Date Process id Etc And click search the backend then runs this SQL query:- select

Re: How to use sqlmap to create an object with not empty construnctor

2006-09-12 Thread Gareth Moorst
The classes used in iBatis need to conform to the JavaBeans spec - they need to have a no-arg constructor.If you really need to use the class with a string constructor, I'd suggest returning a Map from the sqlmap queryForObject method, then constructing your java object in your DAO.Gareth.- Ori