Skip to content

Instantly share code, notes, and snippets.

@sergiomichels
Created October 4, 2012 03:12
Show Gist options
  • Save sergiomichels/3831250 to your computer and use it in GitHub Desktop.
Save sergiomichels/3831250 to your computer and use it in GitHub Desktop.
Example of using composite primary key
class CompositeDomainClass implements Serializable {
//this is part of the pk
MyOtherDomainClass otherDomainClass
//other fields here...
//and we try to map this
static mapping {
table 'composite_table'
id composite: ['id','otherDomainClass'], column: 'my_code_field'
otherDomainClass(column: 'other_table_id')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment