- Timestamp:
- Mar 22, 2011, 1:52:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/nl/tno/metagenomics/integration/TrashService.groovy
r9 r20 27 27 } 28 28 } 29 29 30 30 study.delete(flush:true); 31 31 } … … 185 185 // Move data from this assay sample to the trash version of it 186 186 assaySample.moveValuableDataTo( dummyAssaySample ); 187 188 // Remove the assaySample from its run, since otherwise the statistics of the run (#sequences for example) 189 // are not correct anymore and the assaySample will be resaved after delete 190 dummyAssaySample.run?.removeFromAssaySamples( dummyAssaySample ); 191 187 192 dummyAssaySample.save(); 193 } 194 } 195 196 // Remove all assaysamples from this assay from their run 197 assay.assaySamples?.each { assaySample -> 198 assaySample.run?.removeFromAssaySamples( assaySample ); 199 } 200 201 // Remove this assay from the runs, since otherwise the samples will be resaved upon delete 202 if( assay.runs ) { 203 def l = [] + assay.runs 204 l.each { 205 it.removeFromAssays( assay ); 188 206 } 189 207 } … … 232 250 // Move data from this assay sample to the trash version of it 233 251 assaySample.moveValuableDataTo( dummyAssaySample ); 252 253 // Remove the assaySample from its run, since otherwise the statistics of the run (#sequences for example) 254 // are not correct anymore 255 dummyAssaySample.run?.removeFromAssaySamples( dummyAssaySample ); 256 234 257 dummyAssaySample.save(); 235 258 } 259 } 260 261 // Remove all assaysamples from this assay from their run 262 sample.assaySamples?.each { assaySample -> 263 assaySample.run?.removeFromAssaySamples( assaySample ); 236 264 } 237 265 }
Note: See TracChangeset
for help on using the changeset viewer.