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

org.hibernate.boot.model.process.internal.UserTypeMutabilityPlanAdapter Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha3
Show newest version
/*
 * 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.boot.model.process.internal;

import java.io.Serializable;

import org.hibernate.type.descriptor.java.MutabilityPlan;
import org.hibernate.usertype.UserType;

/**
 * @author Steve Ebersole
 */
public class UserTypeMutabilityPlanAdapter implements MutabilityPlan {
	private final UserType userType;

	public UserTypeMutabilityPlanAdapter(UserType userType) {
		this.userType = userType;
	}

	@Override
	public boolean isMutable() {
		return userType.isMutable();
	}

	@Override
	@SuppressWarnings("unchecked")
	public T deepCopy(T value) {
		return (T) userType.deepCopy( value );
	}

	@Override
	public Serializable disassemble(T value) {
		return userType.disassemble( value );
	}

	@Override
	@SuppressWarnings("unchecked")
	public T assemble(Serializable cached) {
		return (T) userType.assemble( cached, null );
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy