{"id":229614,"date":"2020-12-14T17:11:14","date_gmt":"2020-12-14T09:11:14","guid":{"rendered":"http:\/\/4563.org\/?p=229614"},"modified":"2020-12-14T17:11:14","modified_gmt":"2020-12-14T09:11:14","slug":"%e6%b5%81%e8%a1%8c-orm-%e6%a1%86%e6%9e%b6%e6%80%a7%e8%83%bd%e6%b5%8b%e8%af%95%ef%bc%88%e5%a6%82%e5%9b%be%ef%bc%89","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=229614","title":{"rendered":"\u6d41\u884c ORM \u6846\u67b6\u6027\u80fd\u6d4b\u8bd5\uff08\u5982\u56fe\uff09"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6d41\u884c ORM \u6846\u67b6\u6027\u80fd\u6d4b\u8bd5\uff08\u5982\u56fe\uff09               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/12\/20201229_5feb0d74d4908.png\" alt=\"\u6d41\u884c ORM \u6846\u67b6\u6027\u80fd\u6d4b\u8bd5\uff08\u5982\u56fe\uff09\" \/><\/p>\n<pre><code>Benchmark               (framework)   Mode  Cnt    Score    Error   Units BenchmarkRunner.query       mybatis  thrpt   10   66.269 \u00b1  5.584  ops\/ms BenchmarkRunner.query          jdbc  thrpt   10  125.223 \u00b1  6.476  ops\/ms BenchmarkRunner.query     hibernate  thrpt   10   57.952 \u00b1  2.983  ops\/ms BenchmarkRunner.query        objsql  thrpt   10   85.329 \u00b1  4.812  ops\/ms BenchmarkRunner.update      mybatis  thrpt   10  118.780 \u00b1  6.028  ops\/ms BenchmarkRunner.update         jdbc  thrpt   10  184.414 \u00b1 10.612  ops\/ms BenchmarkRunner.update    hibernate  thrpt   10   66.626 \u00b1  1.556  ops\/ms BenchmarkRunner.update       objsql  thrpt   10  130.013 \u00b1  2.718  ops\/ms <\/code><\/pre>\n<blockquote>\n<p>\u5176\u4e2d ops\/ms \u8868\u793a\u6bcf\u6beb\u79d2\u5b8c\u6210\u7684\u64cd\u4f5c<\/p>\n<\/blockquote>\n<p>\u65e0\u8bba\u662f\u67e5\u8be2\uff0c\u8fd8\u662f\u66f4\u65b0\uff0c\u4e0e MyBatis \u65e0\u6cd5\u62c9\u5f00\u8f83\u5927\u7684\u5dee\u8ddd\uff0c\u4f46\u591a\u6b21\u8fd0\u884c\u540e\uff0c\u603b\u662f\u7a33\u5b9a\u7684\u9886\u5148\u3002ObjectiveSQL \u5728\u6027\u80fd\u4e0e\u6613\u7528\u6027\u4e0a\u76f8\u6bd4\u5176\u5b83 ORM \u6846\u67b6\u4f18\u52bf\u6bd4\u8f83\u660e\u663e\uff0c\u7f16\u5199\u7684\u4ee3\u7801\u91cf\u4e0a\u4f18\u52bf\u66f4\u52a0\u660e\u663e\uff0c\u5e0c\u671b\u5927\u5bb6\u591a\u591a\u4f53\u9a8c\uff0c\u5e76\u80fd\u63d0\u4ea4 issue\uff0c<\/p>\n<p>https:\/\/github.com\/braisdom\/ObjectiveSql<\/p>\n<p>\uff08\u559c\u6b22\u7684\u670b\u53cb\uff0c\u7ed9\u4e2a star\uff0c\u611f\u8c22\uff09<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>19<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4711048\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wysnylc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u89c9\u5f97\u662f\u8fa3\u4e2a\u84dd\u4eba\u79fd\u571f\u8f6c\u751f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711049\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : taogen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u8bf4\u8fc7\u7a0b\uff0c\u76f4\u63a5\u7ed9\u7ed3\u679c\uff1f\u53ef\u590d\u73b0\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711050\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : buliugu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5efa\u8bae\u76f4\u63a5\u5efa\u4e00\u4e2a repo \u653e Benchmark\uff0c\u53d1\u4e2a\u56fe\u592a ppt \u4e86\u4e0d\u591f\u786c\u6838\uff08\u9003                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711051\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : leonme <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8d8a\u63a5\u8fd1\u539f\u751f sql \u6027\u80fd\u8d8a\u597d\uff0c\u5c01\u88c5\u8d8a\u6df1\u6027\u80fd\u8d8a\u5dee\uff5e\u5f88\u6d45\u663e\u800c\u53c8\u8bd5\u7528\u7684\u9053\u7406                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711052\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shyangs <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             mybatis 3.5.6<br \/>hibernate 5.2.12.Final                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711053\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : janus77 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u91cc\u9762\u5e94\u8be5\u53ea\u6709 hibernate \u7b97 orm \u6846\u67b6\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711054\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @taogen \u8fd9\u91cc\u6709\u5b8c\u6574\u7684\u4ee3\u7801\uff1a https:\/\/github.com\/braisdom\/ObjectiveSql\/tree\/master\/benchmark                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711055\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @buliugu \u4f30\u8ba1\u4f60\u6ca1\u6709\u8fdb\u9879\u76ee\u91cc\u770b\uff0c\u8fd9\u91cc\u6709\u5b8c\u6574\u7684 benchmark \u4ee3\u7801\uff0c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711056\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @janus77 ORM \u5230\u5e95\u662f\u4ec0\u4e48\uff0c\u6709\u54ea\u4e9b\u7279\u5f81\uff0c\u5f88\u96be\u8bf4\u6e05\uff0c\u7406\u8bba\u4e0a\uff0c\u5c06\u5173\u8054\u6570\u636e\u5e93\u7684\u8868\u8f6c\u6362\u4e3a Java Class \u90fd\u53ef\u4ee5\u79f0\u4e3a ORM<br \/>@leonme \u6027\u80fd\u548c\u6613\u7528\u6027\u4e24\u8005\u8981\u5e73\u8861\u8003\u8651\u7684\uff0c\u4e24\u4e2a\u6307\u6807\u4e0d\u53ef\u80fd\u540c\u65f6\u90fd\u975e\u5e38\u9ad8\uff0c\u5c01\u88c5\u662f\u89e3\u51b3\u5f00\u53d1\u7684\u590d\u6742\u5ea6\uff0c\u5728\u4e0d\u7684\u573a\u666f\u4e2d\u6709\u4e0d\u540c\u7684\u9009\u62e9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711057\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ytmsdy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6613\u7528\u6027\u8d8a\u597d\uff0c\u5c01\u88c5\u7684\u8d8a\u591a\uff0c\u6027\u80fd\u80af\u5b9a\u4e0b\u964d\u3002<br \/>\u8d8a\u63a5\u8fd1\u539f\u751f\u6001\uff0c\u6027\u80fd\u80af\u5b9a\u8d8a\u63a5\u8fd1\u539f\u751f\u6001\u3002<br \/>\u4f46\u662f\u6211\u89c9\u5f97\u5427\uff0c\u7edd\u5927\u90e8\u5206\u7f51\u7ad9\u8fd8\u6ca1\u6709\u5230\u8fbe\u6027\u80fd\u74f6\u9888\u3002\u7a0b\u5e8f\u8dd1\u7684\u6162\uff0c\u7edd\u5927\u90e8\u5206\u662f\u7a0b\u5e8f\u5199\u7684\u6709\u95ee\u9898\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711058\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : noble4cc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a objsql \u5c31\u662f\u5927\u4f6c\u4f60\u7684\u4f5c\u54c1\u5427\uff0c\u6709\u70b9\u7c7b\u4f3c jooq\uff0c\u4e4b\u524d\u811a\u672c\u8bed\u8a00\u7684\u6846\u67b6\u5f88\u591a\u90fd\u6709\u8fd9\u8bbe\u8ba1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711059\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @noble4cc \u662f\u7684\uff0c\u6709\u70b9\u7c7b\u4f3c\uff0c\u524d\u671f\u53c2\u8003\u8fc7 Jooq\uff0c\u53d1\u73b0 Jooq \u6709\u597d\u591a\u5730\u65b9\u505a\u7684\u4e0d\u591f\u597d\uff0c\u6240\u4ee5\u81ea\u5df1\u624d\u5199\u4e86\u4e00\u4e2a\uff0c\u4e3b\u8981\u662f\u9488\u5bf9\u590d\u6742 SQL \u8fdb\u884c\u5904\u7406\uff0c\u540c\u65f6\u4e5f\u652f\u6301\u7b80\u5355 SQL \u7684\u5904\u7406\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711060\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ytmsdy <\/p>\n<p>\u9ad8\u6027\u80fd\u548c\u6613\u7528\u6027\u672c\u8eab\u5c31\u4e0d\u53ef\u80fd\u540c\u65f6\u5b58\u5728\uff0c\u6b64\u6d88\u5f7c\u957f\uff0c\u5177\u4f53\u9879\u76ee\u5177\u4f53\u5206\u6790\uff0c\u4e0d\u80fd\u4e00\u6982\u800c\u8bba\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711061\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Foredoomed <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u50cf jooq \u8fd9\u79cd\u6846\u67b6\u4e0d\u88ab\u5927\u591a\u6570\u7528\u6237\u63a5\u53d7\u7684\u6839\u672c\u539f\u56e0\u5728\u4e8e\u4ee3\u7801\u751f\u6210\u7684 sql \u4e0d\u4f1a\u662f\u6700\u4f18\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711062\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Foredoomed \u8981\u7406\u89e3 ObjectiveSQL \u4e0d\u662f\u751f\u6210 SQL\uff0c\u800c\u80fd\u7528 Java \u7684\u8bed\u6cd5\u5199 SQL\uff0c\u4f60\u770b\u5230\u7684 Java \u4ee3\u7801\u51e0\u4e4e\u548c SQL \u4e00\u6a21\u4e00\u6837\uff0c\u662f\u4e0d\u662f\u6700\u4f18\u770b\u4f60\u600e\u4e48\u5199 Java \u4ee3\u7801\u4e86\u3002<\/p>\n<p>Order.Table orderTable = Order.asTable();<br \/>Select select = new Select();<\/p>\n<p>select.project(sum(orderTable.amount) \/ sum(orderTable.quantity) * 100)<br \/> .from(orderTable)<br \/> .where(orderTable.quantity &gt; 30 &amp;&amp;<br \/> orderTable.salesAt.between(&#8220;2020-10-10 00:00:00&#8221;, &#8220;2020-10-30 23:59:59&#8221;))<br \/> .groupBy(orderTable.productId);                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711063\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ytmsdy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Braisdom \u662f\u7684\u3002\u6846\u67b6\u9009\u62e9\uff0c\u5177\u4f53\u4f18\u5316\u8981\u9488\u5bf9\u81ea\u5df1\u5b9e\u9645\u9879\u76ee\u7684\u5e76\u53d1\u91cf\uff0c\u670d\u52a1\u7c7b\u578b\uff0c\u670d\u52a1\u7ed3\u6784\u6765\u8bbe\u8ba1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711064\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ytmsdy ORM \u6846\u67b6\u7684\u9009\u62e9\u662f\u89e3\u51b3\u4e1a\u52a1\u7cfb\u7edf\u5f00\u53d1\u7684\u6613\u7528\u6027\uff0c\u800c\u5728\u5927\u6570\u636e\u91cf\u63d2\u5165\u65f6\uff0c\u53ef\u4ee5\u624b\u52a8\u62fc\u63a5 SQL \u7684\u5f62\u5f0f\uff0c\u4e0d\u540c\u573a\u666f\u4e0d\u540c\u7684\u5904\u7406\u65b9\u5f0f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711065\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : taogen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u8ba4\u4e3a README \u5e94\u8be5\u91cd\u70b9\u4ecb\u7ecd<br \/>1. \u6211\u4e3a\u4ec0\u4e48\u8981\u7528\u3002ObjectiveSQL \u89e3\u51b3\u4e86\u7528\u6237\u4ec0\u4e48\u75db\u70b9\uff1f\u4e3a\u4ec0\u4e48\u8981\u4ece\u719f\u6089\u7684\u6846\u67b6\u8f6c\u7528 ObjectiveSQL \uff1f ObjectiveSQL \u771f\u7684\u65b9\u4fbf\u5f88\u591a\u5417\uff0c\u8fd8\u662f\u53ea\u662f\u6362\u4e86\u79cd\u5199\u6cd5\u800c\u5df2\u3002<br \/>2. \u9879\u76ee\u9002\u4e0d\u9002\u5408\u7528\u3002ObjectiveSQL \u7684\u4f18\u52bf\u662f\u4ec0\u4e48\uff1f\u5728\u54ea\u4e9b\u573a\u666f\u6709\u7edd\u5bf9\u4f18\u52bf\uff1f ObjectiveSQL \u9762\u5411\u54ea\u4e9b\u76ee\u6807\u7528\u6237\uff1f\u4e3a\u4ec0\u4e48\u8981\u7528 ObjectiveSQL \uff1f\u6211\u7684\u9879\u76ee\u9002\u4e0d\u9002\u5408\u7528 ObjectiveSQL \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4711066\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Braisdom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @taogen \u597d\u60f3\u6cd5\uff0c\u6211\u76ee\u524d\u53ea\u662f\u4ecb\u7ecd\u4e86\uff0cObjectiveSQL \u662f\u4ec0\u4e48\uff1f\u6211\u9700\u8981\u4ed4\u7ec6\u4fee\u6539\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6d41\u884c ORM \u6846\u67b6\u6027\u80fd\u6d4b\u8bd5\uff08\u5982\u56fe\uff09&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\/229614"}],"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=229614"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/229614\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229614"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}