Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Created December 31, 2014 21:23
Show Gist options
  • Save tylertreat/0e428bed8ca728c6fd98 to your computer and use it in GitHub Desktop.
Save tylertreat/0e428bed8ca728c6fd98 to your computer and use it in GitHub Desktop.
public class FooEntity {
private BarEntity relatedEntity;
public BarEntity getRelatedEntity() {
if (relatedEntity == null)
relatedEntity = new BarEntity(); // Alternatively, this might be a database call
return relatedEntity;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment