Skip to content

Commit 477fbe2

Browse files
committed
HSEARCH-3319 Remove now unnecessary withRoot(Reference)
1 parent 3a44c48 commit 477fbe2

File tree

6 files changed

+0
-75
lines changed

6 files changed

+0
-75
lines changed

engine/src/main/java/org/hibernate/search/engine/search/aggregation/dsl/SearchAggregationFactory.java

-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.function.Function;
88

99
import org.hibernate.search.engine.search.common.NamedValues;
10-
import org.hibernate.search.engine.search.reference.object.ObjectFieldReference;
1110
import org.hibernate.search.util.common.SearchException;
1211
import org.hibernate.search.util.common.annotation.Incubating;
1312

@@ -147,20 +146,6 @@ <T> AggregationFinalStep<T> withParameters(
147146
@Incubating
148147
SearchAggregationFactory<SR> withRoot(String objectFieldPath);
149148

150-
/**
151-
* Create a new aggregation factory whose root for all paths passed to the DSL
152-
* will be the given object field.
153-
* <p>
154-
* See <a href="#field-paths">here</a> for more information.
155-
*
156-
* @param objectFieldReference The reference representing the path from the current root to an object field that will become the new root.
157-
* @return A new aggregation factory using the given object field as root.
158-
*/
159-
@Incubating
160-
default SearchAggregationFactory<SR> withRoot(ObjectFieldReference<? super SR> objectFieldReference) {
161-
return withRoot( objectFieldReference.absolutePath() );
162-
}
163-
164149
/**
165150
* @param relativeFieldPath The path to a field, relative to the {@link #withRoot(String) root} of this factory.
166151
* @return The absolute path of the field, for use in native aggregations for example.

engine/src/main/java/org/hibernate/search/engine/search/predicate/dsl/SearchPredicateFactory.java

-16
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.hibernate.search.engine.search.common.BooleanOperator;
1212
import org.hibernate.search.engine.search.common.NamedValues;
1313
import org.hibernate.search.engine.search.predicate.SearchPredicate;
14-
import org.hibernate.search.engine.search.reference.object.ObjectFieldReference;
1514
import org.hibernate.search.engine.search.reference.predicate.NestedPredicateFieldReference;
1615
import org.hibernate.search.util.common.SearchException;
1716
import org.hibernate.search.util.common.annotation.Incubating;
@@ -376,21 +375,6 @@ PredicateFinalStep withParameters(
376375
@Incubating
377376
SearchPredicateFactory<SR> withRoot(String objectFieldPath);
378377

379-
/**
380-
* Create a new predicate factory whose root for all paths passed to the DSL
381-
* will be the given object field.
382-
* <p>
383-
* This is used to call reusable methods that apply the same predicate
384-
* on different object fields that have same structure (same sub-fields).
385-
*
386-
* @param objectFieldReference The reference representing the path from the current root to an object field that will become the new root.
387-
* @return A new predicate factory using the given object field as root.
388-
*/
389-
@Incubating
390-
default SearchPredicateFactory<SR> withRoot(ObjectFieldReference<? super SR> objectFieldReference) {
391-
return withRoot( objectFieldReference.absolutePath() );
392-
}
393-
394378
/**
395379
* @param relativeFieldPath The path to a field, relative to the {@link #withRoot(String) root} of this factory.
396380
* @return The absolute path of the field, for use in native predicates for example.

engine/src/main/java/org/hibernate/search/engine/search/projection/dsl/ExtendedSearchProjectionFactory.java

-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55
package org.hibernate.search.engine.search.projection.dsl;
66

7-
import org.hibernate.search.engine.search.reference.object.ObjectFieldReference;
8-
97
/**
108
* A base interface for subtypes of {@link SearchProjectionFactory} allowing to
119
* easily override the self type for all relevant methods.
@@ -22,9 +20,4 @@ public interface ExtendedSearchProjectionFactory<SR, S extends ExtendedSearchPro
2220
@Override
2321
S withRoot(String objectFieldPath);
2422

25-
26-
@Override
27-
default S withRoot(ObjectFieldReference<? super SR> objectFieldReference) {
28-
return withRoot( objectFieldReference.absolutePath() );
29-
}
3023
}

engine/src/main/java/org/hibernate/search/engine/search/projection/dsl/SearchProjectionFactory.java

-15
Original file line numberDiff line numberDiff line change
@@ -522,21 +522,6 @@ <T> ProjectionFinalStep<T> withParameters(
522522
@Incubating
523523
SearchProjectionFactory<SR, R, E> withRoot(String objectFieldPath);
524524

525-
/**
526-
* Create a new projection factory whose root for all paths passed to the DSL
527-
* will be the given object field.
528-
* <p>
529-
* This is used to call reusable methods that can apply the same projection
530-
* on different object fields that have same structure (same sub-fields).
531-
*
532-
* @param objectFieldReference The reference representing the path from the current root to an object field that will become the new root.
533-
* @return A new projection factory using the given object field as root.
534-
*/
535-
@Incubating
536-
default SearchProjectionFactory<SR, R, E> withRoot(ObjectFieldReference<? super SR> objectFieldReference) {
537-
return withRoot( objectFieldReference.absolutePath() );
538-
}
539-
540525
/**
541526
* @param relativeFieldPath The path to a field, relative to the {@link #withRoot(String) root} of this factory.
542527
* @return The absolute path of the field, for use in native projections for example.

engine/src/main/java/org/hibernate/search/engine/search/sort/dsl/ExtendedSearchSortFactory.java

-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.function.Function;
88

99
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
10-
import org.hibernate.search.engine.search.reference.object.ObjectFieldReference;
1110
import org.hibernate.search.engine.search.reference.sort.FieldSortFieldReference;
1211
import org.hibernate.search.engine.spatial.GeoPoint;
1312

@@ -31,11 +30,6 @@ public interface ExtendedSearchSortFactory<
3130
@Override
3231
S withRoot(String objectFieldPath);
3332

34-
@Override
35-
default S withRoot(ObjectFieldReference<? super SR> objectFieldReference) {
36-
return withRoot( objectFieldReference.absolutePath() );
37-
}
38-
3933
@Override
4034
FieldSortOptionsStep<SR, ?, PDF> field(String fieldPath);
4135

engine/src/main/java/org/hibernate/search/engine/search/sort/dsl/SearchSortFactory.java

-16
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import org.hibernate.search.engine.search.common.NamedValues;
1111
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
12-
import org.hibernate.search.engine.search.reference.object.ObjectFieldReference;
1312
import org.hibernate.search.engine.search.reference.sort.FieldSortFieldReference;
1413
import org.hibernate.search.engine.spatial.GeoPoint;
1514
import org.hibernate.search.util.common.SearchException;
@@ -224,21 +223,6 @@ public interface SearchSortFactory<SR> {
224223
@Incubating
225224
SearchSortFactory<SR> withRoot(String objectFieldPath);
226225

227-
/**
228-
* Create a new sort factory whose root for all paths passed to the DSL
229-
* will be the given object field.
230-
* <p>
231-
* This is used to call reusable methods that can apply the same sort
232-
* on different object fields that have same structure (same sub-fields).
233-
*
234-
* @param objectFieldReference The reference representing the path from the current root to an object field that will become the new root.
235-
* @return A new sort factory using the given object field as root.
236-
*/
237-
@Incubating
238-
default SearchSortFactory<SR> withRoot(ObjectFieldReference<? super SR> objectFieldReference) {
239-
return withRoot( objectFieldReference.absolutePath() );
240-
}
241-
242226
/**
243227
* @param relativeFieldPath The path to a field, relative to the {@link #withRoot(String) root} of this factory.
244228
* @return The absolute path of the field, for use in native sorts for example.

0 commit comments

Comments
 (0)