1 package de.juplo.jpa.converters;
4 import java.time.LocalDate;
5 import javax.persistence.AttributeConverter;
6 import javax.persistence.Converter;
10 * Converts a {@link LocalDate} to a {@link Date}.
13 @Converter(autoApply = true)
14 public class LocalDateConverter implements AttributeConverter<LocalDate, Date>
17 public Date convertToDatabaseColumn(LocalDate ld)
21 return Date.valueOf(ld);
25 public LocalDate convertToEntityAttribute(Date date)
29 return date.toLocalDate();