HHH-16741 Fully remove the deprecated method getJdbcMappings()

This commit is contained in:
Sanne Grinovero 2023-06-02 16:22:05 +01:00 committed by Sanne Grinovero
parent 03132883f4
commit 7c089a5c4b
26 changed files with 14 additions and 247 deletions

View File

@ -6,14 +6,11 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.generator.Generator;
import org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping;
import org.hibernate.property.access.spi.PropertyAccess;
import org.hibernate.sql.results.graph.DatabaseSnapshotContributor;
import org.hibernate.sql.results.graph.Fetchable;
import org.hibernate.generator.Generator;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.java.MutabilityPlan;
import org.hibernate.type.descriptor.java.MutabilityPlanExposer;
@ -122,12 +119,4 @@ public interface AttributeMapping
return false;
}
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
}

View File

@ -6,9 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.metamodel.mapping.internal.SingleAttributeIdentifierMapping;
/**
@ -28,12 +25,4 @@ public interface BasicEntityIdentifierMapping extends SingleAttributeIdentifierM
@Override
boolean isInsertable();
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
}

View File

@ -6,10 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import org.hibernate.cache.MutableCacheKeyBuilder;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
@ -31,12 +27,6 @@ public interface BasicValuedMapping extends ValueMapping, SqlExpressible {
return 1;
}
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
return Collections.singletonList( getJdbcMapping() );
}
@Override
default JdbcMapping getJdbcMapping(int index) {
if ( index != 0 ) {

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.List;
import org.hibernate.sql.results.graph.Fetchable;
/**
@ -30,12 +28,6 @@ public interface BasicValuedModelPart extends BasicValuedMapping, ValuedModelPar
return 1;
}
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
return BasicValuedMapping.super.getJdbcMappings();
}
@Override
default JdbcMapping getJdbcMapping(int index) {
return BasicValuedMapping.super.getJdbcMapping( index );

View File

@ -6,9 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.Incubating;
import org.hibernate.cache.MutableCacheKeyBuilder;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
@ -31,19 +28,6 @@ public interface Bindable extends JdbcMappingContainer {
return forEachJdbcType( (index, jdbcMapping) -> {} );
}
/**
* The list of JDBC mappings
* @deprecated Prefer using {@link #getJdbcMapping(int)} or {@link #forEachJdbcType(IndexedConsumer)}
* and its variations.
*/
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachJdbcType( (index, jdbcMapping) -> results.add( jdbcMapping ) );
return results;
}
/**
* Visit each of JdbcMapping
*

View File

@ -6,7 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.List;
import java.util.function.BiConsumer;
import org.hibernate.internal.util.IndexedConsumer;
@ -217,10 +216,6 @@ public interface EmbeddableMappingType extends ManagedMappingType, SelectableMap
@Override
int getJdbcTypeCount();
@Deprecated(forRemoval = true)
@Override
List<JdbcMapping> getJdbcMappings();
@Override
int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action);

View File

@ -6,7 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.List;
import java.util.function.Consumer;
import org.hibernate.cache.MutableCacheKeyBuilder;
@ -63,12 +62,6 @@ public interface EmbeddableValuedModelPart extends ValuedModelPart, Fetchable, F
return getEmbeddableTypeDescriptor().getJdbcTypeCount();
}
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
return getEmbeddableTypeDescriptor().getJdbcMappings();
}
@Override
default JdbcMapping getJdbcMapping(int index) {
return getEmbeddableTypeDescriptor().getJdbcMapping( index );

View File

@ -6,15 +6,12 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.Collections;
import java.util.List;
import org.hibernate.Incubating;
import org.hibernate.internal.util.IndexedConsumer;
import org.hibernate.type.descriptor.converter.spi.BasicValueConverter;
import org.hibernate.query.sqm.CastType;
import org.hibernate.type.descriptor.ValueBinder;
import org.hibernate.type.descriptor.ValueExtractor;
import org.hibernate.type.descriptor.converter.spi.BasicValueConverter;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter;
import org.hibernate.type.descriptor.jdbc.JdbcType;
@ -131,12 +128,6 @@ public interface JdbcMapping extends MappingType, JdbcMappingContainer {
return 1;
}
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
return Collections.singletonList( this );
}
@Override
default JdbcMapping getJdbcMapping(int index) {
if ( index != 0 ) {

View File

@ -6,9 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.internal.util.IndexedConsumer;
/**
@ -22,18 +19,6 @@ public interface JdbcMappingContainer {
return forEachJdbcType( (index, jdbcMapping) -> {} );
}
/**
* The list of JDBC mappings
* @deprecated Prefer using {@link #getJdbcMapping(int)} or {@link #forEachJdbcType(IndexedConsumer)}
* and its variations.
*/
@Deprecated(forRemoval = true)
default List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachJdbcType( (index, jdbcMapping) -> results.add( jdbcMapping ) );
return results;
}
JdbcMapping getJdbcMapping(int index);
default JdbcMapping getSingleJdbcMapping() {

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
@ -188,12 +186,4 @@ public interface PluralAttributeMapping
return true;
}
@Override
@Deprecated(forRemoval = true)
default List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachJdbcType( (index, jdbcMapping) -> results.add( jdbcMapping ) );
return results;
}
}

View File

@ -6,9 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.ArrayList;
import java.util.List;
/**
* A container for multiple selectable (column, formula) mappings.
*
@ -45,16 +42,4 @@ public interface SelectableMappings {
return forEachSelectable( 0, consumer );
}
/**
* Obtain the JdbcMappings for the underlying selectable mappings
*
* @see SelectableMapping#getJdbcMapping()
* @deprecated
*/
@Deprecated(forRemoval = true)
default List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
}

View File

@ -6,9 +6,6 @@
*/
package org.hibernate.metamodel.mapping;
import java.util.ArrayList;
import java.util.List;
/**
* Describes a ModelPart that is also a ValueMapping (and therefore also a SelectableMappings).
* <p/>
@ -79,11 +76,4 @@ public interface ValuedModelPart extends ModelPart, ValueMapping, SelectableMapp
);
}
@Override
@Deprecated(forRemoval = true)
default List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
}

View File

@ -536,12 +536,6 @@ public abstract class AbstractEmbeddableMapping implements EmbeddableMappingType
);
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return getSelectableMappings().getJdbcMappings();
}
@Override
public JdbcMapping getJdbcMapping(int index) {
return getSelectable( index ).getJdbcMapping();

View File

@ -6,18 +6,14 @@
*/
package org.hibernate.metamodel.mapping.internal;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.engine.FetchStyle;
import org.hibernate.engine.FetchTiming;
import org.hibernate.generator.Generator;
import org.hibernate.metamodel.mapping.AttributeMetadata;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.ManagedMappingType;
import org.hibernate.metamodel.mapping.SingularAttributeMapping;
import org.hibernate.property.access.spi.PropertyAccess;
import org.hibernate.sql.results.graph.FetchOptions;
import org.hibernate.generator.Generator;
/**
* @author Steve Ebersole
@ -71,11 +67,4 @@ public abstract class AbstractSingularAttributeMapping
return findContainingEntityMapping().getEntityPersister().getEntityMetamodel().getGenerators()[getStateArrayPosition()];
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
}

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.metamodel.mapping.internal;
import java.util.Collections;
import java.util.List;
import java.util.function.BiConsumer;
import org.hibernate.engine.FetchStyle;
@ -288,12 +286,6 @@ public class AnyKeyPart implements BasicValuedModelPart, FetchOptions {
return getJdbcTypeCount();
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return Collections.singletonList( jdbcMapping );
}
@Override
public JdbcMapping getJdbcMapping(int index) {
if ( index != 0 ) {

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.metamodel.mapping.internal;
import java.util.Collections;
import java.util.List;
import java.util.function.BiConsumer;
import org.hibernate.engine.FetchStyle;
@ -281,12 +279,6 @@ public class BasicValuedCollectionPart
);
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return Collections.singletonList( getJdbcMapping() );
}
@Override
public JdbcMapping getJdbcMapping(int index) {
if ( index != 0 ) {

View File

@ -376,12 +376,6 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
return jdbcMappings.size();
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return jdbcMappings;
}
@Override
public JdbcMapping getJdbcMapping(int index) {
return jdbcMappings.get( index );

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.metamodel.mapping.internal;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiConsumer;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
@ -23,7 +21,6 @@ import org.hibernate.spi.NavigablePath;
import org.hibernate.sql.ast.spi.SqlSelection;
import org.hibernate.sql.ast.tree.from.TableGroup;
import org.hibernate.sql.results.graph.DomainResultCreationState;
import org.hibernate.sql.results.graph.Fetchable;
/**
* Support for {@link jakarta.persistence.EmbeddedId}
@ -121,12 +118,4 @@ public class EmbeddedIdentifierMappingImpl
return name;
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
}

View File

@ -562,13 +562,6 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa
return associationKey;
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return Collections.singletonList( targetSide.getModelPart().getJdbcMapping() );
}
@Override
public JdbcMapping getJdbcMapping(int index) {
if ( index != 0 ) {

View File

@ -18,10 +18,17 @@ import org.hibernate.engine.spi.PersistenceContext;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.util.IndexedConsumer;
import org.hibernate.loader.ast.internal.*;
import org.hibernate.loader.ast.internal.MultiNaturalIdLoaderArrayParam;
import org.hibernate.loader.ast.internal.MultiNaturalIdLoaderInPredicate;
import org.hibernate.loader.ast.internal.SimpleNaturalIdLoader;
import org.hibernate.loader.ast.spi.MultiNaturalIdLoader;
import org.hibernate.loader.ast.spi.NaturalIdLoader;
import org.hibernate.metamodel.mapping.*;
import org.hibernate.metamodel.mapping.AttributeMapping;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingType;
import org.hibernate.metamodel.mapping.SelectableConsumer;
import org.hibernate.metamodel.mapping.SingularAttributeMapping;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.spi.NavigablePath;
import org.hibernate.sql.ast.spi.SqlSelection;
@ -224,12 +231,6 @@ public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements
return attribute.getJdbcTypeCount();
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return attribute.getJdbcMappings();
}
@Override
public JdbcMapping getJdbcMapping(int index) {
return attribute.getJdbcMapping( index );

View File

@ -287,14 +287,6 @@ public class AnonymousTupleEmbeddableValuedModelPart implements EmbeddableValued
return getSelectable( index ).getJdbcMapping();
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
@Override
public int forEachSelectable(SelectableConsumer consumer) {
return forEachSelectable( 0, consumer );

View File

@ -214,14 +214,6 @@ public class AnonymousTupleEntityValuedModelPart
.setValue( instance, value );
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachSelectable( (index, selection) -> results.add( selection.getJdbcMapping() ) );
return results;
}
@Override
public JdbcMapping getJdbcMapping(int index) {
return identifierMapping.getJdbcMapping( index );

View File

@ -6,7 +6,6 @@
*/
package org.hibernate.query.derived;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@ -346,14 +345,6 @@ public class AnonymousTupleTableGroupProducer implements TableGroupProducer, Map
throw new UnsupportedOperationException( "Not yet implemented" );
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
final List<JdbcMapping> results = new ArrayList<>();
forEachJdbcType( (index, jdbcMapping) -> results.add( jdbcMapping ) );
return results;
}
@Override
public Object disassemble(Object value, SharedSessionContractImplementor session) {
throw new UnsupportedOperationException( "Not yet implemented" );

View File

@ -6,14 +6,12 @@
*/
package org.hibernate.sql.ast.tree.expression;
import java.util.List;
import org.hibernate.cache.MutableCacheKeyBuilder;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.util.IndexedConsumer;
import org.hibernate.metamodel.mapping.DiscriminatorType;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingModelExpressible;
import org.hibernate.metamodel.mapping.DiscriminatorType;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.Queryable;
import org.hibernate.query.sqm.sql.internal.DomainResultProducer;
@ -55,12 +53,6 @@ public class EntityTypeLiteral
return discriminatorType.getJdbcTypeCount();
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return discriminatorType.getJdbcMappings();
}
@Override
public JdbcMapping getJdbcMapping(int index) {
return discriminatorType.getJdbcMapping( index );

View File

@ -9,8 +9,6 @@ package org.hibernate.sql.ast.tree.expression;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Collections;
import java.util.List;
import org.hibernate.cache.MutableCacheKeyBuilder;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
@ -92,12 +90,6 @@ public class JdbcLiteral<T> implements Literal, MappingModelExpressible<T>, Doma
return 1;
}
@Deprecated(forRemoval = true)
@Override
public List<JdbcMapping> getJdbcMappings() {
return Collections.singletonList( jdbcMapping );
}
@Override
public JdbcMapping getJdbcMapping(int index) {
if ( index != 0 ) {

View File

@ -6,9 +6,6 @@
*/
package org.hibernate.type;
import java.util.Collections;
import java.util.List;
import org.hibernate.Incubating;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.spi.SessionFactoryImplementor;
@ -17,10 +14,10 @@ import org.hibernate.internal.util.IndexedConsumer;
import org.hibernate.metamodel.mapping.BasicValuedMapping;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.MappingType;
import org.hibernate.type.descriptor.converter.spi.BasicValueConverter;
import org.hibernate.metamodel.model.domain.BasicDomainType;
import org.hibernate.type.descriptor.ValueBinder;
import org.hibernate.type.descriptor.ValueExtractor;
import org.hibernate.type.descriptor.converter.spi.BasicValueConverter;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter;
@ -68,12 +65,6 @@ public interface BasicType<T> extends Type, BasicDomainType<T>, MappingType, Bas
return 1;
}
@Deprecated(forRemoval = true)
@Override
default List<JdbcMapping> getJdbcMappings() {
return Collections.singletonList( this );
}
@Override
default JdbcMapping getJdbcMapping(int index) {
if ( index != 0 ) {