Skip to content

Instantly share code, notes, and snippets.

@thjanssen
Last active April 19, 2017 05:16
Show Gist options
  • Save thjanssen/355d678c0bda291de2fe390401b6de0d to your computer and use it in GitHub Desktop.
Save thjanssen/355d678c0bda291de2fe390401b6de0d to your computer and use it in GitHub Desktop.
TypedQuery<Book> q = em.createQuery("SELECT b FROM Book b "
+ "WHERE :double2 > function('calculate', b.price, :double1)"
, Book.class);
07:15:43,305 DEBUG [org.hibernate.SQL] -
select
book0_.id as id1_0_,
book0_.price as price2_0_,
book0_.publishingDate as publishi3_0_,
book0_.title as title4_0_,
book0_.version as version5_0_
from
Book book0_
where
?>calculate(book0_.price, ?)
Query q = em.createQuery(“SELECT a, size(a.books) FROM Author a GROUP BY a.id”);
14:45:45,952 DEBUG [org.hibernate.SQL] -
select
author0_.id as col_0_0_,
count(books1_.authorId) as col_1_0_,
author0_.id as id1_0_,
author0_.firstName as firstNam2_0_,
author0_.lastName as lastName3_0_,
author0_.version as version4_0_
from
Author author0_ cross
join
BookAuthor books1_
where
author0_.id=books1_.authorId
group by
author0_.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment