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