Play Frameworkを使用して、私はこのようなモデルを持っています:
class MyModel extends Model {
// Some columns
@ManyToOne
public OtherModel other;
public OtherModel getOther() {
return other;
}
}
理解できない理由で、myModel.other
OR myModel.getOther()
(myModel
のインスタンスであるMyModel
)を呼び出すと、OtherModelのインスタンスを返す必要がある場合でも、Null値を取得しました。
さらに、getOther()
メソッドをこれに変更すると:
public OtherModel getOther() {
console.log (String.valueOf(other));
return other;
}
getOther()
の期待されるインスタンスを返しますOtherModel
なぜこれを取得するのですか、そしてこの奇妙な動作を修正する方法は?