Skip to content

Change the scope of more methods #10032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,8 @@ private <T> T find(Class<T> entityClass, Object primaryKey, LockOptions lockOpti
}
}

private static <T> void logIgnoringEntityNotFound(Class<T> entityClass, Object primaryKey) {
// Hibernate Reactive calls this
protected static <T> void logIgnoringEntityNotFound(Class<T> entityClass, Object primaryKey) {
if ( log.isDebugEnabled() ) {
log.ignoringEntityNotFound(
entityClass != null ? entityClass.getName(): null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
*
* @author Steve Ebersole
*/
// Hibernate Reactive extends this class: see ReactiveIdentifierLoadAccessImpl
public class IdentifierLoadAccessImpl<T> implements IdentifierLoadAccess<T>, JavaType.CoercionContext {
private final LoadAccessContext context;
private final EntityPersister entityPersister;
Expand Down Expand Up @@ -85,6 +86,7 @@ public final T getReference(Object id) {
return perform( () -> doGetReference( id ) );
}

// Hibernate Reactive overrides this
protected T perform(Supplier<T> executor) {
final SessionImplementor session = context.getSession();
final CacheMode sessionCacheMode = session.getCacheMode();
Expand Down Expand Up @@ -122,6 +124,7 @@ protected T perform(Supplier<T> executor) {
}

@SuppressWarnings( "unchecked" )
// Hibernate Reactive overrides this
protected T doGetReference(Object id) {
final SessionImplementor session = context.getSession();
final EntityMappingType concreteType = entityPersister.resolveConcreteProxyTypeForId( id, session );
Expand All @@ -147,7 +150,8 @@ public Optional<T> loadOptional(Object id) {
}

@SuppressWarnings( "unchecked" )
protected final T doLoad(Object id) {
// Hibernate Reactive overrides this
protected T doLoad(Object id) {
final SessionImplementor session = context.getSession();
Object result;
try {
Expand All @@ -162,7 +166,8 @@ protected final T doLoad(Object id) {
return (T) result;
}

private Object coerceId(Object id, SessionFactoryImplementor factory) {
// Used by Hibernate Reactive
protected Object coerceId(Object id, SessionFactoryImplementor factory) {
if ( isLoadByIdComplianceEnabled( factory ) ) {
return id;
}
Expand Down Expand Up @@ -236,4 +241,30 @@ public IdentifierLoadAccess<T> disableFetchProfile(String profileName) {
}
return this;
}

// Getters for Hibernate Reactive

protected CacheMode getCacheMode() {
return cacheMode;
}

protected GraphSemantic getGraphSemantic() {
return graphSemantic;
}

protected LoadAccessContext getContext() {
return context;
}

protected EntityPersister getEntityPersister() {
return entityPersister;
}

protected LockOptions getLockOptions() {
return lockOptions;
}

public RootGraphImplementor<T> getRootGraph() {
return rootGraph;
}
}