Changeset 267
- Timestamp:
- Mar 15, 2010, 4:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/data/Term.groovy
r247 r267 25 25 return name 26 26 } 27 28 29 // Covenenice method for delivering Terms. 30 // if the term is already defined, use it. 31 // otherwise, create it. 32 // should be removed when ontologies work. 33 static getTerm( string ) { 34 def term = Term.find("from Term as t where t.name = '${string}'") 35 if( term==null ) { term = new Term() 36 term.name=string 37 term.ontology = Ontology.find('from Ontology as o') 38 term.accession = '' 39 println string 40 if( term.save(flush:true) ) { println "okay, saved" } 41 else { 42 term.errors.each{ println it } 43 println "not okay, not saved" } 44 } 45 return term 46 } 27 47 }
Note: See TracChangeset
for help on using the changeset viewer.