Changeset 7198
- Timestamp:
- Oct 17, 2016, 9:01:25 AM (6 years ago)
- Location:
- trunk/src/core/net/sf/basedb/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Install.java
r7166 r7198 118 118 method. 119 119 */ 120 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(13 3).intValue();120 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(134).intValue(); 121 121 122 122 public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress, -
trunk/src/core/net/sf/basedb/core/Project.java
r7033 r7198 25 25 26 26 import net.sf.basedb.core.Transactional.Action; 27 import net.sf.basedb.core.data.AnnotationSetData; 27 28 import net.sf.basedb.core.data.BasicData; 28 29 import net.sf.basedb.core.data.ItemParameterValueData; … … 89 90 public class Project 90 91 extends OwnedItem 91 implements Nameable, Removable, Registered 92 implements Nameable, Removable, Registered, Annotatable 92 93 { 93 94 /** … … 237 238 { 238 239 return DateUtil.copy(getData().getEntryDate()); 240 } 241 // ------------------------------------------- 242 243 /* 244 From the Annotatable interface 245 ------------------------------------------- 246 */ 247 @Override 248 public AnnotationSet getAnnotationSet() 249 throws PermissionDeniedException, BaseException 250 { 251 checkBatchAnnotatableUsage(true, false); 252 DbControl dc = getDbControl(); 253 AnnotationSet as = dc.getItem(AnnotationSet.class, getData().getAnnotationSet(), this); 254 if (as == null) 255 { 256 as = AnnotationSet.getNew(dc, this); 257 getData().setAnnotationSet(as.getData()); 258 dc.saveItemIf(this, as, false); 259 } 260 return as; 261 } 262 @Override 263 public boolean isAnnotated() 264 { 265 return getData().getAnnotationSet() != null; 266 } 267 @Override 268 public void removeAnnotations() 269 throws PermissionDeniedException, BaseException 270 { 271 checkPermission(Permission.WRITE); 272 AnnotationSetData as = getData().getAnnotationSet(); 273 if (as != null) 274 { 275 HibernateUtil.deleteData(getDbControl().getHibernateSession(), as); 276 getData().setAnnotationSet(null); 277 } 278 } 279 /** 280 Default implementation returns null. Should be overriden by subclasses 281 that has protocols. 282 @return Always null 283 */ 284 @Override 285 public Protocol getProtocol() 286 { 287 return null; 288 } 289 290 /** 291 @return Always null 292 */ 293 public Set<Annotatable> getAnnotatableParents() 294 throws BaseException 295 { 296 return null; 239 297 } 240 298 // ------------------------------------------- -
trunk/src/core/net/sf/basedb/core/Update.java
r7165 r7198 331 331 </td> 332 332 </tr> 333 <tr> 334 <td>134</td> 335 <td> 336 Made {@link Project} annotatable. No special database update is needed. 337 Only increase the schema version. 338 </td> 339 </tr> 333 340 334 341 </table> … … 537 544 progress_current += progress_step; 538 545 } 539 546 547 if (schemaVersion < 134) 548 { 549 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 134..."); 550 // Schemaversion 134 only updates the version number 551 schemaVersion = setSchemaVersionInTransaction(session, 134); 552 progress_current += progress_step; 553 } 554 540 555 sc.logout(); 541 556 if (progress != null) progress.display(100, "Database updated successfully."); -
trunk/src/core/net/sf/basedb/core/data/ProjectData.java
r7015 r7198 25 25 import java.util.Date; 26 26 import java.util.Set; 27 28 import net.sf.basedb.core.data.annotations.AnnotationLink; 29 27 30 import java.util.Map; 28 31 import java.util.HashMap; … … 40 43 public class ProjectData 41 44 extends OwnedData 42 implements NameableData, RemovableData, RegisteredData 45 implements NameableData, RemovableData, RegisteredData, AnnotatableData 43 46 { 44 47 … … 105 108 // ------------------------------------------- 106 109 110 /* 111 From the AnnotatableData interface 112 ------------------------------------------- 113 */ 114 private AnnotationSetData annotationSet; 115 116 /** 117 @since 3.10 118 */ 119 @Override 120 public AnnotationSetData getAnnotationSet() 121 { 122 return annotationSet; 123 } 124 125 /** 126 @since 3.10 127 */ 128 @Override 129 public void setAnnotationSet(AnnotationSetData annotationSet) 130 { 131 this.annotationSet = annotationSet; 132 } 133 private Set<AnnotationLink> links; 134 135 /** 136 @since 3.10 137 */ 138 @Override 139 public Set<AnnotationLink> getAnnotations() 140 { 141 return links; 142 } 143 void setAnnotations(Set<AnnotationLink> links) 144 { 145 this.links = links; 146 } 147 // ------------------------------------------- 148 107 149 private int autoPermission; 108 150 /**
Note: See TracChangeset
for help on using the changeset viewer.