级联查询的配置
ibatis 级联查询的配置:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN""http://ibatis.apache.org/dtd/sql-map-2.dtd"><sqlMap namespace="login"><resultMap id="login-result"><result property="email" column="email" /><result property="password" column="password" /><result property="loginID" column="login_ID" /><result property="user" column="user_ID" select="login.queryUserByID" /><result property="lastLoginTime" column="lastLoginTime" /><result property="lastLoginIP" column="lastLoginIP" /></resultMap><select id="validateLogin" parameterresultMap="login-result">select email,password,login_ID,user_ID,lastLoginTime,lastLoginIPfrom loginwhere email = #email# and password = #password#;</select><resultMap id="user-result"><result property="phone" column="phone"/><result property="name" column="name"/><result property="qq" column="qq"/><result property="address" column="address"/><result property="level" column="level"/><result property="point" column="point"/><result property="userID" column="User_ID"/><result property="activation" column="activation"/><result property="role" select="login.queryRoleByUser"/></resultMap><select id="queryUserByID" parameterparameterresultClass="set">select Role_IDfrom roleuser where User_ID = #userID#</select></sqlMap>
?