{"id":85,"date":"2015-10-23T02:52:41","date_gmt":"2015-10-23T02:52:41","guid":{"rendered":"https:\/\/boochlin.com\/?p=85"},"modified":"2016-07-13T14:34:22","modified_gmt":"2016-07-13T14:34:22","slug":"android-orm-library-green-dao-introduction","status":"publish","type":"post","link":"https:\/\/boochlin.com\/?p=85","title":{"rendered":"Android ORM Library- Green DAO\uff08\u4e00\uff09 introduction"},"content":{"rendered":"<p><iframe style=\"border: 1px solid #CCC; border-width: 1px; margin-bottom: 5px; max-width: 100%;\" src=\"\/\/www.slideshare.net\/slideshow\/embed_code\/key\/rT2IItArugcUc9\" width=\"600\" height=\"500\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\"> <\/iframe><\/p>\n<div style=\"margin-bottom: 5px;\"><strong> <a title=\"GreenDao Introduction\" href=\"\/\/www.slideshare.net\/secret\/rT2IItArugcUc9\" target=\"_blank\">GreenDao Introduction<\/a> <\/strong><\/div>\n<p>\u300e<span style=\"color: #3366ff;\">greenDAO is an open source project to help Android developers working with data stored in SQLite.<\/span> \u300f<br \/>\n\u524d\u8a00\u5f88\u7c21\u55ae\uff0c<span style=\"color: #000000;\"><span style=\"color: #808080;\">\u5c31\u662f<\/span><span style=\"color: #0000ff;\">\u6211\u53ef\u4ee5\u5e6b\u52a9\u4f60\u5b58\u53d6SQLite<\/span><\/span><br \/>\n\u4f46\u662f\u4f60\u53ef\u80fd\u6703\u60f3\uff0c\u9023SQLite\u90fd\u4e0d\u6703 \u9084\u4f86\u8ddf\u4eba\u5bb6\u5b78\u5beb\u5565Android\uff0c\u9000\u4e0b<br \/>\nbut\u8981\u8a18\u4f4f\u6703\u5beb\u8ddf\u5beb\u7684\u597d\uff0c\u9019\u662f\u5169\u78bc\u5b50\u4e8b\u60c5<br \/>\n\u800c\u4e14\u8eab\u70baOOP\u7684\u652f\u6301\u8005\uff0c\u61c9\u8a72\u90fd\u4e0d\u662f\u6703\u559c\u6b61SQLite\u00a0script and Cusor \u7684\u786c\u6f22<\/p>\n<p>\u5ee2\u8a71\u7d50\u675f\uff0c\u5148\u5f37\u8abf\u5728\u524d\uff0c\u9019\u662f\u4e00\u7bc7\u79d1\u666eORM and GreenDao\u00a0\u7684\u4ecb\u7d39\u6587\uff0c\u4e0d\u6703\u6709\u592a\u9ad8\u6df1\u7684\u6771\u897f<br \/>\n\u6709\u8208\u8da3\u7684\u8a71\u63a5\u4e0b\u4f86\u5c31\u6162\u6162\u4e00\u9801\u4e00\u9801\u8b1b\u89e3<\/p>\n<p><!--more--><\/p>\n<h3>page 1-2<\/h3>\n<h4 style=\"padding-left: 30px;\">Outline<\/h4>\n<p style=\"padding-left: 30px;\">\u9019\u6b21\u8b1b\u89e3\u5206\u70ba\u4e94\u500b\u6bb5\u843d<br \/>\n1. Why greendao<br \/>\n\u6700\u6839\u672c\u7684\u539f\u56e0\u662f\u5565\uff1f\u4e0d\u76f4\u63a5\u7528Android \u7684sqlite<br \/>\n2. Feature &#8212;-\u00a0\u6709\u5565\u82b1\u62db\uff08\u52a0\u901f\u958b\u767c\uff09<br \/>\n3. Performance &#8212;\u00a0\u901f\u5ea6\uff08\u57f7\u884c\u901f\u5ea6\uff09<br \/>\n4. How to getting start<br \/>\n5. How to use<br \/>\n\u958b\u59cb\u73a9\u5427<\/p>\n<h3>page 3<\/h3>\n<h4 style=\"padding-left: 30px;\">\u7a76\u7adf\u70ba\u4f55\u8981\u4f7f\u7528green dao?<\/h4>\n<p style=\"padding-left: 30px;\">\u9019\u5c31\u8981\u56de\u5230\u958b\u767cAndroid database \u7684\u6839\u672c\u4e0a\uff0c\u6709\u4e9b\u6771\u897f\u662f\u55ae\u7d14Android \u958b\u767c\u8005\u4e0d\u559c\u6b61\u7684\u4e8b\u60c5<br \/>\n\u5c31\u50cf\u662f\u5beb Content resolver and SQLite\u00a0script \u9019\u7a2e\u4ee4\u4eba\u89ba\u7684\u6e3e\u8eab\u4e0d\u5c0d\u52c1\u7684\u6771\u897f\uff0c\u4e00\u6d41\u958b\u767c\u611f\u6574\u500b\u4e0d\u898b<br \/>\n\u518d\u4ed4\u7d30\u60f3\u60f3\u539f\u56e0\uff0c\u5c31\u662f\u9019\u5e7e\u9ede\u4e0d\u723d<br \/>\n1. DB\u00a0\u548c Curosr \u4e00\u9ede\u90fd\u4e0dObject-Oriented Programming, OOP\uff0c\u7269\u4ef6\u5c0e\u5411\u7a0b\u5f0f\u8a2d\u8a08\u3002<br \/>\n2. \u5bebSQLite script \u4e00\u9ede\u90fd\u4e0d\u9ad8\u968e\uff0c\u611f\u89ba\u5c31\u662f\u7d44\u53e5\u5b50\u800c\u5df2<br \/>\n3. \u4e0d\u9ad8\u968e\u5c31\u7b97\u4e86\uff0c\u8001\u662f\u5728select * \u9019\u7a2e\u5dee\u4e0d\u591a\u7684\u53e5\u5b50<br \/>\n4. \u5176\u5be6\u6211\u4e0d\u77e5\u9053\u539f\u4f86\u7d44SQLite script \u88e1\u9762\u4e0d\u80fd\u7528 \u300e||\u300f\u9019\u7a2e\u4e0acs101\u5c31\u8a72\u77e5\u9053\u7684\u6771\u897f<br \/>\n<del datetime=\"2015-10-20T01:42:17+00:00\">5. \u597d\u5566\uff0c\u6211\u627f\u8a8d\u6211\u8d85\u5f31\u7684<\/del><\/p>\n<p style=\"padding-left: 30px;\"><del datetime=\"2015-10-20T01:42:17+00:00\">\u70ba\u4f55\u6211\u8981\u82b1\u90a3\u67d0\u591a\u6642\u9593\u53bb\u4ecb\u7d39\u4e00\u5957\u65b0\u7684lib\uff0c\u7c21\u55ae\u4f86\u8aaa\u5c31\u662fteam\u88e1\u9762\u7684\u5c0f\u5925\u4f34(\u6211)\u9700\u8981\u6559\u80b2<\/del><\/p>\n<p>&nbsp;<\/p>\n<h3>page 4<\/h3>\n<h4 style=\"padding-left: 30px;\">It is popular?<\/h4>\n<p style=\"padding-left: 30px;\">\u597d\u4e0d\u597d\u7528\u4e0d\u80fd\u53ea\u807d\u6211\u8aaa\u4e4b\u5176\u5be6\u4ed6\u5f88\u6d41\u884c<br \/>\n\u81f3\u5c11pinterest \u7e3d\u807d\u904e\u4e86\u5427<\/p>\n<h3>page 5<\/h3>\n<h4 style=\"padding-left: 30px;\">Features<\/h4>\n<p style=\"padding-left: 30px;\"><strong>1. \u5feb<\/strong><br \/>\n<strong>2. ORM \uff08Object Relational Mapping\uff0c\u7c21\u7a31ORM\uff0c\u6216O\/RM\uff0c\u6216O\/R mapping\uff09<\/strong><br \/>\n\u7269\u4ef6\u5c0e\u5411\u662f\u5f9e\u8edf\u9ad4\u5de5\u7a0b\u57fa\u672c\u539f\u5247\uff08\u5982\u8026\u5408\u3001\u805a\u5408\u3001\u5c01\u88dd\uff09\u7684\u57fa\u790e\u4e0a\u767c\u5c55\u8d77\u4f86\u7684\uff0c\u800c\u95dc\u806f\u5f0f\u8cc7\u6599\u5eab\u5247\u662f\u5f9e\u6578\u5b78\u7406\u8ad6\u767c\u5c55\u800c\u4f86\u7684\uff0c\u5169\u5957\u7406\u8ad6\u5b58\u5728\u986f\u8457\u7684\u5340\u5225\u3002\u70ba\u4e86\u89e3\u6c7a\u9019\u500b\u4e0d\u5339\u914d\u7684\u73fe\u8c61\uff0c\u7269\u4ef6\u95dc\u806f\u5c0d\u6620\u6280\u8853\u61c9\u904b\u800c\u751f\u3002\uff08from wiki\uff09<br \/>\n<strong>2.1 Code generate<\/strong><br \/>\n\u5e6b\u4f60\u641e\u5b9adirty code\u7684\u90e8\u4efd\uff0c\u5c31\u662f\u4ee5\u4e0b\u5e7e\u500btopic<br \/>\n<strong>2.2 Read and write object.<\/strong><br \/>\nORM\u6700\u5927\u76ee\u7684\u5c31\u662f\u964d\u4f4e\u958b\u767c\u4e0a\u7269\u4ef6\u8207\u8cc7\u6599\u5eab\u7684\u4e0d\u6279\u914d\u554f\u984c\uff0c\u5c0d\u65bc\u524d\u7aef\u5de5\u7a0b\u5e2b\u4f86\u8aaa\u5247\u662f\u5e0c\u671b\u8f38\u5165\u548c\u8f38\u51fa\u90fd\u53ea\u662f\u500b\u7269\u4ef6\uff0c\u6700\u597d\u80fd\u53ea\u5229\u7528\u7269\u4ef6\u5c64\u7d1a\u5c31\u5b8c\u6210\u6240\u6709\u5c0ddb\u7684\u8655\u7406<br \/>\n\u800c\u5728\u958b\u767c\u4e0a\u6700\u5e38\u898b\u7684\u7b2c\u4e00\u6b65\u5c31\u662f\u628a\u6bcf\u4e00\u5217\u8cc7\u6599\u8996\u70ba\u4e00\u500b\u7269\u4ef6\uff0c\u5c07column\u7684\u8cc7\u6599\u4e00\u500b\u4e00\u500b\u5c0d\u61c9\u7684\u585e\u9032\u7269\u4ef6\uff0c\u4e5f\u5c31\u662f\u6700\u5e38\u898b\u7684 <strong>setter and getter<\/strong><br \/>\n<span style=\"color: #ff0000;\">example:<\/span><\/p>\n<pre>Car car = new Car();\r\ncar.setHeight(100);  car.getHeight()\r\ncar.setHeight(100);  car.getHeight()<\/pre>\n<p style=\"padding-left: 30px;\">\u9019\u901a\u5e38\u5c31\u662f\u4e00\u6bb5dirty code\uff0c\u7562\u7adf\u6709\u5e7e\u9805\u53c3\u6578\u5c31\u8981\u5beb\u5e7e\u500b setter and getter<\/p>\n<p style=\"padding-left: 30px;\"><strong>2.3 Create table done for you<\/strong><br \/>\n\u5728Android SQLite\u00a0\u7684\u8a9e\u6cd5\u4e2d\u5275\u9020 table \u662f\u975e\u5e38\u56fa\u5b9a\u7684\u5beb\u6cd5<br \/>\n\u56e0\u6b64\u9806\u4fbf\u5e6b\u5fd9generate \u51fa\u4f86<br \/>\n<span style=\"color: #ff0000;\">example:<\/span><\/p>\n<pre>db.execSQL(\"CREATE TABLE \" + constraint + \"'LeftPage' (\" + \/\/\r\n                \"'DataID' INTEGER PRIMARY KEY ,\" + \/\/ 0: DataID\r\n                \"'Category' TEXT,\" + \/\/ 1: Category\r\n                \"'Provider' TEXT,\" + \/\/ 2: Provider);\r\n<\/pre>\n<p style=\"padding-left: 30px;\"><strong>2.4 Experessing queries<\/strong><br \/>\n\u57282.2\u7684\u4ecb\u7d39\u4e2d\u63d0\u5230\uff0c\u5e0c\u671b\u6240\u6709\u5c0d\u8655db\u7684\u8655\u7406\u90fd\u80fd\u4ee5\u7269\u4ef6\u65b9\u5f0f\u4f86\u5c0d\u61c9<br \/>\n\u9019\u6700\u5927\u7684\u597d\u8655\u5c31\u662f\u53ef\u4ee5\u66f4\u5bb9\u6613\u7684\u4f7f\u7528 query \u529f\u80fd\uff0c\u8a73\u7d30\u7684\u4ecb\u7d39\u53ef\u4ee5\u770b\u4e4b\u5f8cpage<br \/>\n\u4e0d\u904e\u81f3\u5c11\u53ef\u4ee5\u78ba\u4fddquery \u5f8c\u56de\u50b3\u7684\u6771\u897f\u662f\u4f60\u6700\u7fd2\u6163\u7684 list&lt;T&gt; \u3002<\/p>\n<p style=\"padding-left: 30px;\"><strong>3. Session cache<\/strong><br \/>\n\u4e00\u5927\u91cd\u9ede\uff0c\u4f46\u662f\u9019\u6b21\u4e3b\u8981\u662f\u79d1\u666e\u6559\u80b2\uff0c\u4e26\u4e0d\u591a\u8ac7<\/p>\n<h3>page6-7<\/h3>\n<h4 style=\"padding-left: 30px;\">Performance<\/h4>\n<p style=\"padding-left: 30px;\">\u6548\u80fd\u6c38\u9060\u662f\u6700\u91cd\u8981\u7684\u4e00\u74b0\uff0c\u81ea\u5df1\u624b\u52d5\u6e2c\u8a66<br \/>\n<span style=\"color: #0000ff;\">insert and delete 10000 row<\/span><br \/>\n<span style=\"color: #0000ff;\"> load 20000 row<\/span><br \/>\n\u57fa\u672c\u4e0a\u6700\u53ef\u6015\u7684\u5dee\u7570\u5728\u65bc insert \uff0c\u4e0d\u904e\u9019\u662f\u5728\u6c92\u6709 transcation\u7684\u60c5\u6cc1\uff0c\u6709\u9ede\u4e0d\u516c\u5e73<br \/>\n\u4e0d\u904e\u770bload\u7684\u6642\u9593\uff0c\u5c31\u53ef\u4ee5\u767c\u73fe\u5dee\u7570\u5566<br \/>\n\u53e6\u5916\u4e5f\u53ef\u4ee5\u770b\u5927\u5e2b\u8ddf\u5176\u4ed6orm lib \u7684\u6bd4\u8f03<a href=\"https:\/\/github.com\/daj\/android-orm-benchmark\">benchmark<\/a><br \/>\ndelete\u5230\u662f\u6c92\u6709\u5dee\u591a\u5c11<\/p>\n<h3>page 8<\/h3>\n<h4 style=\"padding-left: 30px;\">ORM in greendao<\/h4>\n<p style=\"padding-left: 30px;\"><img decoding=\"async\" src=\"http:\/\/greendao-orm.com\/wordpress\/wp-content\/uploads\/greenDAO-orm-320.png\" alt=\"ORM-GREENDAO\" \/><\/p>\n<p style=\"padding-left: 30px;\"><strong>GreenDao<\/strong><br \/>\n\u6240\u6709\u7684 SQLite database \u7684\u64cd\u4f5c\u5168\u90e8\u90fd\u900f\u904egreendao<br \/>\n\u800c\u8f38\u51fa\u8f38\u5165\u7684\u5c0d\u8c61\u90fd\u662f\u4ee5java object \u70ba\u6a19\u7684\u3002\u9019\u662f\u6700\u5927\u76ee\u7684\u3002<br \/>\n\u5176\u5be6\u985e\u4f3c\u7684\u6771\u897f\u5c31\u662f hibernate\uff0c\u53ea\u4e0d\u904ehibernate \u66f4\u5927\u5c3e<\/p>\n<h3>page 9<\/h3>\n<h4 style=\"padding-left: 30px;\">A example for present<\/h4>\n<p style=\"padding-left: 30px;\">\u5148\u70ba\u4e86\u78ba\u4fdd\u4e4b\u5f8c\u6211\u5728\u4ecb\u7d39\u6642\uff0c\u4ecb\u7d39\u7684\u4f8b\u5b50\u662f\u9023\u8cab\u7684\uff0c\u5148\u4f86\u500b\u57fa\u672c\u5b9a\u7fa9<br \/>\n\u6253\u7b97\u4f5c\u4e00\u500b <span style=\"color: #ff0000;\">social data collector<\/span>\uff0c\u88e1\u9762\u6703\u6536\u96c6\u5404\u7a2e social ap \u7684\u8cc7\u6599<br \/>\n\u5168\u90e8\u90fd\u5b58\u6210 <span style=\"color: #ff0000;\">CommonData<\/span> \u9019\u500b\u7269\u4ef6\uff0c\u88e1\u9762\u5305\u542b\u9019\u4e9b\u6b04\u4f4d<br \/>\n<span style=\"color: #0000ff;\">DataID as primary key<\/span><br \/>\n<span style=\"color: #0000ff;\"> Category \u985e\u5225<\/span><br \/>\n<span style=\"color: #0000ff;\"> Provider \u63d0\u4f9b\u8005 \uff1afacebook, twitter&#8230;<\/span><br \/>\n<span style=\"color: #0000ff;\"> DisplayOrder \u6839\u64dabig data \u5f8c\u7684\u6392\u5e8f\u6b0a\u91cd<\/span><\/p>\n<h3>page 10-15<\/h3>\n<h4 style=\"padding-left: 30px;\">Expressing Queries: What difference<\/h4>\n<p style=\"padding-left: 30px;\"><strong>\u9019\u5e7e\u9801\u90fd\u5728\u8ac7\uff0c\u4f55\u8b02\u7684greendao Expressing Queries \u4ed6\u8207Android \u81ea\u5e36\u7684 content provider \u5dee\u5728\u54ea\u88e1<\/strong><br \/>\n<del datetime=\"2015-10-21T09:21:01+00:00\">content resolver \u771f\u7684\u8d85\u7169<\/del><\/p>\n<p style=\"padding-left: 30px;\">page 10 \u53ea\u662f\u62ffloadAll()\u4f86\u6696\u6696\u5834\uff0c\u7562\u7adf\u62ff\u9019\u500bmethod\u4f86\u6bd4\u4e00\u9ede\u90fd\u4e0d\u5f48\u6027\u5316<\/p>\n<h3>page 11-12<\/h3>\n<p style=\"padding-left: 30px;\">\u6839\u64da\u4e4b\u524d\u7684\u5b9a\u7fa9\uff0c\u5047\u8a2d\u8981\u53bb query \u7b26\u5408\u4ee5\u4e0b\u689d\u4ef6\u7684\u5f0f\u5b50<br \/>\n<span style=\"color: #0000ff;\">Provider equal facebook<\/span><br \/>\n<span style=\"color: #0000ff;\"> Order by display order<\/span><br \/>\n<span style=\"color: #0000ff;\"> Limit data count100<\/span><br \/>\n\u4ee5Android sql \u4f86\u770b\u5c31\u662f<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>String selection = StorageField.Provider. + \"=?\" ;\r\nString[] selectionargs = new String {\u201cfacebook\u201d} ;\r\nString sortorder = \u201c ASC \u201d + StorageField.Displayorder + \u201c LIMIT \u201d + \"100\";\r\nCursor c = getContentResolver() . query (uriLPageProvider , projection  ,  selection, selectionargs, sortorder ) ;\r\n<\/pre>\n<p style=\"padding-left: 30px;\">\u4e5f\u8a31\u4f60\u662f\u500b\u5927\u5e2b\uff0c\u53ef\u4ee5\u5beb\u7684\u66f4\u7c21\u6f54\u4e00\u9ede<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>Select * from leftpage  where Provider = \u2018facebook\u2019 order asc \u2018displayorder\u2019 limit \u2018100\u2019\r\n<\/pre>\n<p style=\"padding-left: 30px;\">\u606d\u559c\u4f60\u5b8c\u6210SQLite\u00a0script<br \/>\n\u4f46\u9084\u6709\u4e00\u95dc\uff1a\u5c31\u662f\u628acursor \u8b8a\u6210 list\uff0c\u5176\u5be6\u9019\u8d85\u82b1\u6642\u9593<br \/>\n<span style=\"color: #0000ff;\"><strong>\u4f46\u662f\u9019\u5728 GreenDao\u88e1\u9762\u5c31\u53ea\u8981<br \/>\n<\/strong><span style=\"color: #ff0000;\">code:<\/span><\/span><\/p>\n<pre>mCommonDataDao.queryBuilder()\r\n   .where(Properties.Provider.eq(Provider.Facebook))\r\n   .orderAsc(Properties.DisplayOrder)\r\n   .limit(100)\r\n   .list();\r\n<\/pre>\n<p style=\"padding-left: 30px;\">\u597d\u5427\uff0c\u9019\u6574\u500b\u8b8a\u5f97\u8d85\u4e7e\u6de8\u53c8\u597d\u61c2\uff0c\u591a\u67d0\u7f8e\u597d\u7684\u4e16\u754c<del datetime=\"2015-10-21T09:21:01+00:00\">\u5beb\u5230\u6709\u9ede\u7d2f\u4e86<\/del><\/p>\n<h3>page 16-17<\/h3>\n<h4 style=\"padding-left: 30px;\">How to getting start?<\/h4>\n<p style=\"padding-left: 30px;\">\u7b2c\u4e00\u6b21\u7e3d\u662f\u6bd4\u8f03\u9ebb\u7169\u4e00\u4e9b<br \/>\n<img decoding=\"async\" src=\"http:\/\/greendao-orm.com\/wordpress\/wp-content\/uploads\/greenDAO-Projects-640.png\" alt=\"\" \/><br \/>\n\u7531\u6b64\u5716\u770b\u4ee5\u770b\u5f97\u51fa\u4f86\uff0c\u4f7f\u7528dao \u5fc5\u9808\u5148\u5275\u9020dao (\u597d\u50cf\u5ee2\u8a71)<br \/>\n\u5efa\u7acb greendao generator project \uff08normal java class\uff09\u53bb\u7522\u751f\uff08code generateion\uff09<br \/>\ndaos \u76f8\u95dc\u6a94\u6848\u5230Android\u00a0project \u4ee5\u4f9b\u4f7f\u7528<\/p>\n<h3>page 18-23<\/h3>\n<h4 style=\"padding-left: 30px;\">Step by step<\/h4>\n<p style=\"padding-left: 30px;\"><strong>Step 1:<\/strong> \u5275\u5efa greendao \u76f8\u95dccode \u5fc5\u9808\u5148\u5728\u4e00\u822cclass\u5beb greendao-generator \u7684code<br \/>\n\u4ee5Android\u00a0studio \u4f86\u770b\u5c31\u662f\u5148\u5275\u5efa module<br \/>\n\u7136\u5f8c gradle script \u52a0\u5165 greendao-generator\u7684\u5f15\u7528<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>compile 'de.greenrobot:greendao-generator:1.3.1<\/pre>\n<p style=\"padding-left: 30px;\"><strong>Step 2:<\/strong> \u63a5\u4e0b\u4f86\u5728 module \u958bnormal class \u540d\u5b50\u96a8\u4fbf\uff0c\u5728\u88e1\u9762\u958b\u59cb\u8a2d\u5b9a\u6709\u95dc db\u7684\u5c6c\u6027\uff08\u6b04\u4f4d\uff0c\u4f4d\u5740&#8230;\uff09<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>public class GreenDao {\r\n    public static void main(String[] args){\r\n        \/\/ \u5275\u5efa\u57fa\u672c schema \u6307\u5b9a version and package\r\n        Schema schema = new Schema(1, \"com.acer.android.leftpage.provider\");\r\n\r\n        \/\/ \u5229\u7528 schema \u958b\u59cb\u8a2d\u5b9a entity, \r\n        \/\/ \u8a2d\u5b9a dao name\r\n        Entity commonData = schema.addEntity(\"CommonData\");\r\n        \/\/ \u8a2d\u5b9a table name\r\n        commonData.setTableName(\"LeftPage\");\r\n        \/\/ \u81f3\u5c11\u6307\u5b9a\u4e00\u500b primary key\r\n        commonData.addLongProperty(\"DataID\").primaryKey();\r\n        \/\/ \u5176\u4ed6 table column name\r\n        commonData.addStringProperty(\"Category\");\r\n        commonData.addStringProperty(\"Provider\");\r\n        commonData.addLongProperty(\u201cDisplayOrder\u201d);\r\n        \/\/ \u8a2d\u5b9a add content provider \u6703\u81ea\u52d5\u9023 content provider \u56fa\u5b9a\u7684code \u7d66\u5efa\u8d77\u4f86\r\n        \/\/ \u5efa\u597d\u4e5f\u4e0d\u80fd\u99ac\u4e0a\u7528\uff0c\u5fc5\u9808\u8ddf\u8005\u4fee\u6539 manifest \u548c \u90e8\u4efdcode\r\n        commonData.addContentProvider();\r\n        \/\/ \u5229\u7528 generator \u6307\u5b9a code generate \u4f4d\u5740 \uff0c\u8ddfpackage \u4e0d\u540c\uff0c\u8acb\u6307\u5b9a\u5408\u6cd5\u5be6\u9ad4\u8def\u5f91\r\n        \/\/ \u901a\u5e38\u5c31\u662f\u5c0d\u61c9\u5230\u4f60\u8981\u4f7f\u7528greendao \u7684 android project path.\r\n        DaoGenerator generator = new DaoGenerator();\r\n        generator.generateAll(schema, \"..\/AcerHome\/LeftPage\/src\/main\/java\/\");}\r\n<\/pre>\n<p style=\"padding-left: 30px;\"><strong>Step 3:<\/strong>\u5b8c\u6210\u5f8c\uff0c\u8acb\u76f4\u63a5 <span style=\"color: #3366ff;\">compile and run to generate code.<\/span><br \/>\n\u901a\u5e38\u5c31\u6703\u5728\u4f60\u6307\u5b9a\u7684\u8def\u5f91\u4e0b\u7522\u751f\u5e95\u4e0b\u56db\u500b\u6a94\u6848<br \/>\n<img decoding=\"async\" src=\"http:\/\/greendao-orm.com\/wordpress\/wp-content\/uploads\/Core-Classes-150.png\" alt=\"core_class\" \/><br \/>\n\u5c0d\u61c9\u5230\u4e0a\u9762\u7684code\u5c31\u662f\u5c31\u662f\u5e95\u4e0b\u9019\u56db\u500bcore class<\/p>\n<p style=\"padding-left: 30px;\"><strong>1. DaoMaster<\/strong><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">\u300eThe entry point for using greenDAO. DaoMaster holds the database object (SQLiteDatabase) and manages DAO classes (not objects) for a specific schema. It has static methods to create the tables or drop them.\u300f<\/span><br \/>\n\u4e3b\u8981\u7ba1\u7406\u5c0d SQLiteDatabase \u7684\u57fa\u672c\u64cd\u4f5c\uff08drop , create, find\uff09\uff0c\u4ee5\u53ca\u5c0d dao \u7684\u64cd\u4f5c<br \/>\n\u4e5f\u662f\u6240\u6709\u5c0d greendao \u7684\u64cd\u4f5c\u7684\u8d77\u59cb\u9ede\u3002<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>package com.acer.android.greendao;\r\n\r\nimport android.content.Context;\r\nimport android.database.sqlite.SQLiteDatabase;\r\nimport android.database.sqlite.SQLiteDatabase.CursorFactory;\r\nimport android.database.sqlite.SQLiteOpenHelper;\r\nimport android.util.Log;\r\n\r\nimport de.greenrobot.dao.AbstractDaoMaster;\r\nimport de.greenrobot.dao.identityscope.IdentityScopeType;\r\n\/\/ \u5f88\u8cbc\u5fc3\u7684\u63d0\u9192\uff0c\u5225\u4e82\u52d5\u963f\r\n\/\/ THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.\r\n\r\n\/**\r\n * Master of DAO (schema version 1): knows all DAOs.\r\n *\/\r\npublic class DaoMaster extends AbstractDaoMaster {\r\n    public static final int SCHEMA_VERSION = 1;\r\n    \/**\r\n     * Creates underlying database table using DAOs.\r\n     *\/\r\n    public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {\r\n        CommonDataDao.createTable(db, ifNotExists);\r\n    }\r\n    \/**\r\n     * Drops underlying database table using DAOs.\r\n     *\/\r\n    public static void dropAllTables(SQLiteDatabase db, boolean ifExists) {\r\n        CommonDataDao.dropTable(db, ifExists);\r\n    }\r\n    public static abstract class OpenHelper extends SQLiteOpenHelper {\r\n        public OpenHelper(Context context, String name, CursorFactory factory) {\r\n            super(context, name, factory, SCHEMA_VERSION);\r\n        }\r\n        @Override\r\n        public void onCreate(SQLiteDatabase db) {\r\n            Log.i(\"greenDAO\", \"Creating tables for schema version \" + SCHEMA_VERSION);\r\n            createAllTables(db, false);\r\n        }\r\n    }\r\n    \/**\r\n     * WARNING: Drops all table on Upgrade! Use only during development.\r\n     *\/\r\n    public static class DevOpenHelper extends OpenHelper {\r\n        public DevOpenHelper(Context context, String name, CursorFactory factory) {\r\n            super(context, name, factory);\r\n        }\r\n        @Override\r\n        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\r\n            Log.i(\"greenDAO\", \"Upgrading schema from version \" + oldVersion + \" to \" + newVersion + \" by dropping all tables\");\r\n            dropAllTables(db, true);\r\n            onCreate(db);\r\n        }\r\n    }\r\n    public DaoMaster(SQLiteDatabase db) {\r\n        super(db, SCHEMA_VERSION);\r\n        registerDaoClass(CommonDataDao.class);\r\n    }\r\n    public DaoSession newSession() {\r\n        return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);\r\n    }\r\n    public DaoSession newSession(IdentityScopeType type) {\r\n        return new DaoSession(db, type, daoConfigMap);\r\n    }\r\n\r\n}\r\n\r\n<\/pre>\n<p style=\"padding-left: 30px;\"><strong>2. DaoSession<\/strong><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #0000ff;\">\u300eManages all available DAO objects for a specific schema, which you can acquire using one of the getter methods. DaoSession provides also some generic persistence methods like insert, load, update, refresh and delete for entities. Lastly, a DaoSession objects also keeps track of an identity scope.\u300f<\/span><br \/>\n\u5229\u7528 DaoMaster \u53ef\u4ee5\u62ff\u5230 DaoSession<br \/>\nDaoSession \u4e3b\u8981\u63d0\u4f9b\u6700\u5e38\u898b\u7684 CRUD \u65b9\u6cd5\uff0c\u4e26\u5c0didentity scope\u4f5ccache \u8ddf\u8e64<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>package com.acer.android.greendao;\r\nimport android.database.sqlite.SQLiteDatabase;\r\nimport java.util.Map;\r\nimport de.greenrobot.dao.AbstractDao;\r\nimport de.greenrobot.dao.AbstractDaoSession;\r\nimport de.greenrobot.dao.identityscope.IdentityScopeType;\r\nimport de.greenrobot.dao.internal.DaoConfig;\r\n\r\nimport com.acer.android.leftpage.greendao.CommonData;\r\n\r\n\/\/ THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.\r\n\r\n\/**\r\n * {@inheritDoc}\r\n *\r\n * @see de.greenrobot.dao.AbstractDaoSession\r\n *\/\r\npublic class DaoSession extends AbstractDaoSession {\r\n    private final DaoConfig commonDataDaoConfig;\r\n    private final CommonDataDao commonDataDao;\r\n    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map&lt;Class&lt;? extends AbstractDao<!--?,?-->&gt;, DaoConfig&gt;\r\n            daoConfigMap) {\r\n        super(db);\r\n        commonDataDaoConfig = daoConfigMap.get(CommonDataDao.class).clone();\r\n        commonDataDaoConfig.initIdentityScope(type);\r\n        commonDataDao = new CommonDataDao(commonDataDaoConfig, this);\r\n        registerDao(CommonData.class, commonDataDao);\r\n    }\r\n    public void clear() {\r\n        commonDataDaoConfig.getIdentityScope().clear();\r\n    }\r\n    public CommonDataDao getCommonDataDao() {\r\n        return commonDataDao;\r\n    }\r\n}\r\n\r\n<\/pre>\n<p style=\"padding-left: 30px;\"><strong>3. CommonDataDao<\/strong><br \/>\n<span style=\"color: #0000ff;\">\u300eData access objects (DAOs) persists and queries for entities. For each entity, greenDAO generates a DAO. It has more persistence methods than the DaoSession, for example: count, loadAll, and insertInTx.\u300f<\/span><br \/>\ndaos \u63d0\u4f9b\u66f4\u591a\u66f4\u7cbe\u7d30\u7684\u64cd\u4f5c\uff08count, loadAll, and insertInTx\uff09\u5728 daosession \u7684base \u4e0a<br \/>\n\uff0c\u800c\u6211\u5011\u64cd\u4f5c\u7684\u8d77\u9ede\u901a\u5e38\u5c31\u662f\u62ff\u500bcommondao \u4f86\u9032\u884c crud\uff0c \u76f8\u8f03\u4e4b\u4e0b\u5565 session , master\u53cd\u800c\u9084\u6c92\u5565\u518d\u7528\u3002<br \/>\ncode \u90e8\u4efd\u4e3b\u8981\u5206\u62103\u584a<br \/>\n<strong>3.1. \u63d0\u4f9b static class: Properties \u7528\u4f86\u5e6b\u52a9\u5c0dcolumn \u7684 reference<br \/>\n<\/strong><span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>\/**\r\n     * Properties of entity CommonData.\r\n     * Can be used for QueryBuilder and for referencing column names.\r\n     *\/\r\n    public static class Properties {\r\n        public final static Property DataID = new Property(0, Long.class, \"DataID\", true, \"DataID\");\r\n        public final static Property Category = new Property(1, String.class, \"Category\", false, \"Category\");\r\n        public final static Property Provider = new Property(2, String.class, \"Provider\", false, \"Provider\");\r\n        public final static Property DisplayOrder = new Property(3, Integer.class, \"DisplayOrder\", false, \"DisplayOrder\");\r\n        \/\/ ...... \u9084\u6709\u5f88\u591a\u5f88\u591a\r\n    }<\/pre>\n<p style=\"padding-left: 30px;\"><strong>3.2. create table : \u4e4b\u524d\u6709\u63d0\u904e\u4e86\uff0c\u9019\u7a2e\u56fa\u5b9a\u6232\u78bc\u7684\u6771\u897f\u7576\u7136\u662f\u81ea\u52d5generate<br \/>\n<\/strong><span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\r\n        String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\r\n        db.execSQL(\"CREATE TABLE \" + constraint + \"'LeftPage' (\" + \/\/\r\n                \"'DataID' INTEGER PRIMARY KEY ,\" + \/\/ 0: DataID\r\n                \"'Category' TEXT,\" + \/\/ 1: Category\r\n                \"'Provider' TEXT,\" + \/\/ 2: Provider\r\n                \"'DisplayOrder' INTEGER \uff09\"); + \/\/ 3: DisplayOrder\r\n        }\r\n\r\n<\/pre>\n<p style=\"padding-left: 30px;\"><strong>3.3. bindvalue : \u5c31\u662f object to cursor or cursor to object.<\/strong><br \/>\n<span style=\"color: #ff0000;\">\u4e0d\u4e0acode<\/span><\/p>\n<p style=\"padding-left: 30px;\"><strong>4. CommonData<\/strong><br \/>\n<span style=\"color: #0000ff;\">\u300ePersistable objects. Usually, entities are generated (you do not have to), and are objects representing a database row using standard Java properties (like a POJO or a JavaBean).\u300f<\/span><br \/>\n\u9019\u88e1\u5c31\u662f\u5927\u91cf\u7684 setter and getter\uff0c\u9019\u7a2edirty code \u7576\u7136\u662f auto generate\u963f<\/p>\n<h3>page 23<\/h3>\n<p style=\"padding-left: 30px;\"><strong>Step 4:\u00a0<\/strong>\u76ee\u524dgenerate \u51fa\u4f86\u7684\u6a94\u6848\u5728\u4f60\u7684android project \u88e1\u9762<br \/>\n\u4f46\u662f\u61c9\u8a72\u9084\u662f\u4e0d\u80fd\u7528\uff0c\u56e0\u70ba\u5f88\u591a\u5947\u5999\u7684 class \u537b\u5f15\u7528\u4e0d\u5230<br \/>\n\u56e0\u6b64\u8acb\u5728 project gradle \u52a0\u5165<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>compile 'de.greenrobot:greendao:1.3.7'\r\n<\/pre>\n<h3>page 24-25<\/h3>\n<h4 style=\"padding-left: 30px;\">HOW TO USE<\/h4>\n<p style=\"padding-left: 30px;\">\u7d42\u65bc\u53ef\u4ee5\u958b\u59cb\u4f7f\u7528\u5566\uff0c\u53ea\u8981\u8a18\u4f4f\u6709\u5565\u4e8b\u5c31\u76f4\u63a5\u627e CommonDao \u4f86\u8655\u7406\uff0c\u4e00\u5207\u6c92\u554f\u984c<br \/>\ninitial \u65b9\u5f0f\u5982\u4e0b<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>private static final String DB_NAME =  \u201cLeftpageProvider.db\";\r\nprivate DaoSession daoSession;\r\nCommonDataDao mCommonDataDao\r\nprivate DBHelper(Context context) {\r\n     \/\/ \u76f4\u63a5\u6307\u5b9adb name \uff0c\u9019\u6bd4\u8f03\u5c11\u898b\r\n    DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, DB_NAME, null);\r\n    DaoMaster daoMaster = new DaoMaster(helper.getWritableDatabase());\r\n    daoSession = daoMaster.newSession();\r\n    mCommonDataDao= daoSession.getCommonDataDao();\r\n}\r\n<\/pre>\n<h3>page 26-27<\/h3>\n<h4 style=\"padding-left: 30px;\">Query<\/h4>\n<p style=\"padding-left: 30px;\">\u8001\u5be6\u8aaa\u6211\u4e0d\u77e5\u9053\u9084\u6709\u5565\u9700\u8981\u8b1b\u89e3\uff0c\u9019\u662f\u6700\u57fa\u672c\u7528\u6cd5<br \/>\n\u4e5f\u591a\u4e86\u4e0d\u5c11\u5728 content resolver \u4e0d\u592a\u6703\u7528\u5230\u7684\u5beb\u6cd5,\u4f46\u5728sql \u5f88\u5e38\u7528\u5230\u7684\u6558\u8ff0\u53e5<br \/>\n<strong>Query with syntax<\/strong><br \/>\n\u76f8\u540c\uff1aeq , notEq<br \/>\n\u5927\u65bc\u5c0f\u65bc\uff1age , le , gt , lt<br \/>\nother:in , between,like&#8230;..<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>\/\/ \u5148\u505a\u51faqueryBuilder \u5f8c\uff0c\u958b\u59cb\u586b\u689d\u4ef6\u5f0f\r\nList dataList = CommonDataDao.queryBuilder()\r\n   .where(Properties.Provider.eq(Provider.Social))\r\n   .orderAsc(mCommonDataDao.Properties.DisplayOrder) .list();\r\n<\/pre>\n<p style=\"padding-left: 30px;\">\u5982\u679c\u9084\u662f\u5f88\u7737\u6200 cursor and SQLitedatabase<br \/>\n\u5e6b\u4f60\u4fdd\u7559 raw query<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>SQLiteDatabase db = daoSession.getDatabase();\r\nCursor cursor = db.rawQuery(\"SELECT *FROM leftpage WHERE .....\", null);\r\n<\/pre>\n<h3>page 28<\/h3>\n<h4 style=\"padding-left: 30px;\">Insert<\/h4>\n<p style=\"padding-left: 30px;\">\u57fa\u672c\u7528\u6cd5\u5982\u4e0b\uff0c\u53e6\u5916\u60f3\u8981\u591a\u591a\u5ba3\u5c0e\uff0c\u585e\u5927\u91cf\u8cc7\u6599\u6642\u8acb\u5584\u7528 bulk insert \u4ee5\u6539\u5584\u6548\u7387\uff5e\uff5e\u8b1d\u8b1d<br \/>\nSQLitedatabase \u5c31\u662f\u8acbblock \u5f8c\u5728\u585e\u5927\u91cf\u8cc7\u6599<br \/>\n\u53e6\u5916\u5c0f\u5c0f\u63d0\u9192\uff0cprimary key \u8acb\u4fdd\u6301\u70banull \uff0c\u7531\u7cfb\u7d71\u5e6b\u4f60\u586b\u503c\uff08\u6211\u77e5\u9053\u9019\u662f\u5e38\u8b58\uff0c\u4f46\u662f\u7e3d\u6709\u5c0f\u5925\u4f34..\uff09<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>\/\/Insert:\r\n    CommonDataDao .insert(new CommonData(DATA_ID, arg1, arg2,x\u2026\u2026));\r\n\/\/Bulk Insert \r\n    CommonDataDao .insertln(CommonDataList);\r\n    CommonDataDao.insertln(CommonData[]);\r\n\/\/InsetOrReplace\r\n    CommonDataDao.insertOrReplaceln(CommonDataList)\r\n<\/pre>\n<h3>page 29<\/h3>\n<h4 style=\"padding-left: 30px;\">Delete<\/h4>\n<p style=\"padding-left: 30px;\">\u57fa\u672c\u7528\u6cd5\u5982\u4e0b<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>\/\/ Delete sentence\r\n\/\/ \u8ddfquery\u4e00\u6a23\uff0c\u5148\u5229\u7528 QueryBuilder \u628a\u689d\u4ef6\u5f0f\u7d66\u5217\u51fa\u4f86\uff0c\u4f46\u662f\u6700\u5f8c\u904b\u884c\u7684\u65b9\u6cd5\u4e8b\u6839\u64da\u689d\u4ef6\u5f0f\r\n\/\/ \u904b\u884c delete command\r\nCommonDataDao.QueryBuilder()\r\n  .where(Properties.Provider.eq(facebook))\r\n  .buildDelete()  .executeDeleteWithoutDetachingEntities();\r\n\/\/ Delete all\r\nCommonDataDao.deleteAll();<\/pre>\n<h3>page 30<\/h3>\n<h4 style=\"padding-left: 30px;\">Update<\/h4>\n<p style=\"padding-left: 30px;\">\u8a72\u6ce8\u610f\u7684\u9ede\u57fa\u672c\u4e0a\u8ddfinsert \u4e00\u6a23<br \/>\n\u5c31\u662f \u62dc\u8a17\u5584\u7528 bulk update \uff0c\u9084\u6709\u641e\u6e05\u695a primary key \u7684\u7528\u9014\u53ca\u610f\u7fa9<br \/>\n<span style=\"color: #ff0000;\">code:<\/span><\/p>\n<pre>\/\/ Update sentence\r\nCommonDataDao.update(new CommonData(Data_ID , arg1 , arg2 , \u2026\u2026.));\r\n\/\/ Bulk Update \r\nCommonDataDao.updateln(CommonDataList);\r\nCommonDataDao.updateln(CommonData[]);\r\n<\/pre>\n<h3>page 31<\/h3>\n<h4 style=\"padding-left: 30px;\">Thanks<\/h4>\n<p style=\"padding-left: 30px;\">Reference:<br \/>\n<a href=\"http:\/\/greendao-orm.com\/features\/\">http:\/\/greendao-orm.com\/features\/<\/a><\/p>\n<p style=\"padding-left: 30px;\"><a href=\"http:\/\/bng86.gitbooks.io\/android-third-party-\/content\/greendao.html\">http:\/\/bng86.gitbooks.io\/android-third-party-\/content\/greendao.html<\/a><\/p>\n<p style=\"padding-left: 30px;\"><a href=\"http:\/\/www.slideshare.net\/SmileeYang\/greendao-43892958?qid=b95e0f35-a323-4930-8e8a-d0e298a1eb10&amp;v=qf1&amp;b=&amp;from_search=1\">http:\/\/www.slideshare.net\/SmileeYang\/greendao-43892958?qid=b95e0f35-a323-4930-8e8a-d0e298a1eb10&amp;v=qf1&amp;b=&amp;from_search=1<\/a><\/p>\n<p style=\"padding-left: 30px;\"><a href=\"http:\/\/www.slideshare.net\/ssuser8674c1\/green-dao-50914708?qid=b95e0f35-a323-4930-8e8a-d0e298a1eb10&amp;v=qf1&amp;b=&amp;from_search=5\">http:\/\/www.slideshare.net\/ssuser8674c1\/green-dao-50914708?qid=b95e0f35-a323-4930-8e8a-d0e298a1eb10&amp;v=qf1&amp;b=&amp;from_search=5<\/a><\/p>\n<h3>page 32<\/h3>\n<h4 style=\"padding-left: 30px;\">\u5176\u5be6\u9019\u662f\u500b\u5951\u5b50<br \/>\ngreendao \u4e0d\u53ea\u6709\u4e0a\u8ff0\u9019\u6a23\u57fa\u672c\u7684\u529f\u80fd\uff0c<del datetime=\"2015-10-22T09:22:49+00:00\">\u9084\u6709\u5f88\u591a\u5f88\u5f37\u4f46\u662f\u6211\u770b\u4e0d\u61c2\u7684\u6771\u897f<\/del><br \/>\n\u9084\u6709\u5f88\u591a\u66f4\u52a0\u9032\u968e\u7684\u529f\u80fd\uff0c\u5982\u679c\u9084\u6709\u4e0b\u4e00\u7ae0\u7bc0\u7684\u8a71\uff0c\u6703\u958b\u59cb\u4ecb\u7d39\u5176\u4ed6\u6211\u5728\u958b\u767c\u4e0a\u5c0e\u5165\u7684\u554f\u984c<\/h4>\n<p style=\"padding-left: 30px;\">\u8b1d\u8b1d\u89c0\u8cde \u9577\u6587\u79d1\u666e\u4e00\u7bc7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GreenDao Introduction \u300egreenDAO is an open source project to help Android developers working with da&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,23,52],"tags":[6,53,9,15,24],"_links":{"self":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/85"}],"collection":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":1,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":93,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions\/93"}],"wp:attachment":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}