Skip to content

Commit

Permalink
Adapt to ReactiveExecutable interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Jun 1, 2023
1 parent 53057e1 commit a365057
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.hibernate.action.spi.Executable;
import org.hibernate.cache.CacheException;
import org.hibernate.engine.spi.ActionQueue;
import org.hibernate.engine.spi.ComparableExecutable;
import org.hibernate.engine.spi.EntityEntry;
import org.hibernate.engine.spi.ExecutableList;
import org.hibernate.engine.spi.SessionFactoryImplementor;
Expand Down Expand Up @@ -203,7 +204,7 @@ public void ensureInitialized(ReactiveActionQueue instance) {
}
};

public abstract <T extends ReactiveExecutable & Comparable<? super T>> ExecutableList<T> getActions(ReactiveActionQueue instance);
public abstract <T extends ReactiveExecutable & ComparableExecutable> ExecutableList<T> getActions(ReactiveActionQueue instance);
public abstract void ensureInitialized(ReactiveActionQueue instance);
}

Expand Down Expand Up @@ -1332,17 +1333,4 @@ private boolean hasParent(BatchIdentifier batchIdentifier, List<BatchIdentifier>

}

private abstract static class ListProvider<T extends ReactiveExecutable & Comparable<? super T> & Serializable> {
abstract ExecutableList<T> get(ReactiveActionQueue instance);

abstract ExecutableList<T> init(ReactiveActionQueue instance);

ExecutableList<T> getOrInit(ReactiveActionQueue instance) {
ExecutableList<T> list = get( instance );
if ( list == null ) {
list = init( instance );
}
return list;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.hibernate.engine.internal.NonNullableTransientDependencies;
import org.hibernate.engine.internal.Nullability;
import org.hibernate.engine.internal.Versioning;
import org.hibernate.engine.spi.ComparableExecutable;
import org.hibernate.engine.spi.EntityKey;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
Expand All @@ -28,7 +29,7 @@
*
* @see org.hibernate.action.internal.AbstractEntityInsertAction
*/
public interface ReactiveEntityInsertAction extends ReactiveExecutable {
public interface ReactiveEntityInsertAction extends ReactiveExecutable, ComparableExecutable {
boolean isEarlyInsert();
NonNullableTransientDependencies findNonNullableTransientEntities();
SharedSessionContractImplementor getSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
import org.hibernate.action.spi.AfterTransactionCompletionProcess;
import org.hibernate.action.spi.BeforeTransactionCompletionProcess;
import org.hibernate.action.spi.Executable;
import org.hibernate.engine.spi.ComparableExecutable;
import org.hibernate.event.spi.EventSource;
import org.hibernate.reactive.engine.ReactiveExecutable;

public final class ReactiveEntityInsertActionHolder implements Executable, ReactiveExecutable, Comparable<ReactiveEntityInsertActionHolder>,
public final class ReactiveEntityInsertActionHolder implements Executable, ReactiveExecutable, ComparableExecutable,
Serializable {

private final ReactiveEntityInsertAction delegate;
Expand All @@ -26,11 +27,6 @@ public ReactiveEntityInsertActionHolder(ReactiveEntityInsertAction delegate) {
this.delegate = delegate;
}

@Override
public int compareTo(ReactiveEntityInsertActionHolder o) {
return delegate.compareActionTo( o.delegate );
}

@Override
public Serializable[] getPropertySpaces() {
return delegate.getPropertySpaces();
Expand Down Expand Up @@ -69,4 +65,19 @@ public CompletionStage<Void> reactiveExecute() {
public ReactiveEntityInsertAction getDelegate() {
return delegate;
}

@Override
public String getPrimarySortClassifier() {
return delegate.getPrimarySortClassifier();
}

@Override
public Object getSecondarySortIndex() {
return delegate.getSecondarySortIndex();
}

@Override
public int compareTo(final ComparableExecutable o) {
return delegate.compareTo( o );
}
}

0 comments on commit a365057

Please sign in to comment.