亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在一個jsp頁面一個<table>內顯示兩張外鍵相關聯表(一對多)的數據的案例

在一個jsp頁面一個<table>內顯示兩張外鍵相關聯表(一對多)的數據的案例

慕斯709654 2018-08-09 11:10:03
(springmvc+mybatis+mysql+jsp)里,在一個jsp頁面一個<table>內顯示兩張外鍵相關聯表(一對多)的數據的案例
查看完整描述

1 回答

?
長風秋雁

TA貢獻1757條經驗 獲得超7個贊

<select id="querytcclass" parameterType="Cclass" resultMap="getClassesMap">        select c.cid,c.cname,s.sname,s.age from test.cclass c ,test.student s where s.cid=c.cid    </select>
    
    <resultMap type="com.ordermeal.PO.Cclass" id="getClassesMap">
        <id column="cid" property="cid"></id>
        <result column="cname" property="cname"/>
        
        <collection property="Student" ofType="com.ordermeal.PO.Student">
            <id column="sid" property="sid"/>
            <result column="sname" property="sname"/>
            <result column="cid" property="cid"/>
            <result column="age" property="age"/>
        </collection>
    </resultMap>


查看完整回答
反對 回復 2018-09-05
  • 1 回答
  • 0 關注
  • 1638 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號