mimacom blog

Using Java 8 Dates with Spring JPA and PostgreSQL for Custom Queries

October 5, 2018

Storing dates in databases was traditionally done with java.sql.Date and java.sql.Timestamp. Since we would like to write modern applications, with Java 8 or 11, it is preferable to use an OffsetDateTime or a LocalDateTime. Spring Data JPA, for example, is mapping those fields automatically to the correct database field. There are still some challenges in combination with PostgreSQL.

Read more
Newer posts Older posts