3

I'm work with activejdbc and:

I have 3 Models: City belongs to State belongs to Country, ok? I do this:

Paginator p = new Paginator(City.class, count, filters).orderBy(orderParams); LazyList page = p.getPage(pag).include(State.class);

This, loads cities with their states (i do page.toMaps()),

Now I want to load the country also

It's possible?

pablor21
  • 89
  • 6

1 Answers1

0

The include() method goes on dependencies only one level up or down. This means that if you are starting at the level of CIty, you can only get a state. If you want to get both, you can start at the level of State like this:

Paginator p = new Paginator(State.class, count, filters) 
                                       .orderBy(orderParams); 
LazyList page = p.getPage(pag).include(City.class, Country.class);

Not sure of this will work for you though. Here is an example without the Paginator: http://javalite.io/lazy_and_eager#eager-simultaneous-loading-of-parents-and-children

ipolevoy
  • 5,432
  • 2
  • 31
  • 46