Ich neige dazu, die Kartennotation für hingohrsto zu verwenden, also würde ich es so machen:
class Status {
String text
static belongsTo = [author: Person]
}
Dann ist deine Frage einfach:
def messages = Status.findAllByAuthor(currentPerson)
Wenn Sie bidirektional in Person mit Hasmany hinzugefügt haben:
class Person {
static hasMany = [messages: Status]
}
Sie könnten dies auch tun:
def messages = currentPerson.messages