{"id":699,"date":"2008-01-05T20:36:02","date_gmt":"2008-01-05T12:36:02","guid":{"rendered":"http:\/\/www.zhangling.org\/blog\/20080105\/ibatis-215-upgrade-23-result-mapping.html"},"modified":"2008-10-20T08:59:42","modified_gmt":"2008-10-20T00:59:42","slug":"ibatis-215-upgrade-23-result-mapping","status":"publish","type":"post","link":"https:\/\/www.zhangling.org\/blog\/20080105\/ibatis-215-upgrade-23-result-mapping.html","title":{"rendered":"iBatis 2.1.5\u5347\u7ea7\u81f32.3\u95ee\u9898\u4e00\u5219"},"content":{"rendered":"<p>Lotus Connections 2.0\u540e\u53f0\u7684O\/R mapping\u5c06\u4eceiBatis 2.1.5\u5347\u7ea7\u52302.3\uff0c\u4eca\u5929\u5728\u6d4b\u8bd5\u7684\u65f6\u5019\u53d1\u73b0\u90e8\u7f72iBatis 2.3\u540e\u5bfc\u81f4Blogs\u51fa\u73b0\u5927\u91cfexception\uff0c\u5927\u90e8\u5206\u529f\u80fd\u5931\u6548\u3002\u7136\u800c\u6839\u636e\u6587\u6863\uff0c2.3\u7684API\u662f\u5411\u4e0b\u517c\u5bb9\u7684\uff0c\u7406\u5e94\u4e0d\u8be5\u51fa\u73b0\u6b64\u7c7b\u95ee\u9898\u3002<\/p>\n<p>\u505a\u4e86\u4e00\u756a\u8c03\u67e5\uff0c\u53d1\u73b0\u539f\u56e0\u5982\u4e0b\uff1a\u5f53iBatis\u62ff\u5230\u7ed3\u679c\u96c6\u540e\u8c03\u7528Java pojo\u7684setter\u65b9\u6cd5\u6765\u4fdd\u5b58\u5bf9\u8c61\u96c6\u5408\uff0c\u800c\u5982\u679c\u4e00\u4e2apojo\u5b58\u5728\u4e24\u4e2a\u540c\u540d\u4f46\u53c2\u6570\u7c7b\u578b\u4e0d\u540c\u7684setter\u65f6\uff0c2.3\u7248\u672ciBatis\u4f1a\u8c03\u7528\u5230\u9519\u8bef\u7684\u65b9\u6cd5\u3002\u4ee5Blogs\u4e3a\u4f8b\uff0c\u5176\u4e2d\u4e00\u4e2apojo\u6709\u4e24\u4e2a\u540c\u540d\u7684setter\u65b9\u6cd5\uff0c\u4e00\u4e2a\u53c2\u6570\u7c7b\u578b\u662fjava.util.Set\uff0c\u53e6\u5916\u4e00\u4e2a\u662fjava.util.List\u3002iBatis\u4f1a\u9519\u8bef\u7684\u8c03\u7528&#8221;<em>setXXX(Set mydata)<\/em>&#8220;\u800c\u4e0d\u662f&#8221;<em>setXXX(List mydata)<\/em>&#8220;\u65b9\u6cd5\uff0c\u56e0\u4e3aiBatis\u7684O\/R\u6620\u5c04\u96c6\u5408\u7c7b\u578b\u662f\u4e0d\u652f\u6301java.util.Set\u7684\uff0c\u6240\u4ee5\u51fa\u73b0argument type mismatch\u7684\u9519\u8bef\u3002<\/p>\n<p>\u901a\u8fc7\u4fee\u6539pojo\uff0c\u6d88\u9664\u540c\u540dsetter\u65b9\u6cd5\u53ef\u4ee5\u89e3\u51b3\u5347\u7ea7\u52302.3\u540e\u7684\u8fd9\u4e2a\u95ee\u9898\u3002\n<\/p>\n<p>\n","protected":false},"excerpt":{"rendered":"<p>Lotus Connections 2.0\u540e\u53f0\u7684O\/R mapping\u5c06\u4eceiBatis 2.1.5\u5347\u7ea7\u52302.3\uff0c\u4eca\u5929\u5728\u6d4b\u8bd5\u7684\u65f6\u5019\u53d1\u73b0\u90e8\u7f72iBatis 2.3\u540e\u5bfc\u81f4Blogs\u51fa\u73b0\u5927\u91cfexception\uff0c\u5927\u90e8\u5206\u529f\u80fd\u5931\u6548\u3002\u7136\u800c\u6839\u636e\u6587\u6863\uff0c2.3\u7684API\u662f\u5411\u4e0b\u517c\u5bb9\u7684\uff0c\u7406\u5e94\u4e0d\u8be5\u51fa\u73b0\u6b64\u7c7b\u95ee\u9898\u3002 \u505a\u4e86\u4e00\u756a\u8c03\u67e5\uff0c\u53d1\u73b0\u539f\u56e0\u5982\u4e0b\uff1a\u5f53iBatis\u62ff\u5230\u7ed3\u679c\u96c6\u540e\u8c03\u7528Java pojo\u7684setter\u65b9\u6cd5\u6765\u4fdd\u5b58\u5bf9\u8c61\u96c6\u5408\uff0c\u800c\u5982\u679c\u4e00\u4e2apojo\u5b58\u5728\u4e24\u4e2a\u540c\u540d\u4f46\u53c2\u6570\u7c7b\u578b\u4e0d\u540c\u7684setter\u65f6\uff0c2.3\u7248\u672ciBatis\u4f1a\u8c03\u7528\u5230\u9519\u8bef\u7684\u65b9\u6cd5\u3002\u4ee5Blogs\u4e3a\u4f8b\uff0c\u5176\u4e2d\u4e00\u4e2apojo\u6709\u4e24\u4e2a\u540c\u540d\u7684setter\u65b9\u6cd5\uff0c\u4e00\u4e2a\u53c2\u6570\u7c7b\u578b\u662fjava.util.Set\uff0c\u53e6\u5916\u4e00\u4e2a\u662fjava.util.List\u3002iBatis\u4f1a\u9519\u8bef\u7684\u8c03\u7528&#8221;setXXX(Set mydata)&#8220;\u800c\u4e0d\u662f&#8221;setXXX(List mydata)&#8220;\u65b9\u6cd5\uff0c\u56e0\u4e3aiBatis\u7684O\/R\u6620\u5c04\u96c6\u5408\u7c7b\u578b\u662f\u4e0d\u652f\u6301java.util.Set\u7684\uff0c\u6240\u4ee5\u51fa\u73b0argument type mismatch\u7684\u9519\u8bef\u3002 \u901a\u8fc7\u4fee\u6539pojo\uff0c\u6d88\u9664\u540c\u540dsetter\u65b9\u6cd5\u53ef\u4ee5\u89e3\u51b3\u5347\u7ea7\u52302.3\u540e\u7684\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-699","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/posts\/699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/comments?post=699"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/posts\/699\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/media?parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/categories?post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/tags?post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}