Changeset 7617


Ignore:
Timestamp:
Mar 4, 2019, 7:45:29 AM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2149: Batch item importers should be able to use an annotation for item identification

The batch importers now only select annotation types with the 'identifier' flag set.

Location:
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r7605 r7617  
    998998     * The value type must be one of STRING, INT or LONG
    999999     * It must not be an enumeration
     1000     * The 'identifier' flag must be set
    10001001   
    10011002    @since 3.15
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AnnotationIdMethod.java

    r7593 r7617  
    5959     * The value type must be one of STRING, INT or LONG
    6060     * It must not be an enumeration
     61     * The 'identifier' flag must be set
    6162    @param itemType Either a specified item or null to return all possible annotation id methods
    6263  */
     
    6465  {
    6566    ItemQuery<AnnotationType> query = AnnotationType.getQuery(itemType);
    66     query.include(Include.MINE, Include.IN_PROJECT, Include.SHARED);
     67    query.include(Include.MINE, Include.IN_PROJECT, Include.SHARED, Include.OTHERS);
    6768    // The annotation type must be STRING, INTEGER or LONG
    6869    query.restrict(Restrictions.in(Hql.property("valueType"), Expressions.parameter("valueTypes", Type.INT)));
     
    7071    // Enumerations can't be used
    7172    query.restrict(Restrictions.eq(Hql.property("enumeration"), Expressions.bool(false)));
    72    
     73    // The 'identifier' flag must be set
     74    query.restrict(Restrictions.eq(Hql.property("identifier"), Expressions.bool(true)));
    7375    query.order(Orders.asc(Hql.property("name")));
    7476    // Get a list of possible annotation types
Note: See TracChangeset for help on using the changeset viewer.