Changeset 6004 for DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/NotebookDao.java
- Timestamp:
- 02/20/15 15:17:07 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/NotebookDao.java
r4834 r6004 43 43 **/ 44 44 45 /** 46 * 47 * @param notebookID the internal ID of a notebook. 48 * @return the internal database Id of the owner of the notebook. 49 */ 45 50 Number getOwner(Number notebookID); 46 51 47 52 48 53 /** 54 * 55 * @param principalID the internal database id of some principal. 56 * @param acessMode {@link Access} object, representing one of the access modes: 57 * "all", "write", "read" or "none". 58 * @return the list of internal database id's of the notebooks for which "principalID" has ""accessMode" access. 59 */ 49 60 List<Number> getNotebookIDs(Number principalID, Access acessMode); 50 61 51 // Returns a list of notebook Ids for the notebooks for which the given principal "principalID" is the owner. 62 /** 63 * @param principaID the internal database id of some principal. 64 * @return the list of internal database id's of the notebooks for which "principalID" is the owner. 65 */ 52 66 List<Number> getNotebookIDsOwnedBy(Number principaID); 53 67 … … 56 70 /** 57 71 * 58 * @param notebookID 59 * @return the notebook info for the notebook with notebookID 72 * @param notebookID the internal database id of a notebook. 73 * @return the {@link NotebookInfo} object built for the notebook with notebookID upon the corresponding row 74 * in the "notebook" table. 60 75 */ 61 76 NotebookInfo getNotebookInfoWithoutOwner(Number notebookID); … … 64 79 /** 65 80 * 66 * @param notebookID 67 * @return notebook metadata for the notebook with notebookID 81 * @param notebookID the internal database id of a notebook. 82 * @return the {@link Notebook} object built for the notebook with notebookID upon the corresponding row 83 * in the "notebook" table. 68 84 */ 69 85 Notebook getNotebookWithoutAnnotationsAndAccesssAndOwner(Number notebookID); … … 81 97 82 98 83 /** 84 * 85 * @param notebookID 86 * @return true if updated, false otherwise. Logs the reason if the notebook is not updated. 99 100 /** 101 * 102 * @param notebookID the internal database id of a notebook. 103 * @param title a new title for the notebook. 104 * @param ownerID the internal database id of the owner principal of the notebook. 105 * @return true if the title "notebookID" is updated to "title", false otherwise. 87 106 */ 88 107 boolean updateNotebookMetadata(Number notebookID, String title, Number ownerID); 89 108 109 110 /** 111 * 112 * @param notebookID the internal database id of a notebook. 113 * @param ownerID the internal database id of a new owner for the notebook. 114 * @return true if the owner_id is in "notebook" table is updated to "ownerID", false otherwise. 115 */ 90 116 boolean setOwner(Number notebookID, Number ownerID); 91 117 118 /** 119 * 120 * @param notebookID the internal database id of a notebook. 121 * @param principalID the internal database id of a principal. 122 * @param access an {@link Access} object. 123 * @return true iff the access mode to "notebookID" for "principalID" has been assigned to "access"'s value. 124 */ 92 125 boolean updatePrincipalAccessForNotebook(Number notebookID, Number principalID, Access access); 93 126 … … 99 132 */ 100 133 134 /** 135 * 136 * @param notebook the {@link Notebook} object representing a notebook to be created in the database. 137 * @param ownerID the internal database id of the owner principal. 138 * @return the internal id of the created notebook. 139 * @throws NotInDataBaseException if creation the notebook fails. 140 */ 101 141 public Number createNotebookWithoutAccesssAndAnnotations(Notebook notebook, Number ownerID) throws NotInDataBaseException; 102 142 143 /** 144 * 145 * @param notebookID the internal database ID of a notebook. 146 * @param annotationID the internal database ID of an annotation. 147 * @return true if the row for the (ntebookID,annotationID) has been added to the junction table 148 * "notebooks_annotations". 149 */ 103 150 boolean addAnnotationToNotebook(Number notebookID, Number annotationID); 104 151 152 /** 153 * 154 * @param notebookID the internal database ID of a notebook. 155 * @param principalID the internal database ID of a principal. 156 * @param access access an {@link Access} object. 157 * @return true iff the "access" mode to "notebookID" has been assigned for "principalID" 158 * in the corresponding junction table. 159 */ 105 160 boolean addAccessToNotebook(Number notebookID, Number principalID, Access access); 106 161 … … 114 169 */ 115 170 171 /** 172 * 173 * @param notebookID the internal database ID of a notebook. 174 * @param annotationID annotationID the internal database ID of an annotation. 175 * @return true iff the row for the (notebookID,annotationID) has been deleted from the junction table 176 * "notebooks_annotations". 177 */ 116 178 boolean deleteAnnotationFromNotebook(Number notebookID, Number annotationID); 117 179 180 /** 181 * 182 * @param notebookID the internal database ID of a notebook. 183 * @return true iff all the rows with "notebookID" have been removed from "notebooks_annotations" table. 184 */ 118 185 boolean deleteAllAnnotationsFromNotebook(Number notebookID); 119 186 187 /** 188 * 189 * @param notebookID the internal database ID of a notebook. 190 * @param principalID the internal database ID of a principal. 191 * @return true iff the row for the pair (notebookID, principlaID) has been removed from the "notebooks_principals_accesses" table. 192 */ 120 193 boolean deleteNotebookPrincipalAccess(Number notebookID, Number principalID); 121 194 195 /** 196 * 197 * @param notebookID the internal database ID of a notebook. 198 * @return true iff all the rows with "notebookID" have been removed from from the "notebooks_principals_accesses" table. 199 */ 122 200 boolean deleteAllAccesssForNotebook(Number notebookID); 123 201 202 /** 203 * 204 * @param notebookID the internal database ID of a notebook. 205 * @return true iff the notebook with "notebookID" has been removed from the "notebook" table. 206 */ 124 207 boolean deleteNotebook(Number notebookID); 125 208 }
Note: See TracChangeset
for help on using the changeset viewer.