Skip to content

Instantly share code, notes, and snippets.

@gabanox
Created October 15, 2014 06:27
Show Gist options
  • Save gabanox/ae6fcf3fe92012c6374e to your computer and use it in GitHub Desktop.
Save gabanox/ae6fcf3fe92012c6374e to your computer and use it in GitHub Desktop.
@Entity
@Table(name = "contact")
@NamedQueries({
@NamedQuery(name="Contact.findById",
query="select distinct c from Contact c left join fetch c.contactTelDetails t left join fetch c.hobbies h where c.id = :id"),
@NamedQuery(name="Contact.findAllWithDetail",
query="select distinct c from Contact c left join fetch c.contactTelDetails t left join fetch c.hobbies h")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment