そして、ここに行きます:あなたは関係に同じエイリアスを指定しました。
User:
relations:
viewed_by:
class: View
local: user_id
foreign: viewed_id
type: many
foreignType: one
foreignAlias: viewed
viewed:
class: View
local: user_id
foreign: viewer_id
type: many
foreignType: one
foreignAlias: viewer
または、多対多の関係全体を異なる方法で設定します。
User:
relations:
viewed_by:
class: User
local: viewed_id
foreign: viewer_id,
refClass: View
viewed:
class: User
local:viewer_id
foreign: viewed_id
refClass: View
およびView
次のようになります
View:
columns:
viewed_id:
type: integer
primary: true
viewer_id:
type: integer
primary: true
多対多の関係 。