17. Expanded QL
Timestamp literals
SELECT t from BankTransaction t
WHERE t.txTime > {ts „2008-06-
0110:00:01.0‟}
IN expression may include collection parameter
SELECT emp FROM Employee emp
WHERE emp.project.id IN [:projectIds]
Non- polymorphic queries
SELECT e FROM Employee e
WHERE CLASS(e) = FullTimeEmployee OR
e.wage = “SALARY”
18. Expanded QL
Ordered List indexing
SELECT t FROM CreditCard c
JOIN c.transactionHistory t
WHERE INDEX(t) BETWEEN 0 AND 9
CASE statement
UPDATE Employee e SET e.salary =
CASE e.rating WHEN 1 THEN e.salary * 1.1
WHEN 2 THEN e.salary * 1.05
ELSE e.salary * 1.01
END
23. References
JSR 317 (http://jcp.org/en/jsr/detail?id=317)
ProJPA 2 Mastering the Java™ Persistence API by
Mike Keith and Merrick Schincariol
Beginning Java™ EE 6 Platform with GlassFish™ 3 by
Antonio Goncalves
http://www.infoq.com/presentations/whats-new-and-
exciting-in-jpa-20
http://en.wikibooks.org/wiki/Java_Persistence/What_is_
new_in_JPA_2.0%3F
http://wiki.eclipse.org/EclipseLink/Examples/JPA#JPA_
2.0
http://www.developer.com/features/article.php/3892261/
JPA-20-Cache-Vs-Hibernate-Cache-Differences-in-
Approach.htm