OSDN Git Service

ローカル添付ファイルもApache Luceneを使った全文検索の対象に追加。
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / NoteResourceTable.java
index 99746c6..d5507aa 100644 (file)
@@ -675,5 +675,27 @@ public class NoteResourceTable  {
                NSqlQuery query = new NSqlQuery(db.getResourceConnection());\r
                query.exec("update noteresources set isdirty=false");\r
        }\r
+       \r
+       // リソーステキストを更新\r
+       public void updateResourceText(String guid, String text) {\r
+               logger.log(logger.HIGH, "Entering NoteResourceTable.updateResourceText");\r
+               NSqlQuery query = new NSqlQuery(db.getResourceConnection());\r
+               boolean check = query.prepare("Update noteResources set resourceText=:resourceText where guid=:guid");\r
+               if (!check) {\r
+                       logger.log(logger.EXTREME, "Update resourceText sql prepare has failed.");\r
+                       logger.log(logger.MEDIUM, query.lastError());\r
+               }\r
+               \r
+               query.bindValue(":resourceText", text);\r
+               query.bindValue(":guid", guid);\r
+               \r
+               check = query.exec();\r
+               if (!check) {\r
+                       logger.log(logger.EXTREME, "Update resourceText has failed.");\r
+                       logger.log(logger.MEDIUM, query.lastError());\r
+               }\r
+               logger.log(logger.HIGH, "Leaving NoteResourceTable.updateResourceText");\r
+               query.exec();\r
+       }\r
 }\r
 \r