- Timestamp:
- Jan 25, 2011, 5:57:37 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy
r1430 r1440 2 2 3 3 import nl.grails.plugins.gdt.* 4 import java.util.UUID; 4 5 5 6 /** … … 34 35 String name // should be unique with respect to the parent study (which can be inferred) 35 36 Term material // material of the sample (should normally be bound to the BRENDA ontology) 36 37 38 /** 39 * UUID of this sample 40 */ 41 String sampleUUID 42 37 43 /** 38 44 * return the domain fields for this domain class … … 69 75 // The material domain field is optional 70 76 material(nullable: true) 77 78 sampleUUID(nullable: true, unique: true) 71 79 72 80 // Check if the externalSampleId (currently defined as name) is really unique within each parent study of this sample. … … 123 131 return name 124 132 } 133 134 /** 135 * Returns the UUID of this sample and generates one if needed 136 */ 137 public String giveUUID() { 138 if( !this.sampleUUID ) { 139 this.sampleUUID = UUID.randomUUID().toString(); 140 this.save(); 141 } 142 143 return this.sampleUUID; 144 } 125 145 }
Note: See TracChangeset
for help on using the changeset viewer.