Skip to content

Commit 071f615

Browse files
committed
HSEARCH-3319 Remove now unnecessary withRoot(Reference)
1 parent 794af22 commit 071f615

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

@@ -100,20 +99,6 @@ <T> AggregationFinalStep<T> withParameters(
10099
@Incubating
101100
SearchAggregationFactory<SR> withRoot(String objectFieldPath);
102101

103-
/**
104-
* Create a new aggregation factory whose root for all paths passed to the DSL
105-
* will be the given object field.
106-
* <p>
107-
* See <a href="#field-paths">here</a> for more information.
108-
*
109-
* @param objectFieldReference The reference representing the path from the current root to an object field that will become the new root.
110-
* @return A new aggregation factory using the given object field as root.
111-
*/
112-
@Incubating
113-
default SearchAggregationFactory<SR> withRoot(ObjectFieldReference<? super SR> objectFieldReference) {
114-
return withRoot( objectFieldReference.absolutePath() );
115-
}
116-
117102
/**
118103
* @param relativeFieldPath The path to a field, relative to the {@link #withRoot(String) root} of this factory.
119104
* @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
@@ -521,21 +521,6 @@ <T> ProjectionFinalStep<T> withParameters(
521521
@Incubating
522522
SearchProjectionFactory<SR, R, E> withRoot(String objectFieldPath);
523523

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