RushOrm icon indicating copy to clipboard operation
RushOrm copied to clipboard

Question: Access to parent?

Open LimitTech opened this issue 8 years ago • 2 comments

Hello, I have

Parent.class:
@List...
List<Child> children;

Is there any way to access to parent from a child?

Child child = new RushSearch().findSingle(Child);
child.parent ???

Thanks

LimitTech avatar Apr 13 '16 08:04 LimitTech

Hi,

A simple RushSearch can do this.

Parent parent = new RushSearch.whereEqual("children", child).findSingle(Parent.class);

Thanks

ghost avatar Apr 15 '16 11:04 ghost

Thank you!

Maybe it is common enough to be in the FAQ, I think.

LimitTech avatar Apr 15 '16 13:04 LimitTech