Lazy Loading performance improvement
------------------------------------
Key: IBATIS-302
URL: http://issues.apache.org/jira/browse/IBATIS-302
Project: iBatis for Java
Type: Improvement
Components: SQL Maps
Reporter: Oleg Shpak
Priority: Minor
It is very common to use a single parameter (an object ID) to load a dependent
object. This parameter is usually exposed as a property of the dependent
object. It would be good if lazy loading could be configured to return this
parameter as the respective property value without actually loading the object
from the database.
Consider this example:
class Issue {
public Project getProject();
...
}
<select id="getProjectById" resultMap="result"
parameterClass="java.lang.Integer">
SELECT * FROM projects
WHERE id=#id#
</select>
.....
<resultMap id="issueResult" class="Issue">
<result property="id" column="id"/>
<result property="project" column="project_id" select="getProjectById"/>
...
</resultmap>
issue.getProject().getId() may return without actually loading the object from
the database.
I understand that some additional attributes will be needed to name the
matching property of the target object.
A global iBatis settings parameter might be good to turn off this feature for
some circumstances.
Thanks
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira