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
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
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
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
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
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
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
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)
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
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
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
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:
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’
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
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
Thanks Gareth,
It's clear for me now.
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
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
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
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
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
21 matches
Mail list logo