{"id":210962,"date":"2020-11-30T10:12:07","date_gmt":"2020-11-30T02:12:07","guid":{"rendered":"http:\/\/4563.org\/?p=210962"},"modified":"2020-11-30T10:12:07","modified_gmt":"2020-11-30T02:12:07","slug":"spring-%e7%9b%b8%e5%85%b3%ef%bc%8c%e6%9c%89%e6%b2%a1%e6%9c%89%e4%bb%80%e4%b9%88%e5%a5%bd%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=210962","title":{"rendered":"Spring \u76f8\u5173\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u597d\u7684\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Spring \u76f8\u5173\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u597d\u7684\u89e3\u51b3\u65b9\u6848               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RedrumSherlock <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6bd4\u5982\u73b0\u5728\u6709\u4e00\u4e2a\u7b80\u5355\u7684 Employee \u7684 POJO \u7c7b\uff0c\u56e0\u4e3a\u8981\u6570\u636e\u5e93\u64cd\u4f5c\u6240\u4ee5\u8981\u7528 Spring \u7684 JPA \u5c31\u5f97\u5728\u7c7b\u91cc\u52a0\u4e0a Entity \u7684\u6ce8\u91ca\uff0c\u4f46\u662f\u8fd9\u6837\u5c31\u6709 Spring \u7684 context \u4e86\u3002<\/p>\n<p>\u73b0\u5728\u56e0\u4e3a\u5f88\u591a\u5176\u4ed6\u7684\u5fae\u670d\u52a1\u90fd\u9700\u8981\u8fd9\u4e2a\u7c7b\uff0c\u60f3\u628a\u8fd9\u4e2a\u7c7b\u62ff\u5230\u4e0d\u5e26 Spring \u7684\u5171\u7528\u7684 package \u4e0b\u9762\u5c31\u505a\u4e0d\u5230\uff0c\u4e0d\u5f97\u4e0d\u7ef4\u62a4\u4e24\u4e2a\u7c7b\uff0c\u4e00\u4e2a\u662f\u5e26 Spring \u7684\u4e00\u4e2a\u662f\u4e0d\u5e26\u7ed9\u5176\u4ed6\u5fae\u670d\u52a1\u7528\u6bd4\u5982 unwrap json \u4e4b\u7c7b\u7684\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u6bd4\u8f83\u597d\u7684\u529e\u6cd5\u53ea\u7528\u7ef4\u62a4\u4e00\u4e2a\uff1f<\/p>\n<\/p><\/div>\n<p><\/p>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>22<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4371833\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kingfalse <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd0\u884c\u65f6\u52a8\u6001\u5b57\u8282\u7801\u590d\u5236\u4e00\u4e2a\uff1f\u8fd9\u4e2a\u5012\u662f\u4e5f\u597d\u505a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371834\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pelloz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8fd9\u4e2a\u7c7b\u662f\u5355\u72ec\u4e00\u4e2a\u5171\u4eab\u4f9d\u8d56\u5427\uff0c\u4f60\u5728 pom \u91cc\u9762\u5c06 JPA \u76f8\u5173\u4f9d\u8d56\u8bbe\u7f6e\u4e3a &lt;scope&gt;provided&lt;\/scope&gt; \u5c31\u597d\u4e86\u3002<br \/>\u4e0d\u8fc7\u6211\u89c9\u5f97\u4f60\u7684\u610f\u601d\u4f30\u8ba1\u662f\u5199\u4e86\u4e00\u4e2a\u7c7b\uff0c\u7136\u540e\u5230\u5904\u590d\u5236\u7c98\u8d34&#8230;.\u90a3\u5c31\u6ca1\u6709\u597d\u529e\u6cd5\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371835\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nvkou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5fae\u670d\u52a1\u4e0d\u662f\u4e1a\u52a1\u72ec\u7acb\u5417\uff1f\u5176\u4ed6\u7a0b\u5e8f\u81f3\u5c11\u7528\u4e0d\u5230\u8fd9\u4e2a\u7c7b\u3002<br \/>\u8de8\u7cfb\u7edf\u95f4\u4f20\u8f93\u53ef\u4ee5\u518d\u8f6c\u4e00\u4e2a\u901a\u7528 pure pojo \u7136\u540e\u5206\u5305\u505a\u4f9d\u8d56                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371836\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cheng6563 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5199\u4e2a\u7236\u7c7b\u6216\u63a5\u53e3\u6253\u4e0a @Entity \u6ce8\u89e3\uff0c\u5176\u4ed6\u9879\u76ee\u4e5f\u81ea\u5df1\u5199\u4e00\u4e2a\u4e0d\u5e26\u6ce8\u89e3\u7684\u7236\u7c7b\u6216\u63a5\u53e3\uff0c\u8981\u5904\u7406\u597d\u9879\u76ee\u4f9d\u8d56\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371837\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : RedrumSherlock <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nvkou \u662f\u4e1a\u52a1\u72ec\u7acb\uff0c\u4f46\u662f\u67d0\u4e9b\u5fae\u670d\u52a1\u4e4b\u95f4\u8fd8\u662f\u6709\u4e00\u4e9b\u5171\u7528\u7684 model\uff0c\u6211\u4eec\u8fd9\u4e9b\u4e00\u822c\u90fd\u4e22\u4e00\u4e2a\u7c7b\u4f3c lib \u6216\u8005 util \u7684\u5305\u91cc\uff0c\u7136\u540e\u6bcf\u4e2a\u5fae\u670d\u52a1 import \u8fdb\u6765\u51cf\u5c11\u5197\u4f59\u3002<\/p>\n<p>\u5206\u5305\u505a\u4f9d\u8d56\u5177\u4f53\u662f\u600e\u4e48\u64cd\u4f5c\uff1f\u5c31\u8fd8\u662f\u4e00\u4e2a pojo \u7528\u6765\u8de8\u7cfb\u7edf\uff0c\u7136\u540e\u5206\u5305\u518d\u5efa\u4e00\u4e2a\u5e26\u6ce8\u89e3\u7684\u505a JPA \u64cd\u4f5c\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371838\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 340244120w <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6700\u539f\u59cb\u7684 Xml \u5c31\u662f\u505a\u8fd9\u4e2a\u7684\u5440                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371839\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : RedrumSherlock <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @340244120w \u662f\u554a\uff0c\u73b0\u5728\u4e00\u4e2a\u60f3\u6cd5\u5c31\u662f\u4e0d\u7528\u6ce8\u89e3\u56de\u5f52 xml\uff0c\u4f46\u662f Spring boot \u597d\u50cf 2.0 \u4ee5\u540e\u8981\u56de xml \u4e0d\u592a\u65b9\u4fbf\uff0c\u4e0d\u518d\u53bb\u81ea\u52a8\u627e\u9ed8\u8ba4\u7684\u90a3\u4e9b xml \u6587\u4ef6\u4e86\uff0c\u5f97\u81ea\u5df1\u5199\u51e0\u4e2a configuration                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371840\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhazi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f7f\u7528 @entity \u8ddf spring \u7684 context \u4e00\u70b9\u5173\u7cfb\u90fd\u6ca1\u6709\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371841\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mind3x <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8fd9\u9700\u8981\u5171\u7528\u7684\u4e0d\u662f model\uff0c\u800c\u662f DTO \u3002Entity \u548c DTO \u4e4b\u95f4\u5206\u5c42\u5e76\u4e14\u4e92\u76f8\u8f6c\u6362\u662f\u5e38\u89c1\u7684\u57fa\u672c\u64cd\u4f5c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371842\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tension2012 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u4e00\u4e2a\u666e\u901a\u7684 POJO \u7c7b,\u8981\u505a O-R Mapping \u7684\u8bdd, \u65e0\u8bba\u662f annotation \u8fd8\u662f xml \u65b9\u5f0f,\u4f60\u81f3\u5c11\u8981\u544a\u8bc9\u7a0b\u5e8f, \u4f60\u662f\u600e\u4e48\u4e2a\u6620\u5c04\u89c4\u5f8b, \u6bd4\u5982\u4f60\u7684 table name \u662f\u4ec0\u4e48, \u4f60\u7684 column name \u662f\u4ec0\u4e48, \u4f60\u7684 primary key \u7b49\u7b49?<\/p>\n<p>\u4e0d\u8fc7,\u5982\u679c\u4ec0\u4e48\u90fd\u4e0d\u505a\u7684\u8bdd, \u90a3\u5c31\u53ea\u80fd\u7a0b\u5e8f\u5230 mysql \u7684\u90a3\u4e9b\u7cfb\u7edf\u5b57\u5178\u8868\u91cc\u53bb\u67e5\u5bf9\u5e94\u7684\u8868\u540d,\u5217\u540d\u548c\u7c7b\u578b, \u7136\u540e\u81ea\u5df1\u53bb\u7ec4\u88c5\u4e00\u4e2a\u7c7b, \u4f46\u662f\u8fd9\u6837\u5bf9\u547d\u540d\u89c4\u8303\u5f88\u4e25\u683c, \u5f88\u5bb9\u6613\u51fa\u73b0\u6620\u5c04\u9519\u8bef\u7684\u95ee\u9898                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371843\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : VeryZero <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @mind3x \u540c\u610f\uff0c\u5982\u679c\u591a\u4e2a\u5fae\u670d\u52a1\u9700\u8981\u4f9d\u8d56\u540c\u4e00\u4e2a model\uff0c\u8bf4\u660e\u670d\u52a1\u62c6\u5206\u6709\u95ee\u9898\u3002\u3002<\/p>\n<p>\u4e0d\u8fc7\u6211\u4eec\u516c\u53f8\u4e5f\u662f\u8fd9\u4e48\u5e72\u7684                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371844\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4e00\u76f4\u90fd\u4e0d\u660e\u767d\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u5b58\u5728 POJO\uff0cVO\uff0cDTO, Entity \u8fd9\u4e9b\u6982\u5ff5\uff0c\u7eaf\u5c5e\u8fc7\u4e8e\u7406\u8bba\u5316\u7684\u62bd\u8c61\uff0c\u8131\u79bb\u5b9e\u8df5\u592a\u8fdc\uff0c\u5b8c\u5168\u6ca1\u6709\u8003\u8651\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u7684\u7406\u89e3\u7684\u590d\u6742\u5ea6\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371845\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5fae\u670d\u52a1\u4e00\u4e2a\u6700\u57fa\u672c\u7684\u539f\u5219\uff0c\u6bcf\u4e2a\u670d\u52a1\u8981\u5b9e\u73b0\u81ea\u6cbb\uff08\u5f00\u53d1\uff0c\u6d4b\u8bd5\uff0c\u53d1\u90e8\u5468\u671f\u4e0d\u5f71\u54cd\u5176\u5b83\u7684\u670d\u52a1\uff09\uff0c\u670d\u52a1\u4e4b\u95f4\u4f7f\u7528\u8f7b\u91cf\u534f\u8bae\u4ea4\u4e92\uff08\u6bd4\u5982\uff0c HTTP\uff0cMessage Broker \u7b49\uff09\u3002<\/p>\n<p>\u5bf9\u4e8e\u4f60\u7684\u60c5\u51b5\uff0c\u8bf4\u767d\u4e86\u4f60\u7684\u7a0b\u5e8f\u6839\u672c\u5c31\u4e0d\u662f\u5fae\u670d\u52a1\u67b6\u6784\uff0c\u5fae\u670d\u52a1\u538b\u6839\u5c31\u4e0d\u4f1a\u7528\u5230\u6570\u636e\u5e93\u76f8\u5173\u4ee3\u7801\u5171\u4eab\u3002\u5982\u679c\u8981\u5171\u4eab\uff0c\u4e5f\u53ea\u6709\u534f\u8bae\u6570\u636e\u683c\u5f0f\uff08 Http \u7684\u5185\u5bb9\u6570\u636e\u683c\u5f0f\uff0cMessage Payload \u89c4\u683c\uff09\u53ef\u4ee5\u5171\u4eab\u3002<\/p>\n<p>\u6ca1\u6709\u51c6\u5907\u597d MS\uff0c\u5c31\u4e0d\u8981\u5f3a\u884c\u5f80\u4e0a\u9762\u9760\uff0c\u5fae\u670d\u52a1\u67b6\u6784\u8ddf\u4f60\u7684\u6240\u6709\u7684\u6846\u67b6\u6ca1\u592a\u591a\u5173\u7cfb\uff0c\u4f60\u7684\u7a0b\u5e8f\u5e76\u4e0d\u662f\u7528\u4e86 Spring Cloud \u6216\u8005\u5176\u5b83\u4ec0\u4e48\u5fae\u670d\u52a1\u6846\u67b6\u5c31\u662f\u5fae\u670d\u52a1\u67b6\u6784\uff0c\u5f88\u591a\u4eba\u53ea\u662f\u4f7f\u7528\u67d0\u79cd\u6846\u67b6\u201c\u78b0\u74f7\u201d\u5fae\u670d\u52a1\u800c\u5df2\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371846\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mejee <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             9 \u6b63\u89e3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371847\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuanbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u522b\u7684\u670d\u52a1\u7528\u5230\u5c31\u8981\u81ea\u5df1\u641e\u4e2a DTO \u7528\u4e8e\u53cd\u5e8f\u5217\u5316\u3002\u8981\u4e48\u4f60\u628a\u8fd9\u4e2a DTO \u653e\u5230\u4e00\u4e2a\u516c\u5171\u7684\u5305\u91cc\u9762\uff0c\u522b\u7684\u670d\u52a1\u5f15\u7528\u8fd9\u4e2a\u5305\u3002\u4f46\u7ef4\u62a4\u66f4\u65b0\u5305\u7248\u672c\u53c8\u662f\u4e00\u4e2a\u9ebb\u70e6\u4e8b\uff0c\u6240\u4ee5\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u5efa\u8bae\u3002\u8fd8\u6709\u4e2a\u529e\u6cd5\u662f\u522b\u7684\u670d\u52a1\u76f4\u63a5\u7528 Object \u7c7b\u578b\uff0c\u5982\u679c\u53ea\u662f\u7529\u7ed9\u524d\u7aef\u770b\u770b\u6ca1\u6709\u4e1a\u52a1\u903b\u8f91\u76f8\u5173\u7684\u8bdd\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371848\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : perfee <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7cfb\u7edf A\uff0c\u7cfb\u7edf B \u3002<br \/>\u7cfb\u7edf B \u8981\u4f9d\u8d56\u7cfb\u7edf A\uff0c\u90a3\u4e48 A \u5c31\u8981\u6709\u4e00\u4e2a\u5e72\u51c0\u7684\u5bf9\u5916\u7684\u63a5\u53e3\u3002\u5426\u5219 A \u548c B \u5c31\u592a\u8026\u5408\u4e86\u3002<br \/>\u5982\u679c A \u548c B \u90fd\u4e0d\u60f3\u7ed9\u5bf9\u65b9\u5f00\u63a5\u53e3\uff0c\u90a3\u597d\u4e86\uff0c\u641e\u4e00\u4e2a\u4e2d\u7acb\u7684 C\uff0cC \u6765\u62c5\u4efb\u8fd9\u4e2a\u89d2\u8272\uff0c\u53d1\u5e03\u5e72\u51c0\u7684 API \u6216\u8005 SPI\uff0cA B \u5171\u7528\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5982\u679c POJO \u7c7b\u662f\u5171\u7528\u7684\uff0c\u5b83\u5c31\u4e0d\u5e94\u8be5\u88ab A \u89c6\u4f5c\u79c1\u6709\u7684\uff0c\u65e2\u7136\u4e0d\u662f\u79c1\u6709\u7684\uff0c\u5c31\u4e0d\u80fd\u5939\u6742\u79c1\u8d27\u3002<br \/>\u5982\u679c A \u89c9\u5f97\u7ef4\u6301\u8fd9\u4e2a\u5e72\u51c0\u7684 api \u592a\u7d2f\u4e86\uff0c\u5e94\u8be5\u641e\u4e00\u4e2a\u72ec\u7acb\u7684 C \u6765\u7ef4\u62a4\u3002<\/p>\n<p>\u6574\u4f53\u7684\u610f\u601d\u8fd8\u662f\u8981\u56de\u5230\u7ecf\u5e38\u8c08\u8bba\u7684\u70b9\u4e0a\uff1a\u5185\u805a\u548c\u8026\u5408\uff0c\u4f60\u600e\u4e48\u5904\u7406\u8fd9\u4e2a\u5173\u7cfb\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371849\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u521a\u521a\u4ed4\u7ec6\u770b\u4e86\u4e3b\u7684\u8d34\u5b50\uff0c\u50cf\u8fd9\u7c7b\u95ee\u9898\u4e5f\u6bd4\u8f83\u5bb9\u6613\u89e3\u51b3\uff1a\u52a8\u6001\u4ee3\u7406<br \/>\u4e0d\u540c\u5fae\u670d\u52a1\u4e2d\u4f7f\u7528\u540c\u4e00\u4e2a\u9886\u57df\u6a21\u578b\u662f\u6b63\u5e38\u7684\uff0c\u4f46\u4e0d\u540c\u5fae\u670d\u52a1\u4e2d\u6839\u636e\u81ea\u8eab\u7684\u6280\u672f\u7279\u6027\uff0c\u5bf9\u6a21\u578b\u4e5f\u4f1a\u6709\u4e0d\u540c\u7684\u6280\u672f\u578b\u5b9a\u4e49\uff0c\u8fd9\u662f\u5f88\u6b63\u5e38\u7684\u9700\u6c42\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u5728\u80fd\u7528\u7684 JAR \u4e2d\u901a\u8fc7 Java Interface \u5b9a\u4e49\u9886\u57df\u6a21\u578b\uff0cJPA \u4e2d\u53ea\u662f\u5b9e\u73b0\u8fd9\u4e2a Interface\uff0c\u5176\u5b83\u7684\u5fae\u670d\u52a1\u53ea\u770b\u5230 Java Interface\uff0c\u5728\u4e0d\u540c\u5fae\u670d\u52a1\u4e4b\u95f4\u8fdb\u884c\u6a21\u578b\u4f20\u9012\u65f6\uff0c\u901a\u8fc7\u4e00\u4e2a\u52a8\u6001\u4ee3\u7406\u7684\u5bf9\u8c61\u5de5\u5382\u521b\u5efa\u8fd9\u4e2a\u63a5\u53e3\u7684\u5b9e\u4f8b\u3002<\/p>\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e0d\u9700\u8981\u5728\u6240\u6709\u7684\u5fae\u670d\u52a1\u4e2d\u770b\u5230 JPA \u7684 Entity \u4e86\uff0c\u5b83\u4eec\u770b\u5230\u7684\u53ea\u6709\u9886\u57df\u6a21\u578b\u7684 Interface\uff0c\u53ea\u4e0d\u8fc7\u9700\u8981\u5b9a\u4e49\u597d\u5bf9\u8c61\u4f20\u8f93\u7684\u534f\u8bae\uff0c\u548c\u53cd\u5e8f\u5217\u5316\u7684\u903b\u8f91\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371850\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chenshun00 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             BeanUtils.Copy(source,target)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371851\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Aresxue <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u95ee\u9898\u7684\u539f\u56e0\u5c31\u662f\u4f60\u628a DO \u548c DTO \u53d8\u6210\u4e00\u4e2a\u4e86\uff0c\u8fd9\u79cd\u505a\u6cd5\u672c\u8eab\u662f\u6709\u70b9\u95ee\u9898\uff0c\u4f46\u975e\u8981\u8fd9\u4e48\u505a\u4e5f\u6ca1\u4e8b\uff0cclient \u5305\u4f9d\u8d56 JPA \u7136\u540e JPA \u7684\u4f9d\u8d56\u53d8\u6210 provided\uff0c\u5b9e\u9645 run \u7684\u5e94\u7528\u4e2d\u4e5f\u6709\u8981 JPA \u7684\u4f9d\u8d56\uff0c\u4e24\u4e2a\u4f9d\u8d56\u7248\u672c\u8981\u5c3d\u91cf\u4fdd\u6301\u4e00\u81f4                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371852\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Joker123456789 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6b63\u786e\u7684\u505a\u6cd5\u5c31\u662f\u7ef4\u62a4\u4e24\u4e2a\u7c7b\uff0c\u6240\u4ee5\u4e0d\u7528\u6539\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371853\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jrue0011 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6216\u8bb8\u53ef\u4ee5\u5bfb\u627e\u4e00\u4e2a\u5177\u6709\u4ee3\u7801\u751f\u6210\u529f\u80fd(\u6ce8\u89e3\u5904\u7406\u5668)\u7684 mapper \u6846\u67b6\uff0c\u7ef4\u62a4\u4e00\u4e2a\u7c7b\uff0c\u53e6\u4e00\u4e2a\u63d0\u4f9b\u7ed9\u5176\u4ed6\u670d\u52a1\u4f7f\u7528\u7684\u7c7b\u81ea\u52a8\u751f\u6210\u4ee3\u7801\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4371854\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jrue0011 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Jrue0011 MapStruct \u597d\u50cf\u6709\u8fd9\u4e2a\u80fd\u529b\uff0c\u4e0d\u8fc7\u6ca1\u7528\u8fc7\u4e0d\u592a\u6e05\u695a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Spring \u76f8\u5173\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u597d\u7684&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\/210962"}],"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=210962"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/210962\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210962"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}