Changeset 7615
- Timestamp:
- Mar 1, 2019, 2:19:42 PM (5 years ago)
- Location:
- trunk/src/core/net/sf/basedb/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/AnnotationType.java
r7610 r7615 1033 1033 getData().setProjectAnnotations(projectAnnotations); 1034 1034 } 1035 1036 /** 1037 @see #isIdentifier() 1038 @since 3.15 1039 */ 1040 public void setIdentifier(boolean isIdentifier) 1041 throws PermissionDeniedException 1042 { 1043 checkPermission(Permission.WRITE); 1044 getData().setIdentifier(isIdentifier); 1045 } 1046 1047 /** 1048 If this flag is set, annotation values are considered to be alternate 1049 identifiers for the items they belong to. But note that BASE will not 1050 check or prevent the same value from being used for more than one item. 1051 @since 3.15 1052 */ 1053 public boolean isIdentifier() 1054 { 1055 return getData().isIdentifier(); 1056 } 1035 1057 1036 1058 /** -
trunk/src/core/net/sf/basedb/core/Install.java
r7597 r7615 119 119 method. 120 120 */ 121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(14 4).intValue();121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(145).intValue(); 122 122 123 123 public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress, -
trunk/src/core/net/sf/basedb/core/Update.java
r7597 r7615 416 416 </td> 417 417 </tr> 418 418 <tr> 419 <td>145</td> 420 <td> 421 Added {@link AnnotationTypeData#isIdentifier()}. 422 The update will set the value to FALSE for all existing annotation types. 423 </td> 424 </tr> 425 419 426 </table> 420 427 … … 679 686 schemaVersion = updateToSchemaVersion144(session, schemaVersion); 680 687 progress_current += 2 * progress_step; 688 } 689 690 if (schemaVersion < 145) 691 { 692 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 145..."); 693 schemaVersion = setSchemaVersionInTransaction(session, 145); 694 progress_current += progress_step; 681 695 } 682 696 … … 1033 1047 query.executeUpdate(); 1034 1048 } 1049 1050 if (schemaVersion < 145) 1051 { 1052 // Set identifier=false on all annotation types 1053 org.hibernate.query.Query<?> query = HibernateUtil.createQuery(session, 1054 "UPDATE AnnotationTypeData at " + 1055 "SET at.identifier = false " + 1056 "WHERE at.identifier IS NULL"); 1057 query.executeUpdate(); 1058 } 1059 1035 1060 1036 1061 // Commit the changes -
trunk/src/core/net/sf/basedb/core/data/AnnotationTypeData.java
r7244 r7615 294 294 } 295 295 296 private boolean isIdentifier; 297 /** 298 If this flag is set, annotation values can be used as identifiers to items. 299 @since 3.15 300 @hibernate.property column="`is_identifier`" type="boolean" not-null="true" 301 */ 302 public boolean isIdentifier() 303 { 304 return isIdentifier; 305 } 306 public void setIdentifier(boolean isIdentifier) 307 { 308 this.isIdentifier = isIdentifier; 309 } 310 311 296 312 private Set<Integer> itemTypes; 297 313 /**
Note: See TracChangeset
for help on using the changeset viewer.