Hi, I am struggling with the following scenario. Basically I'm trying to get iBatis to load a complex property (a list of int) from a secondary table.
I have two tables, User and Permission. The pk of the User table (UserId) is a fk in the Permission table, and there are many Permission rows for each UserId. I am trying to get iBatis to perform the select from the Permission table whenever a select is performed on the User table, but I always get a 'Invalid column name' from the underlying jdbc driver. I can't work out what query iBatis is trying to perform that is yielding this error. My SqlMap is setup so that the permissions property (a java.util.List of java.lang.Integer) of the User resultMap is as follows: <resultMap id="UserResultMap" class="User"> <result property="userId" column="UserId"/> <result property="permissions" column="permissionId" select="findPermissionByUserId"/> </resultMap> The "findPermissionByUserId" select is defined as: <select id="findPermissionByUserId" parameterClass="int" resultClass="int"> select PermissionId as permissionId from Permissions where UserId = #value# </select> The select is initaited from a "findUserById" select which is defined as: <select id="findUserById" parameterClass="int" resultMap="UserResultMap"> select * from User where UserId = #value# </select> Any help is greatly appreciated. Regards, Paul Smith ------------------------------------------------------------------------ For more information about Barclays Capital, please visit our web site at http://www.barcap.com. Internet communications are not secure and therefore the Barclays Group does not accept legal responsibility for the contents of this message. Although the Barclays Group operates anti-virus programmes, it does not accept responsibility for any damage whatsoever that is caused by viruses being passed. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Barclays Group. Replies to this email may be monitored by the Barclays Group for operational or business reasons. ------------------------------------------------------------------------