I have three mapped classes ApplicationImpl, ProfileImpl and ResumeImpl. Snippets of mapping documents are as follows:
| <class | name="ApplicationImpl" | table="APPLICATION" | lazy="true" | > | <many-to-one | name="profile" | class="ProfileImpl" | cascade="save-update" | outer-join="auto" | update="true" | insert="true" | column="PROFILE_OID" | /> | ... | <class | name="ProfileImpl" | table="PROFILE" | lazy="true" | > | <many-to-one | name="resume" | class="ResumeImpl" | cascade="save-update" | outer-join="auto" | update="true" | insert="true" | column="RESUME_OID" | /> | ... | <class | name="ResumeImpl" | table="RESUME" | lazy="true" | > | If I run a query and return ApplicationImpl objects and read through properties on those objects, no sql is ever sent to retrieve the ProfileImpl or ResumeImpl classes as one would expect since they are lazy="true" at the class level. However, if on the ApplicationImpl object I call application.getProfile().getName(), a sql query is sent to the PROFILE table AND the RESUME table. It should not be quering the RESUME table if I just get a property from the ProfileImpl object. Does the system do an eager fetch if you perform a lazy initilization one level down? Thanks. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3897852#3897852 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3897852 ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
