Skip to content

Instantly share code, notes, and snippets.

@felipero
Created September 30, 2009 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipero/198517 to your computer and use it in GitHub Desktop.
Save felipero/198517 to your computer and use it in GitHub Desktop.
class Pessoa implements Serializable {
static hasMany = [atendimentos:Atendimento]
String nome
Endereco endereco
static constraints = {
endereco(nullable:true)
}
}
class Paciente extends Pessoa {
}
class Medico extends Pessoa {
String especialidade
}
class Endereco {
static belongsTo = [Pessoa]
String logradouro
String bairro
String cidade
String estado
Pessoa pessoa
}
class Atendimento {
static belongsTo = [paciente:Paciente, medico:Medico]
Paciente paciente
Medico medico
String queixa
Date data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment