This document provides an overview and agenda for a presentation on Java 8 features and the Jinq library. It discusses Java 8 language features like lambda expressions and default methods. It then describes Jinq, an open-source library that allows functional-style database queries in Java by translating Java code into SQL. The document outlines how Jinq works, its configuration, supported query operations like filtering, sorting and joins, and limitations. It also briefly mentions alternative libraries like JOOQ.
19. Jinq
• Initially developed by Dr. Ming-Yee
• Open-source project
• Functional database queries in Java and Scala
• Inspired by LINQ
• Required JPA & Java 8
20. Jinq flow
• Translated Java code and Run it as database query
statements
• Run as ordinary Java code
39. Pairs
select city.id, country.id, city.countryId, city.name,
city.population, country.name from City city inner join
Country country on city.countryId=country.id limit ?
41. Grouping
• select city.countryId, sum(city.population),
count(city.id), country.id, country.name from City
city inner join Country country on city.countryId=
country.id group by city.countryId limit ?
42. Limitations
• Your code cannot contain any loops
• Your code can call other methods but only those
from a restricted list with known side-effects
• Your code can read and modify local variables
(since these changes will be discarded once the
function exits)
• Your code can read but not modify non-local
variables
• Your code cannot contain casting between
different data types