Dlaczego Ebean zwraca null bez powodu?
Korzystając z Play Framework, mam taki model:
class MyModel extends Model {
// Some columns
@ManyToOne
public OtherModel other;
public OtherModel getOther() {
return other;
}
}
Z jakiegoś powodu nie mogę zrozumieć, jeśli zadzwonięmyModel.other
LUBmyModel.getOther()
(myModel
będąc instancjąMyModel
), Otrzymałem wartość Null, nawet jeśli powinien zwrócić instancję OtherModel!
Ponadto, jeśli zmienięgetOther()
metody do tego:
public OtherModel getOther() {
console.log (String.valueOf(other));
return other;
}
getOther()
zwraca oczekiwaną instancjęOtherModel
Wszystko, co chcę powiedzieć ... to ... WTF?
Czy ktoś może mi wyjaśnić, dlaczego i jak naprawić to dziwne zachowanie?
Dzięki :)