Figure 861. Querydsl entity metamodel Slide presentation Create comment in forum

Figure 862. From Querying JPA Slide presentation Create comment in forum

Querydsl for JPA is an alternative to both JPQL and Criteria queries.

It combines the dynamic nature of Criteria queries with the expressiveness of JPQL and all that in a fully typesafe manner.


Figure 863. Querydsl query Slide presentation Create comment in forum
new JPAQuery(entityManager).
  from(qStudyCourse).
  where(qStudyCourse.shortName.like("C%")).
  list(qStudyCourse).
  stream().
  map(s -> "Read '" + s + "'").
  forEach(System.out::println);
Read 'Cross Media
  Journalism(CRB)'

Read 'Computer Science
  and Media(CSM)'

Figure 864. No injection susceptibility Slide presentation Create comment in forum
select studycours0_.shortName as shortNam1_0_,
       studycours0_.fullName  as fullName2_0_
from StudyCourse studycours0_
where studycours0_.shortName like ? escape '!'