HHH-13828 - Remove EntityPersister's extension of `InFlightEntityMappingType` which is considered an "internal" contract
This commit is contained in:
parent
92aa612f4e
commit
fb087dfd72
|
@ -79,6 +79,8 @@ public interface EntityMappingType extends ManagedMappingType, EntityValuedModel
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void visitQuerySpaces(Consumer<String> querySpaceConsumer);
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// Inheritance
|
// Inheritance
|
||||||
|
|
|
@ -62,13 +62,17 @@ public class MappingModelCreationProcess {
|
||||||
*/
|
*/
|
||||||
private void execute() {
|
private void execute() {
|
||||||
for ( EntityPersister entityPersister : entityPersisterMap.values() ) {
|
for ( EntityPersister entityPersister : entityPersisterMap.values() ) {
|
||||||
entityPersister.linkWithSuperType( this );
|
if ( entityPersister instanceof InFlightEntityMappingType ) {
|
||||||
|
( (InFlightEntityMappingType) entityPersister ).linkWithSuperType( this );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( EntityPersister entityPersister : entityPersisterMap.values() ) {
|
for ( EntityPersister entityPersister : entityPersisterMap.values() ) {
|
||||||
currentlyProcessingRole = entityPersister.getEntityName();
|
currentlyProcessingRole = entityPersister.getEntityName();
|
||||||
|
|
||||||
entityPersister.prepareMappingModel( this );
|
if ( entityPersister instanceof InFlightEntityMappingType ) {
|
||||||
|
( (InFlightEntityMappingType) entityPersister ).prepareMappingModel( this );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MappingModelCreationLogger.LOGGER.debugf( "Starting generic post-init callbacks" );
|
MappingModelCreationLogger.LOGGER.debugf( "Starting generic post-init callbacks" );
|
||||||
|
|
|
@ -230,7 +230,8 @@ import org.hibernate.type.spi.TypeConfiguration;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractEntityPersister
|
public abstract class AbstractEntityPersister
|
||||||
implements OuterJoinLoadable, Queryable, ClassMetadata, UniqueKeyLoadable,
|
implements OuterJoinLoadable, Queryable, ClassMetadata, UniqueKeyLoadable,
|
||||||
SQLLoadable, LazyPropertyInitializer, PostInsertIdentityPersister, Lockable, org.hibernate.persister.entity.Queryable {
|
SQLLoadable, LazyPropertyInitializer, PostInsertIdentityPersister, Lockable,
|
||||||
|
org.hibernate.persister.entity.Queryable, InFlightEntityMappingType {
|
||||||
|
|
||||||
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( AbstractEntityPersister.class );
|
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( AbstractEntityPersister.class );
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ package org.hibernate.persister.entity;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
|
@ -33,7 +34,6 @@ import org.hibernate.internal.TableGroupFilterAliasGenerator;
|
||||||
import org.hibernate.loader.ast.spi.Loadable;
|
import org.hibernate.loader.ast.spi.Loadable;
|
||||||
import org.hibernate.metadata.ClassMetadata;
|
import org.hibernate.metadata.ClassMetadata;
|
||||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||||
import org.hibernate.metamodel.mapping.EntityValuedModelPart;
|
|
||||||
import org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType;
|
import org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType;
|
||||||
import org.hibernate.metamodel.spi.EntityRepresentationStrategy;
|
import org.hibernate.metamodel.spi.EntityRepresentationStrategy;
|
||||||
import org.hibernate.persister.walking.spi.EntityDefinition;
|
import org.hibernate.persister.walking.spi.EntityDefinition;
|
||||||
|
@ -77,7 +77,8 @@ import org.hibernate.type.VersionType;
|
||||||
* @see org.hibernate.persister.spi.PersisterFactory
|
* @see org.hibernate.persister.spi.PersisterFactory
|
||||||
* @see org.hibernate.persister.spi.PersisterClassResolver
|
* @see org.hibernate.persister.spi.PersisterClassResolver
|
||||||
*/
|
*/
|
||||||
public interface EntityPersister extends EntityDefinition, InFlightEntityMappingType, Loadable, RootTableGroupProducer {
|
public interface EntityPersister
|
||||||
|
extends EntityMappingType, Loadable, RootTableGroupProducer, EntityDefinition {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The property name of the "special" identifier property in HQL
|
* The property name of the "special" identifier property in HQL
|
||||||
|
@ -89,18 +90,13 @@ public interface EntityPersister extends EntityDefinition, InFlightEntityMapping
|
||||||
* entity persisters before calling {@link #postInstantiate()}.
|
* entity persisters before calling {@link #postInstantiate()}.
|
||||||
*
|
*
|
||||||
* @deprecated The legacy "walking model" is deprecated in favor of the newer "mapping model".
|
* @deprecated The legacy "walking model" is deprecated in favor of the newer "mapping model".
|
||||||
* This method is no longer called by Hibernate. See {@link #prepareMappingModel} instead
|
* This method is no longer called by Hibernate. See {@link InFlightEntityMappingType#prepareMappingModel} instead
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
void generateEntityDefinition();
|
void generateEntityDefinition();
|
||||||
|
|
||||||
@Override
|
|
||||||
default int getNumberOfFetchables() {
|
|
||||||
return getNumberOfAttributeMappings();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finish the initialization of this object. {@link #prepareMappingModel}
|
* Finish the initialization of this object. {@link InFlightEntityMappingType#prepareMappingModel}
|
||||||
* must be called for all entity persisters before calling this method.
|
* must be called for all entity persisters before calling this method.
|
||||||
* <p/>
|
* <p/>
|
||||||
* Called only once per {@link org.hibernate.SessionFactory} lifecycle,
|
* Called only once per {@link org.hibernate.SessionFactory} lifecycle,
|
||||||
|
@ -122,18 +118,6 @@ public interface EntityPersister extends EntityDefinition, InFlightEntityMapping
|
||||||
return SqlAliasStemHelper.INSTANCE.generateStemFromEntityName( getEntityName() );
|
return SqlAliasStemHelper.INSTANCE.generateStemFromEntityName( getEntityName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
default int getNumberOfAttributeMappings() {
|
|
||||||
// for backwards-compatibility
|
|
||||||
return getAttributeMappings().size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
default int getNumberOfDeclaredAttributeMappings() {
|
|
||||||
// for backwards-compatibility
|
|
||||||
return getAttributeMappings().size();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// stuff that is persister-centric and/or EntityInfo-centric ~~~~~~~~~~~~~~
|
// stuff that is persister-centric and/or EntityInfo-centric ~~~~~~~~~~~~~~
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -237,6 +221,13 @@ public interface EntityPersister extends EntityDefinition, InFlightEntityMapping
|
||||||
return (String[]) getQuerySpaces();
|
return (String[]) getQuerySpaces();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default void visitQuerySpaces(Consumer<String> querySpaceConsumer) {
|
||||||
|
final String[] spaces = getSynchronizedQuerySpaces();
|
||||||
|
for ( int i = 0; i < spaces.length; i++ ) {
|
||||||
|
querySpaceConsumer.accept( spaces[ i ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether this entity supports dynamic proxies.
|
* Determine whether this entity supports dynamic proxies.
|
||||||
*
|
*
|
||||||
|
|
|
@ -676,16 +676,6 @@ public class PersisterClassProviderTest {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void linkWithSuperType(MappingModelCreationProcess creationProcess) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void prepareMappingModel(MappingModelCreationProcess creationProcess) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityIdentifierMapping getIdentifierMapping() {
|
public EntityIdentifierMapping getIdentifierMapping() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -698,16 +698,6 @@ public class GoofyPersisterClassProvider implements PersisterClassResolver {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void linkWithSuperType(MappingModelCreationProcess creationProcess) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void prepareMappingModel(MappingModelCreationProcess creationProcess) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public java.util.Collection<AttributeMapping> getAttributeMappings() {
|
public java.util.Collection<AttributeMapping> getAttributeMappings() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -810,16 +810,6 @@ public class CustomPersister implements EntityPersister {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void linkWithSuperType(MappingModelCreationProcess creationProcess) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void prepareMappingModel(MappingModelCreationProcess creationProcess) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<AttributeMapping> getAttributeMappings() {
|
public Collection<AttributeMapping> getAttributeMappings() {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue