if (!exists(tempNotebook.getGuid())) {
addNotebook(tempNotebook, isDirty);
return;
}
NSqlQuery query = new NSqlQuery(db.getConnection());
check = query.prepare("Update LinkedNotebook set guid=:guid, shareName=:shareName, " +
"username=:username, shardID=:shardID, uri=:uri, updateSequenceNumber=:usn, isDirty=:isDirty "+
"where guid=:keyGuid");
query.bindValue(":guid", tempNotebook.getGuid());
query.bindValue(":keyGuid", tempNotebook.getGuid());
query.bindValue(":shareName", tempNotebook.getShareName());
query.bindValue(":username", tempNotebook.getUsername());
query.bindValue(":shardID", tempNotebook.getShardId());
query.bindValue(":shareKey", tempNotebook.getShareKey());
query.bindValue(":uri", tempNotebook.getUri());
query.bindValue(":usn", tempNotebook.getUpdateSequenceNum());
query.bindValue(":isDirty", isDirty);
check = query.exec();
if (!check) {
logger.log(logger.MEDIUM, "LinkedNotebook Table update failed.");
logger.log(logger.MEDIUM, query.lastError().toString());
}
}