Ignore:
Timestamp:
08/18/13 16:21:58 (11 years ago)
Author:
olhsha
Message:

refactored DAO-s tests are added, but not all working yet. Also: add 8 more tests to dispatcher class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/AnnotationDao.java

    r3407 r3408  
    2121import eu.dasish.annotation.schema.Annotation;
    2222import eu.dasish.annotation.schema.AnnotationInfo;
     23import eu.dasish.annotation.schema.Permission;
    2324import eu.dasish.annotation.schema.ResourceREF;
     25import eu.dasish.annotation.schema.UserWithPermission;
    2426import java.sql.SQLException;
    2527import java.sql.Timestamp;
     
    5052     * @param annotationID
    5153     * @return the Annotation object with empty list of sources
    52      * constructing a complete Annotation object from theresult and "retrieveSourceIDs" is done in "CompoundRequests"
     54     * constructing a complete Annotation object from there sult and "retrieveSourceIDs" is done in "DaoDispatchter"
    5355     *
    5456     */
     
    5961     *
    6062     * @param annotationId
    61      * @return
    62      * result[0] = # removed "annotations_principals_perissions" rows
    63      * result[1] = # removed "annotatiobs_target_sources" rows
    64      * result[2] = # removed annotation rows (should be 1)
     63     * @return removed annotation rows (should be 1)
    6564     */
    6665   
    67     public int[] deleteAnnotation(Number annotationId) throws SQLException;
     66    public int deleteAnnotation(Number annotationId) throws SQLException;
    6867   
     68    /**
     69     *
     70     * @param annotationId
     71     * @return # removed annotation_source rows for given annotationID
     72     */
     73   
     74    public int deleteAllAnnotationSource(Number annotationId) throws SQLException;
    6975   
    7076   
     
    131137    public int addAnnotationSourcePair(Number annotationID, Number sourceID) throws SQLException;
    132138   
     139    public int deleteAnnotationPrincipalPermissions(Number annotationID) throws SQLException ;
     140
     141    /**
     142     *
     143     * @param annotationID
     144     * @param userID
     145     * @param permission
     146     * @return the amount of rows added to the table annotations_principals_permissions
     147     */
     148    public int addAnnotationPrincipalPermission(Number annotationID, Number userID, Permission permission) throws SQLException;
     149   
     150       /**
     151     *
     152     * @param annotationId
     153     * @return retrieves all the pairs (user-permission) for "annotationId" from the table annotations_principals permissions
     154     */
     155    public List<Map<Number, String>>  retrievePermissions(Number annotationId);
     156   
    133157}
Note: See TracChangeset for help on using the changeset viewer.