Changeset 1911
- Timestamp:
- Jun 1, 2011, 7:46:30 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/application.properties
r1900 r1911 1 1 #Grails Metadata file 2 # Mon May 30 14:42:25CEST 20112 #Wed Jun 01 19:37:56 CEST 2011 3 3 app.build.display.info=0 4 4 app.build.svn.revision=1079 … … 15 15 plugins.gdt=0.0.54 16 16 plugins.gdtimporter=0.4.5.5 17 plugins.grom=0.2.2 17 18 plugins.hibernate=1.3.7 18 19 plugins.jquery=1.6.1.1 -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r1910 r1911 348 348 */ 349 349 void deleteEventGroup(EventGroup eventGroup) { 350 println "deleting eventgroup: ${eventGroup}" 351 350 352 // If the event group contains sampling events 351 353 if (eventGroup.samplingEvents) { 354 println "got sampling events?" 352 355 // remove all samples that originate from this eventGroup 353 356 if (eventGroup.samplingEvents.size()) { 357 println "yes" 354 358 // find all samples related to this eventGroup 355 359 // - subject comparison is relatively straightforward and … … 361 365 // this seems now to work as expected 362 366 // - event group comparison: in progress, doesn't always seem to work but doesn't fail either? 367 /* 363 368 this.samples.findAll { sample -> 364 369 ( 370 ( 371 (sample.parentEventGroup.id && eventGroup.id && sample.parentEventGroup.id == eventGroup.id) 372 || 373 (sample.parentEventGroup.getIdentifier() == eventGroup.getIdentifier()) 374 || 375 sample.parentEventGroup.equals(eventGroup) 376 ) 377 && 365 378 (eventGroup.subjects.findAll { 366 379 it.equals(sample.parentSubject) … … 376 389 ) 377 390 }) 378 &&379 eventGroup.equals(sample.parentEventGroup)380 391 ) 381 }.each() { sample -> 392 } 393 */ 394 // find all samples that 395 // - are part of this study 396 println "check samples:" 397 this.samples.each { sample -> 398 println "sample ${sample}: ${(sample.parentEventGroup.id && eventGroup.id && sample.parentEventGroup.id == eventGroup.id)} - ${(sample.parentEventGroup.getIdentifier() == eventGroup.getIdentifier())} - ${sample.parentEventGroup.equals(eventGroup)}" 399 } 400 401 println "delete samples:" 402 this.samples.findAll { sample -> 403 ( 404 // - belong to this eventGroup 405 ( 406 (sample.parentEventGroup.id && eventGroup.id && sample.parentEventGroup.id == eventGroup.id) 407 || 408 (sample.parentEventGroup.getIdentifier() == eventGroup.getIdentifier()) 409 || 410 sample.parentEventGroup.equals(eventGroup) 411 ) 412 ) 413 } 414 .each() { sample -> 382 415 // remove sample from study 416 println sample 383 417 this.deleteSample(sample) 384 418 } … … 386 420 387 421 // remove all samplingEvents from this eventGroup 422 println "remove sampling events from this eventgroup:" 388 423 eventGroup.samplingEvents.findAll {}.each() { 424 println it 389 425 eventGroup.removeFromSamplingEvents(it) 390 426 } … … 392 428 393 429 // If the event group contains subjects 430 println "got subjects?" 394 431 if (eventGroup.subjects) { 432 println "yes, remove subjects from eventgroup:" 395 433 // remove all subject from this eventGroup 396 434 eventGroup.subjects.findAll {}.each() { 435 println it 397 436 eventGroup.removeFromSubjects(it) 398 437 } … … 400 439 401 440 // remove the eventGroup from the study 441 println "remove eventgroup from study" 402 442 this.removeFromEventGroups(eventGroup) 403 443 404 444 // Also here, contrary to documentation, an extra delete() is needed 405 445 // otherwise cascaded deletes are not properly performed 446 println "final delete..." 447 println "-----" 406 448 eventGroup.delete() 407 449 }
Note: See TracChangeset
for help on using the changeset viewer.