org.hibernate.type.StandardBasicTypeTemplate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
JPMS Module-Info's for a few of the Jakarta Libraries just until they add them in themselves
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.type;
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
/**
* A BasicType adapter targeting partial portability to 6.0's type
* system changes. In 6.0 the notion of a BasicType is just a
* combination of JavaTypeDescriptor/SqlTypeDescriptor.
*
* @author Steve Ebersole
*/
@SuppressWarnings("unused")
public class StandardBasicTypeTemplate extends AbstractSingleColumnStandardBasicType {
private final String name;
private final String[] registrationKeys;
public StandardBasicTypeTemplate(
SqlTypeDescriptor sqlTypeDescriptor,
JavaTypeDescriptor javaTypeDescriptor,
String... registrationKeys) {
super( sqlTypeDescriptor, javaTypeDescriptor );
this.registrationKeys = registrationKeys;
this.name = javaTypeDescriptor.getJavaType() == null ? "(map-mode)" : javaTypeDescriptor.getJavaType().getName()
+ " -> " + sqlTypeDescriptor.getSqlType();
}
@Override
public String getName() {
return name;
}
@Override
public String[] getRegistrationKeys() {
return registrationKeys;
}
}