次のように、MongoDBGrailsPLUGINでマップされた2つのクラスがあります。
クラスの人:
class Person {
static mapWith="mongo"
String name
String email
static hasMany = [profiles: Profile]
static belongsTo = Profile
String toString(){
return name +" - " + (profiles)
} }
およびクラスプロファイル:
class Profile{
static mapWith="mongo"
String abbreviation
String description
static hasMany = [people: Person]
String toString(){
return abbreviation + " - " + description
}}
mongoが提供するファインダーを使用して、プロファイルごとにユーザーを返すクエリを作成するにはどうすればよいですか?
mongoクエリも役立つかもしれません!
このファインダーは何も返しません
def people = Profile.findAllByAbbreviation("example").people
申し訳ありませんが英語...