Skip to content

Instantly share code, notes, and snippets.

@sourcerebels
Created July 4, 2011 08:24
Show Gist options
  • Save sourcerebels/1063060 to your computer and use it in GitHub Desktop.
Save sourcerebels/1063060 to your computer and use it in GitHub Desktop.
One to Many relationship in GORM (Grails)
package pim
class Project {
static hasMany = [ tasks : Task]
String code
String summary
User owner
static constraints = {
code(blank : false, unique : true, nullable : false)
summary(blank : false, nullable : false)
owner(blank : false, nullable : false)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment