Skip to content

Commit

Permalink
HSEARCH-3629 Deprecate HibernateOrmSearchQueryHitTypeStep
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere authored and fax4ever committed Jan 14, 2020
1 parent 48f187a commit 4288471
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Expand Up @@ -13,12 +13,12 @@
import org.hibernate.search.engine.search.aggregation.dsl.SearchAggregationFactory;
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
import org.hibernate.search.engine.search.projection.dsl.SearchProjectionFactory;
import org.hibernate.search.engine.search.query.dsl.SearchQueryHitTypeStep;
import org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep;
import org.hibernate.search.engine.search.query.dsl.SearchQueryPredicateStep;
import org.hibernate.search.engine.search.sort.dsl.SearchSortFactory;
import org.hibernate.search.mapper.orm.massindexing.MassIndexer;
import org.hibernate.search.mapper.orm.work.SearchWorkspace;
import org.hibernate.search.mapper.orm.search.query.dsl.HibernateOrmSearchQueryHitTypeStep;
import org.hibernate.search.mapper.orm.common.EntityReference;

/**
Expand Down Expand Up @@ -70,7 +70,7 @@ public interface SearchScope<E> {
* created using this scope or another scope instance targeting the same indexes.
* <p>
* Note this method is only necessary if you do not want to use lambda expressions,
* since you can {@link HibernateOrmSearchQueryHitTypeStep#asProjection(Function)} define projections with lambdas}
* since you can {@link SearchQueryHitTypeStep#asProjection(Function)} define projections with lambdas}
* within the search query DSL,
* removing the need to create separate objects to represent the projections.
*
Expand Down
Expand Up @@ -20,7 +20,9 @@
* or where the predicate can be set directly, assuming that query hits are returned as entities.
*
* @see SearchQueryHitTypeStep
* @deprecated Use {@link SearchQueryHitTypeStep} instead.
*/
@Deprecated
public interface HibernateOrmSearchQueryHitTypeStep<E>
extends SearchQueryHitTypeStep<
SearchQueryOptionsStep<?, E, SearchLoadingOptionsStep, ?, ?>,
Expand All @@ -37,15 +39,19 @@ public interface HibernateOrmSearchQueryHitTypeStep<E>
* @param fetchSize The fetch size. Must be positive or zero.
* @return {@code this} for method chaining.
* @see Query#setFetchSize(int)
* @deprecated Call {@code .loading( o -> o.fetchSize( ... )} near the end of the query definition instead.
*/
@Deprecated
HibernateOrmSearchQueryHitTypeStep<E> fetchSize(int fetchSize);

/**
* Set the strategy for cache lookup before query results are loaded.
*
* @param strategy The strategy.
* @return {@code this} for method chaining.
* @deprecated Call {@code .loading( o -> o.cacheLookupStrategy( ... )} near the end of the query definition instead.
*/
@Deprecated
HibernateOrmSearchQueryHitTypeStep<E> cacheLookupStrategy(EntityLoadingCacheLookupStrategy strategy);

}
Expand Up @@ -14,6 +14,7 @@
import javax.persistence.EntityManager;

import org.hibernate.Session;
import org.hibernate.search.engine.search.query.dsl.SearchQueryHitTypeStep;
import org.hibernate.search.mapper.orm.scope.SearchScope;
import org.hibernate.search.mapper.orm.work.SearchIndexingPlan;
import org.hibernate.search.mapper.orm.work.SearchWorkspace;
Expand All @@ -30,7 +31,7 @@ public interface SearchSession {
* @param type An indexed type, or a supertype of all indexed types that will be targeted by the search query.
* @param <T> An indexed type, or a supertype of all indexed types that will be targeted by the search query.
* @return The initial step of a DSL where the search query can be defined.
* @see HibernateOrmSearchQueryHitTypeStep
* @see SearchQueryHitTypeStep
*/
default <T> HibernateOrmSearchQueryHitTypeStep<T> search(Class<T> type) {
return search( Collections.singleton( type ) );
Expand All @@ -44,7 +45,7 @@ default <T> HibernateOrmSearchQueryHitTypeStep<T> search(Class<T> type) {
* @param types A collection of indexed types, or supertypes of all indexed types that will be targeted by the search query.
* @param <T> A supertype of all indexed types that will be targeted by the search query.
* @return The initial step of a DSL where the search query can be defined.
* @see HibernateOrmSearchQueryHitTypeStep
* @see SearchQueryHitTypeStep
*/
<T> HibernateOrmSearchQueryHitTypeStep<T> search(Collection<? extends Class<? extends T>> types);

Expand All @@ -56,7 +57,7 @@ default <T> HibernateOrmSearchQueryHitTypeStep<T> search(Class<T> type) {
* @param scope A scope representing all indexed types that will be targeted by the search query.
* @param <T> A supertype of all types in the given scope.
* @return The initial step of a DSL where the search query can be defined.
* @see HibernateOrmSearchQueryHitTypeStep
* @see SearchQueryHitTypeStep
*/
<T> HibernateOrmSearchQueryHitTypeStep<T> search(SearchScope<T> scope);

Expand Down

0 comments on commit 4288471

Please sign in to comment.