Skip to content

Latest commit

 

History

History

HibernateSpringBootOptional

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Use Java 8 Optional In Entities And Queries

Description: This application is an example of how is correct to use the Java 8 Optional in entities and queries.

Key points:

  • use the Spring Data built-in query-methods that return Optional (e.g., findById())
  • write your own queries that return Optional
  • use Optional in entities getters
  • in order to run different scenarios check the file, data-mysql.sql

If you need a deep dive into the performance recipes exposed in this repository then I am sure that you will love my book "Spring Boot Persistence Best Practices"If you need a hand of tips and illustrations of 100+ Java persistence performance issues then "Java Persistence Performance Illustrated Guide" is for you.