All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vladmihalcea.hibernate.type.basic.YearType Maven / Gradle / Ivy

There is a newer version: 2.21.1
Show newest version
package com.vladmihalcea.hibernate.type.basic;

import com.vladmihalcea.hibernate.type.MutableType;
import com.vladmihalcea.hibernate.type.basic.internal.YearTypeDescriptor;
import com.vladmihalcea.hibernate.type.util.Configuration;
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcType;

import java.time.Year;

/**
 * Maps a Java {@link Year} object to an {@code INT} column type.
 * 

* For more details about how to use it, check out this article on vladmihalcea.com. * * @author Vlad Mihalcea */ public class YearType extends MutableType { public static final YearType INSTANCE = new YearType(); public YearType() { super( Year.class, SmallIntJdbcType.INSTANCE, YearTypeDescriptor.INSTANCE ); } public YearType(Configuration configuration) { super( Year.class, SmallIntJdbcType.INSTANCE, YearTypeDescriptor.INSTANCE, configuration ); } public YearType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext) { this(new Configuration(typeBootstrapContext.getConfigurationSettings())); } public String getName() { return "year"; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy