{"id":233249,"date":"2020-12-29T10:11:05","date_gmt":"2020-12-29T02:11:05","guid":{"rendered":"http:\/\/4563.org\/?p=233249"},"modified":"2020-12-29T10:11:05","modified_gmt":"2020-12-29T02:11:05","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e5%85%a8%e5%b1%80%e6%87%92%e5%8a%a0%e8%bd%bd%e6%b2%a1%e6%9c%89%e7%94%9f%e6%95%88%e5%91%a2%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=233249","title":{"rendered":"\u4e3a\u4ec0\u4e48\u5168\u5c40\u61d2\u52a0\u8f7d\u6ca1\u6709\u751f\u6548\u5462\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e3a\u4ec0\u4e48\u5168\u5c40\u61d2\u52a0\u8f7d\u6ca1\u6709\u751f\u6548\u5462\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : IvanBlade <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>article<\/p>\n<pre><code>public class Article {      private Integer id;      private String title;      private String content;      \/\/ \u8868\u793a\u5f53\u524d\u6587\u7ae0\u4ee3\u8868\u7684\u8bc4\u8bba\u5217\u8868     private List&lt;Comment&gt; commentList;       @Override     public String toString() {         return \"Article{\" +                 \"id=\" + id +                 \", title='\" + title + ''' +                 \", content='\" + content + ''' +                 \", commentList=\" + commentList +                 '}';     }      public String getContent() {         return content;     }      public void setContent(String content) {         this.content = content;     }      public List&lt;Comment&gt; getCommentList() {         return commentList;     }      public void setCommentList(List&lt;Comment&gt; commentList) {         this.commentList = commentList;     }      public Integer getId() {         return id;     }      public void setId(Integer id) {         this.id = id;     }      public String getTitle() {         return title;     }      public void setTitle(String title) {         this.title = title;     }  }  <\/code><\/pre>\n<p>mapper<\/p>\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt; &lt;!DOCTYPE mapper         PUBLIC \"-\/\/mybatis.org\/\/DTD Mapper 3.0\/\/EN\"         \"http:\/\/mybatis.org\/dtd\/mybatis-3-mapper.dtd\"&gt;  &lt;mapper namespace=\"com.Ivan.mapper.ArticleMapper\"&gt;       &lt;!--\u4e00\u5bf9\u591a\u5173\u8054\u67e5\u8be2:\u67e5\u8be2\u6240\u6709\u7684\u7528\u6237\uff0c\u540c\u65f6\u8fd8\u8981\u67e5\u8be2\u51fa\u6bcf\u4e2a\u7528\u6237\u6240\u5173\u8054\u7684\u8ba2\u5355\u4fe1\u606f--&gt;      &lt;resultMap id=\"articleMap\" type=\"com.Ivan.domain.Article\"&gt;         &lt;id property=\"id\" column=\"id\"&gt;&lt;\/id&gt;         &lt;result property=\"title\" column=\"title\"&gt;&lt;\/result&gt;         &lt;result property=\"content\" column=\"content\"&gt;&lt;\/result&gt;           &lt;!--             collection : \u4e00\u5bf9\u591a\u4f7f\u7528 collection \u6807\u7b7e\u8fdb\u884c\u5173\u8054         --&gt;         &lt;collection property=\"commentList\" ofType=\"com.Ivan.domain.Comment\" fetchType=\"lazy\"&gt;             &lt;id property=\"id\" column=\"cid\"&gt;&lt;\/id&gt;             &lt;result property=\"content\" column=\"content\"\/&gt;             &lt;result property=\"author\" column=\"author\"\/&gt;             &lt;result property=\"a_id\" column=\"a_id\" \/&gt;         &lt;\/collection&gt;     &lt;\/resultMap&gt;       &lt;select id=\"displayAllArticle\"  resultMap=\"articleMap\"&gt;         SELECT a.*,c.id cid,c.content, c.author,c.a_id FROM t_comment c RIGHT JOIN t_article a ON c.a_id = a.id     &lt;\/select&gt;  &lt;\/mapper&gt; <\/code><\/pre>\n<p>\u90e8\u5206 sqlmapConfig<\/p>\n<pre><code>&lt;settings&gt;         &lt;!--\u5f00\u542f\u5168\u5c40\u5ef6\u8fdf\u52a0\u8f7d\u529f\u80fd--&gt;          &lt;setting name=\"lazyLoadingEnabled\" value=\"true\"\/&gt;         &lt;!--\u6240\u6709\u65b9\u6cd5\u90fd\u4f1a\u5ef6\u8fdf\u52a0\u8f7d--&gt;         &lt;setting name=\"lazyLoadTriggerMethods\" value=\"toString()\"\/&gt;          &lt;!--        \u56e0\u4e3a cacheEnabled \u7684\u53d6\u503c\u9ed8\u8ba4\u5c31\u4e3a true\uff0c\u6240\u4ee5\u8fd9\u4e00\u6b65\u53ef\u4ee5\u7701\u7565\u4e0d\u914d\u7f6e\u3002        \u4e3a true \u4ee3\u8868\u5f00\u542f\u4e8c\u7ea7\u7f13\u5b58\uff1b\u4e3a false \u4ee3\u8868\u4e0d\u5f00\u542f\u4e8c\u7ea7\u7f13\u5b58\u3002    --&gt;         &lt;setting name=\"cacheEnabled\" value=\"false\"\/&gt;      &lt;\/settings&gt;  <\/code><\/pre>\n<p>\u7ed3\u679c\u4e2d\u7684 commentList \u8fd8\u662f\u7167\u5e38\u663e\u793a\u3002\u3002\u3002\u662f\u54ea\u91cc\u51fa\u4e86\u95ee\u9898\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u5168\u5c40\u61d2\u52a0\u8f7d\u6ca1\u6709\u751f\u6548\u5462\uff1f \u8cc7\u6df1&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233249"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233249"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233249\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233249"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}