1 package de.juplo.jpa.converters;
3 import java.time.YearMonth;
4 import javax.persistence.AttributeConverter;
5 import javax.persistence.Converter;
9 * Converts a {@link YearMonth} into its {@link String} representation.
12 @Converter(autoApply = true)
13 public class YearMonthConverter implements AttributeConverter<YearMonth, String>
16 public String convertToDatabaseColumn(YearMonth yearmonth)
18 return yearmonth.toString();
22 public YearMonth convertToEntityAttribute(String string)
24 return YearMonth.parse(string);