OSDN Git Service

Resync Linked & shared notebook tables.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / SharedNotebookTable.java
index 755c73e..d14e34d 100644 (file)
@@ -70,19 +70,11 @@ public class SharedNotebookTable {
                SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");\r
         NSqlQuery query = new NSqlQuery(db.getConnection());\r
                check = query.prepare("Insert Into SharedNotebook (id, userid, notebookGuid, email,  "\r
-<<<<<<< HEAD
                                +"notebookModifiable, requireLogin, serviceCreated, shareKey, username, isDirty) "   \r
                                + " Values("\r
                                +":id, :userid, :notebookGuid, :email, "\r
                                +":notebookModifiable, :requireLogin, :serviceCreated, "\r
                                +":shareKey, :username, :isDirty)");\r
-=======
-                               +"notebookModifiable, requireLogin, serviceCreated, shareKey, username) "   \r
-                               + " Values("\r
-                               +":id, :userid, :notebookGuid, :email, "\r
-                               +":notebookModifiable, :requireLogin, :serviceCreated, "\r
-                               +":shareKey, :username)");\r
->>>>>>> Add linked & shared notebook tables
                query.bindValue(":id", tempNotebook.getId());\r
                query.bindValue(":userid", tempNotebook.getUserId());\r
                query.bindValue(":notebookGuid", tempNotebook.getNotebookGuid());\r
@@ -107,7 +99,6 @@ public class SharedNotebookTable {
                        logger.log(logger.MEDIUM, query.lastError().toString());\r
                }\r
        }\r
-<<<<<<< HEAD
        // Check if a notebook exists\r
        public boolean exists(long id) {\r
         NSqlQuery query = new NSqlQuery(db.getConnection());\r
@@ -123,9 +114,6 @@ public class SharedNotebookTable {
                return false;\r
        }\r
        // Delete the notebook based on a id\r
-=======
-       // Delete the notebook based on a guid\r
->>>>>>> Add linked & shared notebook tables
        public void expungeNotebook(long id, boolean needsSync) {\r
                boolean check;\r
         NSqlQuery query = new NSqlQuery(db.getConnection());\r
@@ -147,7 +135,6 @@ public class SharedNotebookTable {
                        deletedTable.addDeletedItem(new Long(id).toString(), "SharedNotebook");\r
                }\r
        }\r
-<<<<<<< HEAD
        // Delete the notebook based on a id\r
        public void expungeNotebookByGuid(String id, boolean needsSync) {\r
                boolean check;\r
@@ -186,17 +173,6 @@ public class SharedNotebookTable {
         NSqlQuery query = new NSqlQuery(db.getConnection());\r
                check = query.prepare("Update SharedNotebook set id=:id, userid=:userid, notebookGuid=:notebook, "\r
                                + "email=:email, notebookModifiable=:mod, requireLogin=:rlogin, serviceCreated=:serviceCreated, "\r
-=======
-       // Update a notebook\r
-       public void updateNotebook(SharedNotebook tempNotebook, boolean isDirty) {\r
-               boolean check;\r
-               \r
-               SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");\r
-               \r
-        NSqlQuery query = new NSqlQuery(db.getConnection());\r
-               check = query.prepare("Update SharedNotebook set id=:id, userid=:userid, notebookGuid=:notebook, "\r
-                               + "email=:email, notebookModifiable=:mod, requireLogin=:rlogin, serviceCreated=:created "\r
->>>>>>> Add linked & shared notebook tables
                                + "shareKey=:shareKey, username=:username, isDirty=:isdirty");\r
                query.bindValue(":id", tempNotebook.getId());\r
                query.bindValue(":userid", tempNotebook.getUserId());\r
@@ -204,17 +180,9 @@ public class SharedNotebookTable {
                query.bindValue(":email", tempNotebook.getEmail());\r
                query.bindValue(":mod", tempNotebook.isNotebookModifiable());\r
                query.bindValue(":rlogin", tempNotebook.isRequireLogin());\r
-<<<<<<< HEAD
                query.bindValue(":serviceCreated", serviceCreated.toString());\r
                query.bindValue(":shareKey", tempNotebook.getShareKey());\r
                query.bindValue(":username", tempNotebook.getUsername());\r
-=======
-               query.bindValue(":shareKey", tempNotebook.getShareKey());\r
-               query.bindValue(":username", tempNotebook.getUsername());\r
-\r
-               StringBuilder serviceCreated = new StringBuilder(simple.format(tempNotebook.getServiceCreated()));                                              \r
-               query.bindValue(":serviceCreated", serviceCreated.toString());\r
->>>>>>> Add linked & shared notebook tables
                \r
                query.bindValue(":isDirty", isDirty);\r
                \r
@@ -262,7 +230,6 @@ public class SharedNotebookTable {
                return index;\r
        }                       \r
 \r
-<<<<<<< HEAD
        // Load notebooks from the database\r
        public List<SharedNotebook> getForNotebook(String guid) {\r
                SharedNotebook tempNotebook;\r
@@ -322,23 +289,5 @@ public class SharedNotebookTable {
                return index;   \r
        }\r
 \r
-=======
-       // does a record exist?\r
-       public String findNotebookByName(String newname) {\r
-               \r
-               NSqlQuery query = new NSqlQuery(db.getConnection());\r
-               \r
-               query.prepare("Select guid from sharednotebook where name=:newname");\r
-               query.bindValue(":newname", newname);\r
-               if (!query.exec())\r
-                       logger.log(logger.EXTREME, "notebook SQL retrieve has failed.");\r
-               String val = null;\r
-               if (query.next())\r
-                       val = query.valueString(0);\r
-               return val;\r
-       }\r
-\r
-\r
->>>>>>> Add linked & shared notebook tables
 }\r
 \r