dropped no-longer-used no-op impls intended for annotations

This commit is contained in:
Steve Ebersole 2021-10-11 12:10:43 -05:00
parent 1d4fe5d178
commit 7b61966882
8 changed files with 2 additions and 232 deletions

View File

@ -9,7 +9,6 @@ package org.hibernate.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.hibernate.annotations.internal.NoIdentifierGenerator;
import org.hibernate.id.IdentifierGenerator;
import jakarta.persistence.Column;
@ -38,12 +37,12 @@ public @interface CollectionId {
*
* @apiNote Mutually exclusive with {@link #generator()}
*/
Class<? extends IdentifierGenerator> generatorImplementation() default NoIdentifierGenerator.class;
Class<? extends IdentifierGenerator> generatorImplementation() default IdentifierGenerator.class;
/**
* The generator name.
*
* Can specify either a built-in strategy ("sequence", e.g.) or a named generator
* Can specify either a built-in strategy ("sequence", e.g.) or a named generatorIdentifierGenerator
* ({@link jakarta.persistence.SequenceGenerator}, e.g.)
*
* @apiNote Mutually exclusive with {@link #generatorImplementation()} ()}

View File

@ -1,21 +0,0 @@
/*
* 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.annotations.internal;
import jakarta.persistence.AttributeConverter;
public class NoAttributeConverter implements AttributeConverter<Void,Void> {
@Override
public Void convertToDatabaseColumn(Void attribute) {
throw new UnsupportedOperationException();
}
@Override
public Void convertToEntityAttribute(Void dbData) {
throw new UnsupportedOperationException();
}
}

View File

@ -1,23 +0,0 @@
/*
* 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.annotations.internal;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator;
public class NoIdentifierGenerator implements IdentifierGenerator {
@Override
public Object generate(SharedSessionContractImplementor session, Object object) throws HibernateException {
throw new UnsupportedOperationException();
}
@Override
public boolean supportsJdbcBatchInserts() {
throw new UnsupportedOperationException();
}
}

View File

@ -1,29 +0,0 @@
/*
* 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.annotations.internal;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
public class NoJavaTypeDescriptor implements BasicJavaTypeDescriptor<Void> {
@Override
public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) {
throw new UnsupportedOperationException();
}
@Override
public <X> X unwrap(Void value, Class<X> type, WrapperOptions options) {
throw new UnsupportedOperationException();
}
@Override
public <X> Void wrap(X value, WrapperOptions options) {
throw new UnsupportedOperationException();
}
}

View File

@ -1,29 +0,0 @@
/*
* 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.annotations.internal;
import org.hibernate.type.descriptor.ValueBinder;
import org.hibernate.type.descriptor.ValueExtractor;
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
public class NoJdbcTypeDescriptor implements JdbcTypeDescriptor {
@Override
public int getJdbcTypeCode() {
throw new UnsupportedOperationException();
}
@Override
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
throw new UnsupportedOperationException();
}
@Override
public <X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor) {
throw new UnsupportedOperationException();
}
}

View File

@ -1,34 +0,0 @@
/*
* 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.annotations.internal;
import java.io.Serializable;
import org.hibernate.SharedSessionContract;
import org.hibernate.type.descriptor.java.MutabilityPlan;
public class NoMutabilityPlan implements MutabilityPlan<Void> {
@Override
public boolean isMutable() {
throw new UnsupportedOperationException();
}
@Override
public Void deepCopy(Void value) {
throw new UnsupportedOperationException();
}
@Override
public Serializable disassemble(Void value, SharedSessionContract session) {
throw new UnsupportedOperationException();
}
@Override
public Void assemble(Serializable cached, SharedSessionContract session) {
throw new UnsupportedOperationException();
}
}

View File

@ -1,73 +0,0 @@
/*
* 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.annotations.internal;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.usertype.UserType;
public class NoUserType implements UserType<Void> {
@Override
public int[] sqlTypes() {
throw new UnsupportedOperationException();
}
@Override
public Class<Void> returnedClass() {
throw new UnsupportedOperationException();
}
@Override
public boolean equals(Object x, Object y) throws HibernateException {
throw new UnsupportedOperationException();
}
@Override
public int hashCode(Object x) throws HibernateException {
throw new UnsupportedOperationException();
}
@Override
public Void nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner) throws SQLException {
throw new UnsupportedOperationException();
}
@Override
public void nullSafeSet(PreparedStatement st, Void value, int index, SharedSessionContractImplementor session) throws SQLException {
throw new UnsupportedOperationException();
}
@Override
public Object deepCopy(Object value) throws HibernateException {
throw new UnsupportedOperationException();
}
@Override
public boolean isMutable() {
throw new UnsupportedOperationException();
}
@Override
public Serializable disassemble(Object value) throws HibernateException {
throw new UnsupportedOperationException();
}
@Override
public Object assemble(Serializable cached, Object owner) throws HibernateException {
throw new UnsupportedOperationException();
}
@Override
public Object replace(Object original, Object target, Object owner) throws HibernateException {
throw new UnsupportedOperationException();
}
}

View File

@ -54,10 +54,6 @@ import org.hibernate.annotations.TimeZoneStorageType;
import org.hibernate.annotations.TimeZoneType;
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.annotations.internal.NoJavaTypeDescriptor;
import org.hibernate.annotations.internal.NoJdbcTypeDescriptor;
import org.hibernate.annotations.internal.NoMutabilityPlan;
import org.hibernate.annotations.internal.NoUserType;
import org.hibernate.boot.model.TypeDefinition;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
@ -1099,10 +1095,6 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
return null;
}
if ( NoUserType.class.isAssignableFrom( userType ) ) {
return null;
}
return userType;
}
@ -1111,10 +1103,6 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
return null;
}
if ( NoJdbcTypeDescriptor.class.isAssignableFrom( jdbcType ) ) {
return null;
}
return jdbcType;
}
@ -1123,10 +1111,6 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
return null;
}
if ( NoJavaTypeDescriptor.class.isAssignableFrom( javaType ) ) {
return null;
}
return javaType;
}
@ -1135,10 +1119,6 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
return null;
}
if ( NoMutabilityPlan.class.isAssignableFrom( mutability ) ) {
return null;
}
return mutability;
}