> The id column (or columns) should uniquely identify a resulting object
> amongst the collection of all objects.
>
> Are you using MyBatis 3.1.1? If not, you should be. We've had a lot of
> discussions about id's and associations. Try this (remove
> column="PRODID" from the id outside of the association) :
Yes, I'm using MyBatis 3.1.1. Based on what you've said, having PRODID as
the identifier for the main resultmap and also it's association and
collection types is causing the problem. MyBatis is unable to uniquely
identify objects. The modification you suggested unfortunately didn't work.
>> 2. I got a log from the mybatis log factory, but I couldn't find the
>> *mapping logs* in it.
>
> Make sure you enable DEBUG for MyBatis:
I already had this thing in. I guess resultMap logs are not part of what the
internal log factory generates. The following is what I get:
2013-02-06 14:59:18,909 DEBUG [main] - Logging initialized using
'org.apache.ibatis.logging.log4j.Log4jImpl' adapter.
2013-02-06 14:59:19,706 DEBUG [main] - Openning JDBC Connection
2013-02-06 14:59:22,925 DEBUG [main] - ooo Using Connection
[oracle.jdbc.driver.T4CConnection@1a68ef9]
2013-02-06 14:59:22,925 DEBUG [main] - ==> Preparing: <SELECT query>
2013-02-06 14:59:23,128 DEBUG [main] - ==> Parameters:
2013-02-06 14:59:38,394 DEBUG [main] - Resetting autocommit to true on JDBC
Connection [oracle.jdbc.driver.T4CConnection@1a68ef9]
2013-02-06 14:59:38,394 DEBUG [main] - Closing JDBC Connection
[oracle.jdbc.driver.T4CConnection@1a68ef9]
My options
1. Not having buyer (collection) and productDetails (association) properties
as part of Product (main property). Separate queries to fetch these might
help.
2. Having a stored procedure to offset for the loss of time in mapping.
3. Changing my data model to have objects with unique identifiers.
Let me know if you have any suggestions.
--
View this message in context:
http://mybatis-user.963551.n3.nabble.com/Nested-result-mapping-taking-too-long-tp4026407p4026410.html