1 package com.vladmihalcea.hibernate.type.basic;
2
3 import com.vladmihalcea.hibernate.type.AbstractHibernateType;
4 import com.vladmihalcea.hibernate.type.basic.internal.Iso8601MonthMonthTypeDescriptor;
5 import com.vladmihalcea.hibernate.type.util.Configuration;
6 import org.hibernate.type.descriptor.sql.IntegerTypeDescriptor;
7
8 import java.time.Month;
9
10
17 public class Iso8601MonthType extends AbstractHibernateType<Month> {
18
19 public static final Iso8601MonthType INSTANCE = new Iso8601MonthType();
20
21 public Iso8601MonthType() {
22 super(
23 IntegerTypeDescriptor.INSTANCE,
24 Iso8601MonthMonthTypeDescriptor.INSTANCE
25 );
26 }
27
28 public Iso8601MonthType(Configuration configuration) {
29 super(
30 IntegerTypeDescriptor.INSTANCE,
31 Iso8601MonthMonthTypeDescriptor.INSTANCE,
32 configuration
33 );
34 }
35
36 @Override
37 public String getName() {
38 return "month";
39 }
40
41 @Override
42 protected boolean registerUnderJavaType() {
43 return true;
44 }
45 }