--- /dev/null
+package de.juplo.jpa.converters;
+
+import java.time.Year;
+import javax.persistence.AttributeConverter;
+import javax.persistence.Converter;
+
+
+/**
+ * Converts a {@link Year} into its {@link Integer} representation.
+ * @author Kai Moritz
+ */
+@Converter(autoApply = true)
+public class YearConverter implements AttributeConverter<Year, Integer>
+{
+ @Override
+ public Integer convertToDatabaseColumn(Year year)
+ {
+ return year.getValue();
+ }
+
+ @Override
+ public Year convertToEntityAttribute(Integer integer)
+ {
+ return Year.of(integer);
+ }
+}