Skip to content

Commit

Permalink
HSEARCH-2296 Use the new unified SessionDelegatorBaseImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Oct 5, 2016
1 parent 5a97bca commit 50cfa1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Expand Up @@ -16,6 +16,7 @@
import org.hibernate.action.spi.BeforeTransactionCompletionProcess;
import org.hibernate.engine.spi.ActionQueue;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.service.spi.EventListenerRegistry;
import org.hibernate.event.spi.EventSource;
import org.hibernate.event.spi.EventType;
Expand Down Expand Up @@ -182,7 +183,7 @@ private static class DelegateToSynchronizationOnAfterTx implements AfterTransact
}

@Override
public void doAfterTransactionCompletion(boolean success, SessionImplementor sessionImplementor) {
public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor sessionImplementor) {
try {
synchronization.afterCompletion( success ? Status.STATUS_COMMITTED : Status.STATUS_ROLLEDBACK );
}
Expand Down
Expand Up @@ -11,10 +11,10 @@
import java.util.Properties;
import java.util.Set;

import org.hibernate.engine.query.spi.ParameterMetadata;
import org.hibernate.engine.spi.SessionDelegatorBaseImpl;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.event.spi.EventSource;
import org.hibernate.query.internal.ParameterMetadataImpl;
import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.FullTextSharedSessionBuilder;
Expand Down Expand Up @@ -56,7 +56,7 @@ final class FullTextSessionImpl extends SessionDelegatorBaseImpl implements Full
private final TransactionContext transactionContext;

public FullTextSessionImpl(org.hibernate.Session session) {
super( (SessionImplementor) session, session );
super( (SessionImplementor) session );
if ( session == null ) {
throw log.getNullSessionPassedToFullTextSessionCreationException();
}
Expand Down Expand Up @@ -85,8 +85,8 @@ public FullTextQuery createFullTextQuery(QueryDescriptor queryDescriptor, Class<
private FullTextQuery createFullTextQuery(HSQuery hsQuery, Class<?>... entities) {
return new FullTextQueryImpl(
hsQuery,
sessionImplementor,
new ParameterMetadata( null, null )
delegate,
new ParameterMetadataImpl( null, null )
);
}

Expand Down Expand Up @@ -128,7 +128,7 @@ public <T> void purge(Class<T> entityType, Serializable id) {
}

private void createAndPerformWork(Class<?> clazz, Serializable id, WorkType workType) {
Work work = new Work( sessionImplementor.getTenantIdentifier(), clazz, id, workType );
Work work = new Work( delegate.getTenantIdentifier(), clazz, id, workType );
getSearchIntegrator().getWorker().performWork( work, transactionContext );
}

Expand All @@ -154,7 +154,7 @@ public <T> void index(T entity) {
String msg = "Entity to index is not an @Indexed entity: " + entity.getClass().getName();
throw new IllegalArgumentException( msg );
}
Serializable id = session.getIdentifier( entity );
Serializable id = delegate.getIdentifier( entity );
String tenantIdentifier = getTenantIdentifier();

Work work = new Work( tenantIdentifier, entity, id, WorkType.INDEX );
Expand Down Expand Up @@ -190,7 +190,7 @@ public SearchFactory getSearchFactory() {

private ExtendedSearchIntegrator getSearchIntegrator() {
if ( searchFactory == null ) {
searchFactory = ContextHelper.getSearchIntegrator( session );
searchFactory = ContextHelper.getSearchIntegrator( delegate );
}
return searchFactory;
}
Expand Down
Expand Up @@ -22,7 +22,7 @@
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
import org.hibernate.engine.query.spi.ParameterMetadata;
import org.hibernate.query.ParameterMetadata;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.query.internal.QueryImpl;
import org.hibernate.query.spi.QueryImplementor;
Expand Down

0 comments on commit 50cfa1f

Please sign in to comment.