Skip to content

Instantly share code, notes, and snippets.

@bogdanalbei
Created March 18, 2018 20:34
Show Gist options
  • Select an option

  • Save bogdanalbei/f179f36e07fb20464e2786737c79f395 to your computer and use it in GitHub Desktop.

Select an option

Save bogdanalbei/f179f36e07fb20464e2786737c79f395 to your computer and use it in GitHub Desktop.
Lazy loading repo
public class UserRepository {
public User getById(long id) {
User user = users.get(id);
user.setWallets(() -> walletRepository.getByUserId(id));
return user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment