HHH-14474 Refactor internal visibility to allow Hibernate Reactive to implement non-primary key associations
see https://github.com/hibernate/hibernate-reactive/issues/565
This commit is contained in:
parent
6868c68278
commit
4fad616d4b
|
@ -61,6 +61,11 @@ public abstract class AbstractEntityLoader
|
|||
return load( session, id, optionalObject, id, lockOptions, readOnly );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object load(Object id, SharedSessionContractImplementor session, LockOptions lockOptions) {
|
||||
return load( session, id, null, null, lockOptions, null );
|
||||
}
|
||||
|
||||
protected Object load(
|
||||
SharedSessionContractImplementor session,
|
||||
Object id,
|
||||
|
|
|
@ -172,10 +172,18 @@ public class EntityLoader extends AbstractEntityLoader {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated will be removed. Use one of the load methods on {@link AbstractEntityLoader} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public Object loadByUniqueKey(SharedSessionContractImplementor session, Object key) {
|
||||
return loadByUniqueKey( session, key, null );
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated will be removed. Use one of the load methods on {@link AbstractEntityLoader} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public Object loadByUniqueKey(SharedSessionContractImplementor session, Object key, Boolean readOnly) {
|
||||
return load( session, key, null, null, LockOptions.NONE, readOnly );
|
||||
}
|
||||
|
|
|
@ -60,4 +60,11 @@ public interface UniqueEntityLoader {
|
|||
Boolean readOnly) {
|
||||
return load( id, optionalObject, session, lockOptions );
|
||||
}
|
||||
|
||||
default Object load(
|
||||
Object id,
|
||||
SharedSessionContractImplementor session,
|
||||
LockOptions lockOptions) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ public abstract class AbstractEntityPersister
|
|||
|
||||
private final EntityLoaderLazyCollection loaders = new EntityLoaderLazyCollection();
|
||||
|
||||
private volatile Map<String,EntityLoader> uniqueKeyLoaders;
|
||||
private volatile Map<String,UniqueEntityLoader> uniqueKeyLoaders;
|
||||
private volatile Map<LockMode,EntityLoader> naturalIdLoaders;
|
||||
|
||||
// SQL strings
|
||||
|
@ -2480,7 +2480,7 @@ public abstract class AbstractEntityPersister
|
|||
Object uniqueKey,
|
||||
SharedSessionContractImplementor session) throws HibernateException {
|
||||
return getAppropriateUniqueKeyLoader( propertyName, session )
|
||||
.loadByUniqueKey( session, uniqueKey );
|
||||
.load( uniqueKey, session, LockOptions.NONE );
|
||||
}
|
||||
|
||||
public Object loadByNaturalId(
|
||||
|
@ -2488,7 +2488,7 @@ public abstract class AbstractEntityPersister
|
|||
LockOptions lockOptions,
|
||||
SharedSessionContractImplementor session) throws HibernateException {
|
||||
return getAppropriateNaturalIdLoader( determineValueNullness( naturalIdValues ), lockOptions, session )
|
||||
.loadByUniqueKey( session, naturalIdValues );
|
||||
.load( naturalIdValues, session, LockOptions.NONE );
|
||||
}
|
||||
|
||||
private EntityLoader getAppropriateNaturalIdLoader(
|
||||
|
@ -2511,7 +2511,7 @@ public abstract class AbstractEntityPersister
|
|||
&& !loadQueryInfluencers.hasEnabledFetchProfiles();
|
||||
}
|
||||
|
||||
private EntityLoader getAppropriateUniqueKeyLoader(
|
||||
private UniqueEntityLoader getAppropriateUniqueKeyLoader(
|
||||
String propertyName,
|
||||
SharedSessionContractImplementor session) {
|
||||
LoadQueryInfluencers loadQueryInfluencers = session.getLoadQueryInfluencers();
|
||||
|
@ -2560,7 +2560,7 @@ public abstract class AbstractEntityPersister
|
|||
}
|
||||
}
|
||||
|
||||
private EntityLoader createUniqueKeyLoader(
|
||||
protected UniqueEntityLoader createUniqueKeyLoader(
|
||||
Type uniqueKeyType,
|
||||
String[] columns,
|
||||
LoadQueryInfluencers loadQueryInfluencers) {
|
||||
|
|
Loading…
Reference in New Issue