我在網上找了很久, 他們擺出來的所謂的樹組件, 都是基于ID PID這種父子節點對應的. 這種情況一般都是選單這類的用的比較多而我要的不是這種效果. 我想要的效果 比如mybatis有ResultMap標簽, 它是根據你定義的物體類的層級來進行撰寫的
<resultMap id="ArticleAndCommentMap" type="com.zhbcm.squad.common.vo.ArticleVO" extends="baseResultMap">
<collection property="commentVOS" ofType="com.zhbcm.squad.common.vo.CommentVO">
<id column="cid" property="id" jdbcType="BIGINT"/>
<result column="pub_user_id" property="pubUserId" jdbcType="BIGINT"/>
<result column="comment" property="comment" jdbcType="LONGVARCHAR"/>
<result column="article_id" property="articleId" jdbcType="BIGINT"/>
<result column="create_time1" property="createTime" jdbcType="DATE"/>
<result column="cdeleted" property="deleted" jdbcType="INTEGER"/>
<collection property="replies" ofType="com.zhbcm.squad.po.SqReply">
<id column="rid" property="id" jdbcType="BIGINT"/>
<result column="comment_id" property="commentId" jdbcType="BIGINT"/>
<result column="pub_user_id1" property="pubUserId" jdbcType="BIGINT"/>
<result column="target_user_id" property="targetUserId" jdbcType="BIGINT"/>
<result column="comment2" property="comment" jdbcType="LONGVARCHAR"/>
<result column="create_time2" property="createTime" jdbcType="DATE"/>
<result column="rdeleted" property="deleted" jdbcType="INTEGER"/>
</collection>
</collection>
</resultMap>
他們之間不存在什么父子關系, 所以希望哪位大佬幫忙, 我個人也在嘗試目前思路不是很清晰, 不過我想用的應該是反射+遞回進行實作的.
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/269119.html
標籤:Web 開發
上一篇:關于引進依賴的問題 求大佬解決
下一篇:大神求程序呀
