+package de.juplo.jpa.converters;
+
+import java.time.YearMonth;
+import javax.persistence.AttributeConverter;
+import javax.persistence.Converter;
+
+
+/**
+ * Converts a {@link YearMonth} into its {@link String} representation.
+ * @author Kai Moritz
+ */
+@Converter(autoApply = true)
+public class YearMonthConverter implements AttributeConverter<YearMonth, String>
+{
+ @Override
+ public String convertToDatabaseColumn(YearMonth yearmonth)
+ {
+ return yearmonth.toString();
+ }
+
+ @Override
+ public YearMonth convertToEntityAttribute(String string)
+ {
+ return YearMonth.parse(string);
+ }
+}