Quick question (to see if anyone knows before I test it). Can I write a ResultMap that will handle both lazy loading a collection, and using join columns if they exist in the ResultSet?
Here’s an example XML:
<resultMap id="User" type="com.inversoft.cleanspeak.domain.system.User">
<id property="id" column="u_id"/>
<result property="email" column="u_email"/>
<result property="password" column="u_password”/>
<!— This should use the resultMap/nonNullColumn if the column exists in the ResultSet. Otherwise, it should use the lazy-select —>
<collection property="roles" select=“SelectRoles” column=“u_id” resultMap="Role" notNullColumn="r_id"/>
</resultMap>