我在 Grails 中做一个简单的程序,并且遇到了多对多关系的问题。我有一个机场课程:
class Airport
{
static hasMany = [outgoingFlights:Flight, incomingFlights:Flight]
static mappedBy = [outgoingFlights:'departureAirport',
incomingFlights:'arrivalAirport']
}
和一个飞行类:
class Flight
{
Airport departureAirport
Airport arrivalAirport
}
出于某种原因,它给了我一个非常长且奇怪的 mappedBy 错误消息。mappedBy 代码有问题还是我还需要做其他事情?谢谢。