Skip to main content

Specifications, Pageable, Page vs Slice, DTO Mapping and Entity-to-DTO Conversion

Learn Specifications, Pageable, Page vs Slice, DTO Mapping and Entity-to-DTO Conversion (Phase 10 · Hibernate with Spring Boot (Essential), Hibernate) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Specifications for dynamic queries • A Specification<T> wraps a Criteria Predicate ; extend the repository with JpaSpecificationExecutor<T> and combine specs with and() , or() , not() . Ideal for search/filter screens where any combination of filters may be supplied. Use the metamodel ( Course_.title ) for type safety. For very complex cases consider Querydsl or jOOQ .

More lessons in Phase 10 · Hibernate with Spring Boot (Essential)