org.hibernate.type.AdaptedImmutableType 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 .
*/
package org.hibernate.type;
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
import org.hibernate.type.descriptor.java.MutabilityPlan;
/**
* Optimize a mutable type, if the user promises not to mutable the
* instances.
*
* @author Gavin King
* @author Steve Ebersole
*/
public class AdaptedImmutableType extends AbstractSingleColumnStandardBasicType {
private final AbstractStandardBasicType baseMutableType;
public AdaptedImmutableType(AbstractStandardBasicType baseMutableType) {
super( baseMutableType.getSqlTypeDescriptor(), baseMutableType.getJavaTypeDescriptor() );
this.baseMutableType = baseMutableType;
}
@Override
@SuppressWarnings({ "unchecked" })
protected MutabilityPlan getMutabilityPlan() {
return ImmutableMutabilityPlan.INSTANCE;
}
public String getName() {
return "imm_" + baseMutableType.getName();
}
}