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

org.hibernate.type.descriptor.java.internal.CollectionJavaDescriptor Maven / Gradle / Ivy

There is a newer version: 7.0.0.Beta1
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.type.descriptor.java.internal;

import org.hibernate.collection.spi.CollectionSemantics;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.metamodel.model.domain.spi.CollectionMutabilityPlan;
import org.hibernate.type.descriptor.java.spi.AbstractBasicJavaDescriptor;
import org.hibernate.type.descriptor.spi.SqlTypeDescriptorIndicators;
import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptor;

/**
 * @author Steve Ebersole
 */
public class CollectionJavaDescriptor extends AbstractBasicJavaDescriptor {
	private final CollectionSemantics semantics;

	public CollectionJavaDescriptor(
			Class type,
			CollectionSemantics semantics) {
		super( type );
		this.semantics = semantics;
	}

	@Override
	public String getTypeName() {
		return getJavaType().getName();
	}

	@Override
	public CollectionMutabilityPlan getMutabilityPlan() {
		return (CollectionMutabilityPlan) super.getMutabilityPlan();
	}

	@Override
	public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) {
		// none
		return null;
	}

	@Override
	public String toString(C value) {
		return "CollectionJavaDescriptor(" + getTypeName() + ")";
	}

	@Override
	public C fromString(String string) {
		throw new UnsupportedOperationException(  );
	}

	@Override
	public  X unwrap(C value, Class type, SharedSessionContractImplementor session) {
		throw new UnsupportedOperationException(  );
	}

	@Override
	public  C wrap(X value, SharedSessionContractImplementor session) {
		throw new UnsupportedOperationException(  );
	}

	public CollectionSemantics getSemantics() {
		return semantics;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy