HHH-15923 - Clean-up the org.hibernate.loader package
HHH-15799 - API/internal split for org.hibernate.cfg package and some minor Javadoc work
This commit is contained in:
parent
98174c86d2
commit
32cc739f39
|
@ -6,18 +6,18 @@
|
|||
*/
|
||||
package org.hibernate.annotations;
|
||||
|
||||
import org.hibernate.property.access.spi.PropertyAccessStrategy;
|
||||
import org.hibernate.binder.internal.AttributeAccessorBinder;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.hibernate.binder.internal.AttributeAccessorBinder;
|
||||
import org.hibernate.property.access.spi.PropertyAccessStrategy;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* Names a persistent property access strategy ({@link PropertyAccessStrategy}) to use.
|
||||
* Specifies an attribute {@linkplain PropertyAccessStrategy access strategy} to use.
|
||||
* <p>
|
||||
* Can be specified at either:<ul>
|
||||
* <li>
|
||||
|
|
|
@ -40,7 +40,7 @@ public class BeanValidationIntegrator implements Integrator {
|
|||
public static final String MODE_PROPERTY = "javax.persistence.validation.mode";
|
||||
public static final String JAKARTA_MODE_PROPERTY = "jakarta.persistence.validation.mode";
|
||||
|
||||
private static final String ACTIVATOR_CLASS_NAME = "org.hibernate.cfg.beanvalidation.TypeSafeActivator";
|
||||
private static final String ACTIVATOR_CLASS_NAME = "org.hibernate.boot.beanvalidation.TypeSafeActivator";
|
||||
private static final String VALIDATE_SUPPLIED_FACTORY_METHOD_NAME = "validateSuppliedFactory";
|
||||
private static final String ACTIVATE_METHOD_NAME = "activate";
|
||||
|
||||
|
|
|
@ -15,13 +15,13 @@ import org.hibernate.annotations.common.reflection.XProperty;
|
|||
import org.hibernate.boot.spi.MetadataBuildingContext;
|
||||
import org.hibernate.boot.spi.PropertyData;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.loader.PropertyPath;
|
||||
import org.hibernate.mapping.Component;
|
||||
import org.hibernate.mapping.Join;
|
||||
import org.hibernate.mapping.KeyValue;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.mapping.Property;
|
||||
import org.hibernate.mapping.Table;
|
||||
import org.hibernate.spi.NavigablePath;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Convert;
|
||||
|
@ -352,7 +352,7 @@ public class ComponentPropertyHolder extends AbstractPropertyHolder {
|
|||
}
|
||||
}
|
||||
if ( result == null ) {
|
||||
String userPropertyName = extractUserPropertyName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY, propertyName );
|
||||
String userPropertyName = extractUserPropertyName( NavigablePath.IDENTIFIER_MAPPER_PROPERTY, propertyName );
|
||||
if ( userPropertyName != null ) {
|
||||
result = super.getOverriddenColumn( userPropertyName );
|
||||
}
|
||||
|
|
|
@ -78,7 +78,6 @@ import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
|||
import org.hibernate.engine.spi.FilterDefinition;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
import org.hibernate.jpa.event.spi.CallbackType;
|
||||
import org.hibernate.loader.PropertyPath;
|
||||
import org.hibernate.mapping.BasicValue;
|
||||
import org.hibernate.mapping.Component;
|
||||
import org.hibernate.mapping.DependantValue;
|
||||
|
@ -96,6 +95,7 @@ import org.hibernate.mapping.TableOwner;
|
|||
import org.hibernate.mapping.UnionSubclass;
|
||||
import org.hibernate.mapping.Value;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.spi.NavigablePath;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
|
@ -382,7 +382,7 @@ public class EntityBinder {
|
|||
propertyAccessor
|
||||
);
|
||||
final Property mapperProperty = new Property();
|
||||
mapperProperty.setName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY );
|
||||
mapperProperty.setName( NavigablePath.IDENTIFIER_MAPPER_PROPERTY );
|
||||
mapperProperty.setUpdateable( false );
|
||||
mapperProperty.setInsertable( false );
|
||||
mapperProperty.setPropertyAccessorName( "embedded" );
|
||||
|
@ -404,7 +404,7 @@ public class EntityBinder {
|
|||
propertyHolder,
|
||||
new PropertyPreloadedData(
|
||||
propertyAccessor,
|
||||
PropertyPath.IDENTIFIER_MAPPER_PROPERTY,
|
||||
NavigablePath.IDENTIFIER_MAPPER_PROPERTY,
|
||||
compositeClass
|
||||
),
|
||||
baseInferredData,
|
||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.boot.model.naming;
|
|||
|
||||
import org.hibernate.boot.model.source.spi.AttributePath;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.loader.PropertyPath;
|
||||
import org.hibernate.spi.NavigablePath;
|
||||
|
||||
/**
|
||||
* An ImplicitNamingStrategy implementation which uses full composite paths
|
||||
|
@ -37,7 +37,7 @@ public class ImplicitNamingStrategyComponentPathImpl extends ImplicitNamingStrat
|
|||
process( parent, sb );
|
||||
sb.append( '_' );
|
||||
}
|
||||
else if ( PropertyPath.IDENTIFIER_MAPPER_PROPERTY.equals( property ) ) {
|
||||
else if ( NavigablePath.IDENTIFIER_MAPPER_PROPERTY.equals( property ) ) {
|
||||
// skip it, do not pass go
|
||||
sb.append( "id" );
|
||||
return;
|
||||
|
|
|
@ -111,7 +111,6 @@ import org.hibernate.internal.log.DeprecationLogger;
|
|||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||
import org.hibernate.internal.util.config.ConfigurationHelper;
|
||||
import org.hibernate.loader.PropertyPath;
|
||||
import org.hibernate.mapping.Any;
|
||||
import org.hibernate.mapping.Array;
|
||||
import org.hibernate.mapping.AttributeContainer;
|
||||
|
@ -148,6 +147,7 @@ import org.hibernate.mapping.UniqueKey;
|
|||
import org.hibernate.mapping.Value;
|
||||
import org.hibernate.resource.beans.spi.ManagedBean;
|
||||
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
|
||||
import org.hibernate.spi.NavigablePath;
|
||||
import org.hibernate.tuple.GenerationTiming;
|
||||
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
|
||||
import org.hibernate.type.BasicType;
|
||||
|
@ -850,7 +850,7 @@ public class ModelBinder {
|
|||
return identifierSource.getEmbeddableSource().getTypeDescriptor().getName();
|
||||
}
|
||||
|
||||
private static final String ID_MAPPER_PATH_PART = '<' + PropertyPath.IDENTIFIER_MAPPER_PROPERTY + '>';
|
||||
private static final String ID_MAPPER_PATH_PART = '<' + NavigablePath.IDENTIFIER_MAPPER_PROPERTY + '>';
|
||||
|
||||
private void bindNonAggregatedCompositeEntityIdentifier(
|
||||
MappingDocument mappingDocument,
|
||||
|
@ -899,7 +899,7 @@ public class ModelBinder {
|
|||
rootEntityDescriptor.setIdentifierMapper( mapper );
|
||||
rootEntityDescriptor.setDeclaredIdentifierMapper( mapper );
|
||||
Property property = new Property();
|
||||
property.setName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY );
|
||||
property.setName( NavigablePath.IDENTIFIER_MAPPER_PROPERTY );
|
||||
property.setUpdateable( false );
|
||||
property.setInsertable( false );
|
||||
property.setValue( mapper );
|
||||
|
|
|
@ -24,8 +24,8 @@ import org.hibernate.event.spi.LoadEvent;
|
|||
import org.hibernate.event.spi.LoadEventListener;
|
||||
import org.hibernate.internal.CoreLogging;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
import org.hibernate.loader.entity.CacheEntityLoaderHelper;
|
||||
import org.hibernate.loader.entity.CacheEntityLoaderHelper.PersistenceContextEntry;
|
||||
import org.hibernate.loader.ast.internal.CacheEntityLoaderHelper;
|
||||
import org.hibernate.loader.ast.internal.CacheEntityLoaderHelper.PersistenceContextEntry;
|
||||
import org.hibernate.metamodel.mapping.AttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.CompositeIdentifierMapping;
|
||||
import org.hibernate.metamodel.mapping.EmbeddableMappingType;
|
||||
|
|
|
@ -9,7 +9,6 @@ package org.hibernate.id;
|
|||
import java.util.Properties;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.TransientObjectException;
|
||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||
import org.hibernate.id.factory.spi.StandardGenerator;
|
||||
|
@ -22,7 +21,7 @@ import org.hibernate.type.Type;
|
|||
import static org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved;
|
||||
import static org.hibernate.id.IdentifierGeneratorHelper.SHORT_CIRCUIT_INDICATOR;
|
||||
import static org.hibernate.internal.CoreLogging.messageLogger;
|
||||
import static org.hibernate.loader.PropertyPath.IDENTIFIER_MAPPER_PROPERTY;
|
||||
import static org.hibernate.spi.NavigablePath.IDENTIFIER_MAPPER_PROPERTY;
|
||||
|
||||
/**
|
||||
* <b>foreign</b>
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import jakarta.persistence.metamodel.Metamodel;
|
||||
import org.hibernate.CacheMode;
|
||||
import org.hibernate.ConnectionAcquisitionMode;
|
||||
import org.hibernate.FetchNotFoundException;
|
||||
|
@ -53,6 +52,7 @@ import org.hibernate.TransientObjectException;
|
|||
import org.hibernate.TypeMismatchException;
|
||||
import org.hibernate.UnknownProfileException;
|
||||
import org.hibernate.UnresolvableObjectException;
|
||||
import org.hibernate.binder.internal.TenantIdBinder;
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.collection.spi.PersistentCollection;
|
||||
import org.hibernate.context.spi.CurrentTenantIdentifierResolver;
|
||||
|
@ -72,12 +72,11 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
|||
import org.hibernate.engine.spi.Status;
|
||||
import org.hibernate.engine.transaction.spi.TransactionImplementor;
|
||||
import org.hibernate.engine.transaction.spi.TransactionObserver;
|
||||
import org.hibernate.event.spi.DeleteContext;
|
||||
import org.hibernate.event.spi.MergeContext;
|
||||
import org.hibernate.event.spi.AutoFlushEvent;
|
||||
import org.hibernate.event.spi.AutoFlushEventListener;
|
||||
import org.hibernate.event.spi.ClearEvent;
|
||||
import org.hibernate.event.spi.ClearEventListener;
|
||||
import org.hibernate.event.spi.DeleteContext;
|
||||
import org.hibernate.event.spi.DeleteEvent;
|
||||
import org.hibernate.event.spi.DeleteEventListener;
|
||||
import org.hibernate.event.spi.DirtyCheckEvent;
|
||||
|
@ -94,6 +93,7 @@ import org.hibernate.event.spi.LoadEventListener;
|
|||
import org.hibernate.event.spi.LoadEventListener.LoadType;
|
||||
import org.hibernate.event.spi.LockEvent;
|
||||
import org.hibernate.event.spi.LockEventListener;
|
||||
import org.hibernate.event.spi.MergeContext;
|
||||
import org.hibernate.event.spi.MergeEvent;
|
||||
import org.hibernate.event.spi.MergeEventListener;
|
||||
import org.hibernate.event.spi.PersistContext;
|
||||
|
@ -118,10 +118,10 @@ import org.hibernate.jpa.internal.util.ConfigurationHelper;
|
|||
import org.hibernate.jpa.internal.util.FlushModeTypeHelper;
|
||||
import org.hibernate.jpa.internal.util.LockModeTypeHelper;
|
||||
import org.hibernate.jpa.internal.util.LockOptionsHelper;
|
||||
import org.hibernate.loader.access.IdentifierLoadAccessImpl;
|
||||
import org.hibernate.loader.access.LoadAccessContext;
|
||||
import org.hibernate.loader.access.NaturalIdLoadAccessImpl;
|
||||
import org.hibernate.loader.access.SimpleNaturalIdLoadAccessImpl;
|
||||
import org.hibernate.loader.internal.IdentifierLoadAccessImpl;
|
||||
import org.hibernate.loader.internal.LoadAccessContext;
|
||||
import org.hibernate.loader.internal.NaturalIdLoadAccessImpl;
|
||||
import org.hibernate.loader.internal.SimpleNaturalIdLoadAccessImpl;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.pretty.MessageHelper;
|
||||
import org.hibernate.procedure.ProcedureCall;
|
||||
|
@ -141,7 +141,7 @@ import org.hibernate.resource.transaction.spi.TransactionStatus;
|
|||
import org.hibernate.stat.SessionStatistics;
|
||||
import org.hibernate.stat.internal.SessionStatisticsImpl;
|
||||
import org.hibernate.stat.spi.StatisticsImplementor;
|
||||
import org.hibernate.binder.internal.TenantIdBinder;
|
||||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
|
||||
import jakarta.persistence.CacheRetrieveMode;
|
||||
import jakarta.persistence.CacheStoreMode;
|
||||
|
@ -152,14 +152,14 @@ import jakarta.persistence.FlushModeType;
|
|||
import jakarta.persistence.LockModeType;
|
||||
import jakarta.persistence.PersistenceException;
|
||||
import jakarta.persistence.TransactionRequiredException;
|
||||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
import jakarta.persistence.metamodel.Metamodel;
|
||||
|
||||
import static org.hibernate.CacheMode.fromJpaModes;
|
||||
import static org.hibernate.cfg.AvailableSettings.CRITERIA_COPY_TREE;
|
||||
import static org.hibernate.cfg.AvailableSettings.JAKARTA_LOCK_SCOPE;
|
||||
import static org.hibernate.cfg.AvailableSettings.JAKARTA_LOCK_TIMEOUT;
|
||||
import static org.hibernate.cfg.AvailableSettings.JAKARTA_SHARED_CACHE_RETRIEVE_MODE;
|
||||
import static org.hibernate.cfg.AvailableSettings.JAKARTA_SHARED_CACHE_STORE_MODE;
|
||||
import static org.hibernate.cfg.AvailableSettings.CRITERIA_COPY_TREE;
|
||||
import static org.hibernate.cfg.AvailableSettings.JPA_LOCK_SCOPE;
|
||||
import static org.hibernate.cfg.AvailableSettings.JPA_LOCK_TIMEOUT;
|
||||
import static org.hibernate.cfg.AvailableSettings.JPA_SHARED_CACHE_RETRIEVE_MODE;
|
||||
|
|
|
@ -1,26 +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.loader;
|
||||
|
||||
import org.hibernate.SharedSessionContract;
|
||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||
|
||||
/**
|
||||
* Listener for post load-by-natural-id events
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface NaturalIdPostLoadListener {
|
||||
/**
|
||||
* Singleton access for no listener
|
||||
*/
|
||||
NaturalIdPostLoadListener NO_OP = (loadingEntity, entity, session) -> {};
|
||||
|
||||
/**
|
||||
* Callback for a load-by-natural-id pre event
|
||||
*/
|
||||
void completedLoadByNaturalId(EntityMappingType entityMappingType, Object entity, SharedSessionContract session);
|
||||
}
|
|
@ -1,26 +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.loader;
|
||||
|
||||
import org.hibernate.SharedSessionContract;
|
||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||
|
||||
/**
|
||||
* Listener for pre load-by-natural-id events
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface NaturalIdPreLoadListener {
|
||||
/**
|
||||
* Singleton access for no listener
|
||||
*/
|
||||
NaturalIdPreLoadListener NO_OP = (loadingEntity, naturalId, session) -> {};
|
||||
|
||||
/**
|
||||
* Callback for a load-by-natural-id pre event
|
||||
*/
|
||||
void startingLoadByNaturalId(EntityMappingType loadingEntity, Object naturalId, SharedSessionContract session);
|
||||
}
|
|
@ -9,6 +9,11 @@ package org.hibernate.loader;
|
|||
import org.hibernate.HibernateException;
|
||||
|
||||
/**
|
||||
* Thrown when Hibernate encounters a non-unique SQL alias in the ResultSet
|
||||
* while processing the results of a {@linkplain org.hibernate.query.NativeQuery}
|
||||
* using auto-discovery to understand the {@linkplain java.sql.ResultSetMetaData ResultSet metadata}
|
||||
* for mapping the JDBC values to the domain result.
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public class NonUniqueDiscoveredSqlAliasException extends HibernateException {
|
||||
|
|
|
@ -12,7 +12,11 @@ import org.hibernate.spi.NavigablePath;
|
|||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*
|
||||
* @deprecated Use {@link NavigablePath} or {@link org.hibernate.metamodel.model.domain.NavigableRole}
|
||||
* instead, depending on need.
|
||||
*/
|
||||
@Deprecated(since = "6", forRemoval = true)
|
||||
public class PropertyPath implements DotIdentifierSequence {
|
||||
public static final String IDENTIFIER_MAPPER_PROPERTY = NavigablePath.IDENTIFIER_MAPPER_PROPERTY;
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
|||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||
import org.hibernate.loader.ast.spi.Loadable;
|
||||
import org.hibernate.loader.ast.spi.NaturalIdLoadOptions;
|
||||
import org.hibernate.loader.ast.spi.NaturalIdLoader;
|
||||
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
||||
|
@ -30,7 +29,6 @@ import org.hibernate.metamodel.mapping.NaturalIdMapping;
|
|||
import org.hibernate.metamodel.mapping.SelectableMapping;
|
||||
import org.hibernate.query.internal.SimpleQueryOptions;
|
||||
import org.hibernate.query.spi.QueryOptions;
|
||||
import org.hibernate.query.spi.QueryParameterBindings;
|
||||
import org.hibernate.spi.NavigablePath;
|
||||
import org.hibernate.sql.ast.Clause;
|
||||
import org.hibernate.sql.ast.SqlAstTranslatorFactory;
|
||||
|
@ -87,7 +85,7 @@ public abstract class AbstractNaturalIdLoader<T> implements NaturalIdLoader<T> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Loadable getLoadable() {
|
||||
public EntityMappingType getLoadable() {
|
||||
return entityDescriptor();
|
||||
}
|
||||
|
||||
|
@ -177,17 +175,13 @@ public abstract class AbstractNaturalIdLoader<T> implements NaturalIdLoader<T> {
|
|||
|
||||
final SelectStatement sqlSelect = new SelectStatement( rootQuerySpec, Collections.singletonList( domainResult ) );
|
||||
|
||||
final List<JdbcParameter> jdbcParameters = new ArrayList<>( naturalIdMapping.getJdbcTypeCount() );
|
||||
final JdbcParameterBindings jdbcParamBindings = new JdbcParameterBindingsImpl( jdbcParameters.size() );
|
||||
final JdbcParameterBindings jdbcParamBindings = new JdbcParameterBindingsImpl( naturalIdMapping.getJdbcTypeCount() );
|
||||
|
||||
applyNaturalIdRestriction(
|
||||
bindValue,
|
||||
rootTableGroup,
|
||||
rootQuerySpec::applyPredicate,
|
||||
(jdbcParameter, jdbcParameterBinding) -> {
|
||||
jdbcParameters.add( jdbcParameter );
|
||||
jdbcParamBindings.addBinding( jdbcParameter, jdbcParameterBinding );
|
||||
},
|
||||
jdbcParamBindings::addBinding,
|
||||
sqlAstCreationState,
|
||||
session
|
||||
);
|
||||
|
@ -250,7 +244,7 @@ public abstract class AbstractNaturalIdLoader<T> implements NaturalIdLoader<T> {
|
|||
TableGroup rootTableGroup,
|
||||
SelectableMapping selectableMapping,
|
||||
SqlExpressionResolver sqlExpressionResolver,
|
||||
SessionFactoryImplementor sessionFactory) {
|
||||
@SuppressWarnings("unused") SessionFactoryImplementor sessionFactory) {
|
||||
final TableReference tableReference = rootTableGroup.getTableReference( rootTableGroup.getNavigablePath(), selectableMapping.getContainingTableExpression() );
|
||||
if ( tableReference == null ) {
|
||||
throw new IllegalStateException(
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* 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>.
|
||||
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
|
||||
*/
|
||||
package org.hibernate.loader.entity;
|
||||
package org.hibernate.loader.ast.internal;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Incubating;
|
|
@ -31,7 +31,6 @@ import org.hibernate.event.spi.LoadEventListener;
|
|||
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||
import org.hibernate.loader.ast.spi.MultiIdEntityLoader;
|
||||
import org.hibernate.loader.ast.spi.MultiIdLoadOptions;
|
||||
import org.hibernate.loader.entity.CacheEntityLoaderHelper;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* 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.loader.ast.spi;
|
||||
|
||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||
|
||||
/**
|
||||
* Specialization of Loader for loading entities of a type
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public interface EntityLoader extends Loader {
|
||||
@Override
|
||||
EntityMappingType getLoadable();
|
||||
}
|
|
@ -6,14 +6,10 @@
|
|||
*/
|
||||
package org.hibernate.loader.ast.spi;
|
||||
|
||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||
|
||||
/**
|
||||
* Commonality for multi-loading
|
||||
*
|
||||
* @param <T> The loaded model part
|
||||
*/
|
||||
public interface MultiLoader<T> extends Loader {
|
||||
@Override
|
||||
EntityMappingType getLoadable();
|
||||
public interface MultiLoader<T> extends EntityLoader {
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
|||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public interface NaturalIdLoader<T> extends Loader {
|
||||
public interface NaturalIdLoader<T> extends EntityLoader {
|
||||
|
||||
/**
|
||||
* Perform the load of the entity by its natural-id
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.hibernate.metamodel.mapping.EntityMappingType;
|
|||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public interface SingleEntityLoader<T> extends Loader {
|
||||
public interface SingleEntityLoader<T> extends EntityLoader {
|
||||
@Override
|
||||
EntityMappingType getLoadable();
|
||||
|
||||
|
@ -23,8 +23,4 @@ public interface SingleEntityLoader<T> extends Loader {
|
|||
* Load an entity by a primary or unique key value.
|
||||
*/
|
||||
T load(Object key, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session);
|
||||
|
||||
default T load(Object key, LockOptions lockOptions, SharedSessionContractImplementor session) {
|
||||
return load( key, lockOptions, session );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
|||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public interface SingleUniqueKeyEntityLoader<T> extends SingleEntityLoader {
|
||||
public interface SingleUniqueKeyEntityLoader<T> extends SingleEntityLoader<T> {
|
||||
/**
|
||||
* Load by unique key value
|
||||
*/
|
||||
|
|
|
@ -16,9 +16,8 @@ public final class AliasConstantsHelper {
|
|||
|
||||
/**
|
||||
* Returns the same as Integer.toString( i ) + '_'
|
||||
* Strings might be returned from a pool of constants, when i
|
||||
* Strings might be returned from a pool of constants, when `i`
|
||||
* is within the range of expected most commonly requested elements.
|
||||
*
|
||||
*/
|
||||
public static String get(final int i) {
|
||||
if ( i < MAX_POOL_SIZE && i >= 0 ) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* 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.loader.access;
|
||||
package org.hibernate.loader.internal;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
@ -28,6 +28,8 @@ import org.hibernate.proxy.LazyInitializer;
|
|||
import static org.hibernate.engine.spi.NaturalIdResolutions.INVALID_NATURAL_ID_REFERENCE;
|
||||
|
||||
/**
|
||||
* Base support for load-by-natural-id
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public abstract class BaseNaturalIdLoadAccessImpl<T> implements NaturalIdLoadOptions {
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* 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.loader.access;
|
||||
package org.hibernate.loader.internal;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Supplier;
|
||||
|
@ -31,10 +31,9 @@ import org.hibernate.proxy.LazyInitializer;
|
|||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
import static org.hibernate.engine.internal.ManagedTypeHelper.asHibernateProxy;
|
||||
import static org.hibernate.engine.internal.ManagedTypeHelper.isHibernateProxy;
|
||||
|
||||
/**
|
||||
* Standard implementation of load-by-id
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public class IdentifierLoadAccessImpl<T> implements IdentifierLoadAccess<T>, JavaType.CoercionContext {
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* 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.loader.access;
|
||||
package org.hibernate.loader.internal;
|
||||
|
||||
import org.hibernate.Incubating;
|
||||
import org.hibernate.Internal;
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* 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.loader.access;
|
||||
package org.hibernate.loader.internal;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* 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.loader.access;
|
||||
package org.hibernate.loader.internal;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for {@linkplain org.hibernate.loader.ast.spi.Loader loading} entities and
|
||||
* collections by primary-key, unique-key, natural-key, etc.
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
package org.hibernate.loader;
|
|
@ -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>.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<p>
|
||||
This package defines functionality for processing JDBC
|
||||
result sets and returning complex graphs of persistent
|
||||
objects.
|
||||
</p>
|
||||
<p>
|
||||
Subclasses of <tt>Loader</tt> define a particular
|
||||
query mechanism.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -6,8 +6,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* This package defines an API for accessing the Hibernate runtime metamodel.
|
||||
* This package defines an API for accessing details about model mapping
|
||||
*
|
||||
* deprecated (since 6.0) Use Hibernate's mapping model {@link org.hibernate.metamodel.MappingMetamodel}
|
||||
* Deprecated since 6.x in favor of the {@linkplain org.hibernate.metamodel.MappingMetamodel mapping-metamodel}
|
||||
*/
|
||||
package org.hibernate.metadata;
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Hibernate extensions to and implementations of the JPA metamodel
|
||||
* Extension to and implementation of the
|
||||
* {@linkplain jakarta.persistence.metamodel Jakarta Persistence metamodel}.
|
||||
* This metamodel is used in {@linkplain org.hibernate.query query} handling.
|
||||
*
|
||||
* @see jakarta.persistence.metamodel
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* 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 defining Hibernate's 2 forms of runtime metamodel:<ul>
|
||||
* <li>
|
||||
* The {@linkplain org.hibernate.metamodel.model.domain domain-metamodel} which
|
||||
* is an extension of the {@linkplain jakarta.persistence.metamodel Jakarta Persistence metamodel}
|
||||
* and is used in {@linkplain org.hibernate.query query} handling.
|
||||
* </li>
|
||||
* <li>
|
||||
* The {@linkplain org.hibernate.metamodel.mapping mapping-metamodel} which describes the
|
||||
* application domain model and its mapping to the database. It is distinct from the Jakarta
|
||||
* Persistence metamodel, which does not contain this mapping information.
|
||||
* </li>
|
||||
* </ul>
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
package org.hibernate.metamodel;
|
|
@ -95,10 +95,10 @@ import org.hibernate.engine.spi.SessionImplementor;
|
|||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||
import org.hibernate.event.spi.EventSource;
|
||||
import org.hibernate.event.spi.LoadEvent;
|
||||
import org.hibernate.generator.BeforeExecutionGenerator;
|
||||
import org.hibernate.generator.EventType;
|
||||
import org.hibernate.generator.Generator;
|
||||
import org.hibernate.generator.OnExecutionGenerator;
|
||||
import org.hibernate.generator.BeforeExecutionGenerator;
|
||||
import org.hibernate.generator.internal.VersionGeneration;
|
||||
import org.hibernate.id.Assigned;
|
||||
import org.hibernate.id.BulkInsertionCapableIdentifierGenerator;
|
||||
|
@ -106,10 +106,7 @@ import org.hibernate.id.IdentifierGenerator;
|
|||
import org.hibernate.id.OptimizableGenerator;
|
||||
import org.hibernate.id.PostInsertIdentityPersister;
|
||||
import org.hibernate.id.enhanced.Optimizer;
|
||||
import org.hibernate.id.insert.BasicSelectingDelegate;
|
||||
import org.hibernate.id.insert.InsertGeneratedIdentifierDelegate;
|
||||
import org.hibernate.id.insert.InsertReturningDelegate;
|
||||
import org.hibernate.id.insert.UniqueKeySelectingDelegate;
|
||||
import org.hibernate.internal.CoreLogging;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
import org.hibernate.internal.FilterAliasGenerator;
|
||||
|
@ -121,6 +118,7 @@ import org.hibernate.internal.util.collections.CollectionHelper;
|
|||
import org.hibernate.internal.util.collections.LockModeEnumMap;
|
||||
import org.hibernate.jdbc.Expectation;
|
||||
import org.hibernate.jdbc.TooManyRowsAffectedException;
|
||||
import org.hibernate.loader.ast.internal.CacheEntityLoaderHelper;
|
||||
import org.hibernate.loader.ast.internal.LoaderSelectBuilder;
|
||||
import org.hibernate.loader.ast.internal.LoaderSqlAstCreationState;
|
||||
import org.hibernate.loader.ast.internal.MultiIdLoaderStandard;
|
||||
|
@ -137,7 +135,6 @@ import org.hibernate.loader.ast.spi.MultiNaturalIdLoader;
|
|||
import org.hibernate.loader.ast.spi.NaturalIdLoader;
|
||||
import org.hibernate.loader.ast.spi.SingleIdEntityLoader;
|
||||
import org.hibernate.loader.ast.spi.SingleUniqueKeyEntityLoader;
|
||||
import org.hibernate.loader.entity.CacheEntityLoaderHelper;
|
||||
import org.hibernate.mapping.Any;
|
||||
import org.hibernate.mapping.BasicValue;
|
||||
import org.hibernate.mapping.Column;
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for accessing the persistent state of an entity or embeddable.
|
||||
* <p>
|
||||
* The overall strategy of the various ways to access a property is defined by the
|
||||
* {@link org.hibernate.property.access.spi.PropertyAccessStrategy} contract.
|
||||
* <p>
|
||||
* The access for a specific property is modeled by a
|
||||
* {@link org.hibernate.property.access.spi.PropertyAccess} instance build from the strategy, exposing
|
||||
* {@link org.hibernate.property.access.spi.Getter} and {@link org.hibernate.property.access.spi.Setter}
|
||||
* delegates for accessing the properties values.
|
||||
* <p>
|
||||
* {@link org.hibernate.property.access.spi.BuiltInPropertyAccessStrategies} defines the built-in
|
||||
* named strategies understood in terms of mappings. In mappings, users may refer to those short names
|
||||
* for referring to certain built-in strategies. Users may also implement their own
|
||||
* strategy and refer to that by fully-qualified name, or they may leverage the
|
||||
* {@link org.hibernate.boot.registry.selector.spi.StrategySelector} service to define short-naming
|
||||
* for their custom strategies.
|
||||
*
|
||||
* @see org.hibernate.annotations.AttributeAccessor
|
||||
* @see jakarta.persistence.Access
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
package org.hibernate.property.access;
|
|
@ -6,21 +6,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Defines strategies for accessing the persistent properties of an entity or composite.
|
||||
* <p>
|
||||
* The overall strategy of the various ways to access a property is defined by the
|
||||
* {@link org.hibernate.property.access.spi.PropertyAccessStrategy} contract.
|
||||
* <p>
|
||||
* The access for a specific property is modeled by a
|
||||
* {@link org.hibernate.property.access.spi.PropertyAccess} instance build from the strategy, exposing
|
||||
* {@link org.hibernate.property.access.spi.Getter} and {@link org.hibernate.property.access.spi.Setter}
|
||||
* delegates for accessing the properties values.
|
||||
* <p>
|
||||
* {@link org.hibernate.property.access.spi.BuiltInPropertyAccessStrategies} defines the built-in
|
||||
* named strategies understood in terms of mappings. In mappings, users may refer to those short names
|
||||
* for referring to certain built-in strategies. Users may also implement their own
|
||||
* strategy and refer to that by fully-qualified name, or they may leverage the
|
||||
* {@link org.hibernate.boot.registry.selector.spi.StrategySelector} service to define short-naming
|
||||
* for their custom strategies.
|
||||
* Integration contracts related with {@link org.hibernate.property.access.spi.PropertyAccessStrategy}
|
||||
*/
|
||||
package org.hibernate.property.access.spi;
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.hibernate.event.spi.PreLoadEvent;
|
|||
import org.hibernate.event.spi.PreLoadEventListener;
|
||||
import org.hibernate.internal.util.NullnessHelper;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.loader.entity.CacheEntityLoaderHelper;
|
||||
import org.hibernate.loader.ast.internal.CacheEntityLoaderHelper;
|
||||
import org.hibernate.metamodel.mapping.AttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.AttributeMetadata;
|
||||
import org.hibernate.metamodel.mapping.EntityDiscriminatorMapping;
|
||||
|
|
|
@ -26,12 +26,12 @@ import org.hibernate.envers.internal.entities.mapper.id.MultipleIdMapper;
|
|||
import org.hibernate.envers.internal.entities.mapper.id.NestedEmbeddedIdMapper;
|
||||
import org.hibernate.envers.internal.entities.mapper.id.SimpleIdMapperBuilder;
|
||||
import org.hibernate.envers.internal.entities.mapper.id.SingleIdMapper;
|
||||
import org.hibernate.loader.PropertyPath;
|
||||
import org.hibernate.mapping.Component;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.mapping.Property;
|
||||
import org.hibernate.mapping.ToOne;
|
||||
import org.hibernate.mapping.Value;
|
||||
import org.hibernate.spi.NavigablePath;
|
||||
import org.hibernate.type.ComponentType;
|
||||
import org.hibernate.type.ManyToOneType;
|
||||
import org.hibernate.type.Type;
|
||||
|
@ -67,7 +67,7 @@ public final class IdMetadataGenerator extends AbstractMetadataGenerator {
|
|||
Property virtualProperty,
|
||||
boolean audited) {
|
||||
|
||||
if ( PropertyPath.IDENTIFIER_MAPPER_PROPERTY.equals( mappedProperty.getName() ) ) {
|
||||
if ( NavigablePath.IDENTIFIER_MAPPER_PROPERTY.equals( mappedProperty.getName() ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,13 +16,6 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Lob;
|
||||
import jakarta.persistence.MapKey;
|
||||
import jakarta.persistence.MapKeyEnumerated;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Version;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
||||
import org.hibernate.annotations.common.reflection.XClass;
|
||||
|
@ -43,10 +36,17 @@ import org.hibernate.envers.internal.tools.MappingTools;
|
|||
import org.hibernate.envers.internal.tools.ReflectionTools;
|
||||
import org.hibernate.envers.internal.tools.StringTools;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.loader.PropertyPath;
|
||||
import org.hibernate.mapping.Component;
|
||||
import org.hibernate.mapping.Property;
|
||||
import org.hibernate.mapping.Value;
|
||||
import org.hibernate.spi.NavigablePath;
|
||||
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Lob;
|
||||
import jakarta.persistence.MapKey;
|
||||
import jakarta.persistence.MapKeyEnumerated;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Version;
|
||||
|
||||
import static org.hibernate.envers.internal.tools.Tools.newHashMap;
|
||||
import static org.hibernate.envers.internal.tools.Tools.newHashSet;
|
||||
|
@ -290,7 +290,7 @@ public class AuditedPropertiesReader {
|
|||
final Property property = propertyIter.next();
|
||||
addPersistentProperty( property );
|
||||
// See HHH-6636
|
||||
if ( "embedded".equals( property.getPropertyAccessorName() ) && !PropertyPath.IDENTIFIER_MAPPER_PROPERTY.equals( property.getName() ) ) {
|
||||
if ( "embedded".equals( property.getPropertyAccessorName() ) && !NavigablePath.IDENTIFIER_MAPPER_PROPERTY.equals( property.getName() ) ) {
|
||||
createPropertiesGroupMapping( property );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue