Skip to content

Instantly share code, notes, and snippets.

@thjanssen
Last active July 1, 2016 06:01
Show Gist options
  • Save thjanssen/6c6e63e93713cd17f2d378e8fd5fb6eb to your computer and use it in GitHub Desktop.
Save thjanssen/6c6e63e93713cd17f2d378e8fd5fb6eb to your computer and use it in GitHub Desktop.
05:22:13,930 DEBUG [org.hibernate.SQL] –
select authors0_.bookId as bookId1_2_0_,
authors0_.authorId as authorId2_2_0_,
author1_.id as id1_0_1_,
author1_.firstName as firstNam2_0_1_,
author1_.lastName as lastName3_0_1_,
author1_.version as version4_0_1_
from BookAuthor authors0_ inner join Author author1_
on authors0_.authorId=author1_.id
where authors0_.bookId=?
order by author1_.lastName asc
@ManyToMany
@JoinTable(name="BookAuthor",
joinColumns={@JoinColumn(name="bookId", referencedColumnName="id")},
inverseJoinColumns={@JoinColumn(name="authorId", referencedColumnName="id")})
@OrderBy(value = "lastName ASC")
private Set<Author> authors = new HashSet<Author>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment