1 package com.vladmihalcea.hibernate.type.basic;
2
3 import com.vladmihalcea.hibernate.type.AbstractHibernateType;
4 import com.vladmihalcea.hibernate.type.basic.internal.MonthDayTypeDescriptor;
5 import com.vladmihalcea.hibernate.type.util.Configuration;
6 import org.hibernate.type.descriptor.sql.DateTypeDescriptor;
7
8 import java.time.MonthDay;
9
10 /**
11  * Maps a Java {@link java.time.MonthDay} object to a {@code DATE} column type.
12  *
13  * @author Mladen Savic (mladensavic94@gmail.com)
14  */

15
16 public class MonthDayDateType extends AbstractHibernateType<MonthDay> {
17
18     public static final MonthDayDateType INSTANCE = new MonthDayDateType();
19
20
21     public MonthDayDateType() {
22         super(DateTypeDescriptor.INSTANCE, MonthDayTypeDescriptor.INSTANCE);
23     }
24
25     public MonthDayDateType(Configuration configuration) {
26         super(DateTypeDescriptor.INSTANCE, MonthDayTypeDescriptor.INSTANCE, configuration);
27     }
28
29     @Override
30     public String getName() {
31         return "monthday-date";
32     }
33
34     @Override
35     protected boolean registerUnderJavaType() {
36         return true;
37     }
38 }
39