This content has been marked as final. Show 1 reply
int modelId = u.getModel().getId(); // causes read of Model table!
Issue - this will cause a read of the model row from the DB (won't it, as in lazy loading will perform a JIT read)
No it won't. You obviously haven't tried it, or you wouldn't be asking about it. The ID field of the association is special in the way that reading it will NOT trigger lazy loading. Any other operation on the lazy object, however, will.