org.hibernate.type.descriptor.java.internal.CollectionJavaDescriptor 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
Hibernate's core ORM functionality
/*
* 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;
}
}