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

org.hibernate.boot.spi.BasicTypeRegistration Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha1
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 .
 */
package org.hibernate.boot.spi;

import org.hibernate.type.BasicType;
import org.hibernate.type.CompositeCustomType;
import org.hibernate.type.CustomType;
import org.hibernate.usertype.CompositeUserType;
import org.hibernate.usertype.UserType;

/**
 * @author Steve Ebersole
 */
public class BasicTypeRegistration {
	private final BasicType basicType;
	private final String[] registrationKeys;

	public BasicTypeRegistration(BasicType basicType) {
		this( basicType, basicType.getRegistrationKeys() );
	}

	public BasicTypeRegistration(BasicType basicType, String[] registrationKeys) {
		this.basicType = basicType;
		this.registrationKeys = registrationKeys;
	}

	public BasicTypeRegistration(UserType type, String[] keys) {
		this( new CustomType( type, keys ), keys );
	}

	public BasicTypeRegistration(CompositeUserType type, String[] keys) {
		this( new CompositeCustomType( type, keys ), keys );
	}

	public BasicType getBasicType() {
		return basicType;
	}

	public String[] getRegistrationKeys() {
		return registrationKeys;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy