First of all in Ebean you don't have to initialize this relation with empty list. You can write simply:
public List<SomeObject> listOfObjects;
and code will work as before.
And the answer to your question:
Yes, by default many-to-many relation is lazily loaded. So when you call find.byId(id)
then simple select will be executed. And when you try to use this collection (for example calling listOfObjects.size()
) then additional select will be called.
To see how it works you can turn on SQL logging.