Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Converter(autoApply = true)
- public class LocalDateAttributeConverter implements AttributeConverter<LocalDate, Date> {
- @Override
- public Date convertToDatabaseColumn(LocalDate locDate) {
- return (locDate == null ? null : Date.valueOf(locDate));
- }
- @Override
- public LocalDate convertToEntityAttribute(Date sqlDate) {
- return (sqlDate == null ? null : sqlDate.toLocalDate());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement