com.vladmihalcea.hibernate.type.basic.ZoneIdType Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-types-60 Show documentation
Show all versions of hibernate-types-60 Show documentation
Hibernate ORM 6.0 extra Types
package com.vladmihalcea.hibernate.type.basic;
import com.vladmihalcea.hibernate.type.MutableType;
import com.vladmihalcea.hibernate.type.basic.internal.ZoneIdTypeDescriptor;
import com.vladmihalcea.hibernate.type.util.Configuration;
import org.hibernate.type.descriptor.jdbc.VarcharJdbcType;
import java.time.ZoneId;
/**
* Maps a Java {@link ZoneId} object to an {@code VARCHAR} column type.
*
* @author stonio
*/
public class ZoneIdType extends MutableType {
public static final ZoneIdType INSTANCE = new ZoneIdType();
public ZoneIdType() {
super(
ZoneId.class,
VarcharJdbcType.INSTANCE,
ZoneIdTypeDescriptor.INSTANCE
);
}
public ZoneIdType(Configuration configuration) {
super(
ZoneId.class,
VarcharJdbcType.INSTANCE,
ZoneIdTypeDescriptor.INSTANCE,
configuration
);
}
public ZoneIdType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext) {
this(new Configuration(typeBootstrapContext.getConfigurationSettings()));
}
public String getName() {
return "zone-id";
}
}