Skip to content

Commit 4a6cb74

Browse files
Merge branch 'discourage-old-query-apis' into 'dev'
Discourage use of old query APIs See merge request objectbox/objectbox-java!138
2 parents 1c950ac + b77566e commit 4a6cb74

File tree

2 files changed

+207
-19
lines changed

2 files changed

+207
-19
lines changed

objectbox-java/src/main/java/io/objectbox/query/Query.java

+30-18
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,10 @@ public Query<T> setParameter(Property<?> property, String value) {
570570
}
571571

572572
/**
573-
* Sets a parameter previously given to the {@link QueryBuilder} to a new value.
573+
* Changes the parameter of the query condition with the matching {@code alias} to a new {@code value}.
574574
*
575-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
575+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
576+
* @param value The new value to use for the query condition.
576577
*/
577578
public Query<T> setParameter(String alias, String value) {
578579
checkOpen();
@@ -590,9 +591,10 @@ public Query<T> setParameter(Property<?> property, long value) {
590591
}
591592

592593
/**
593-
* Sets a parameter previously given to the {@link QueryBuilder} to a new value.
594+
* Changes the parameter of the query condition with the matching {@code alias} to a new {@code value}.
594595
*
595-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
596+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
597+
* @param value The new value to use for the query condition.
596598
*/
597599
public Query<T> setParameter(String alias, long value) {
598600
checkOpen();
@@ -610,9 +612,10 @@ public Query<T> setParameter(Property<?> property, double value) {
610612
}
611613

612614
/**
613-
* Sets a parameter previously given to the {@link QueryBuilder} to a new value.
615+
* Changes the parameter of the query condition with the matching {@code alias} to a new {@code value}.
614616
*
615-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
617+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
618+
* @param value The new value to use for the query condition.
616619
*/
617620
public Query<T> setParameter(String alias, double value) {
618621
checkOpen();
@@ -630,9 +633,10 @@ public Query<T> setParameter(Property<?> property, Date value) {
630633
}
631634

632635
/**
633-
* Sets a parameter previously given to the {@link QueryBuilder} to a new value.
636+
* Changes the parameter of the query condition with the matching {@code alias} to a new {@code value}.
634637
*
635-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
638+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
639+
* @param value The new value to use for the query condition.
636640
* @throws NullPointerException if given date is null
637641
*/
638642
public Query<T> setParameter(String alias, Date value) {
@@ -647,9 +651,10 @@ public Query<T> setParameter(Property<?> property, boolean value) {
647651
}
648652

649653
/**
650-
* Sets a parameter previously given to the {@link QueryBuilder} to a new value.
654+
* Changes the parameter of the query condition with the matching {@code alias} to a new {@code value}.
651655
*
652-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
656+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
657+
* @param value The new value to use for the query condition.
653658
*/
654659
public Query<T> setParameter(String alias, boolean value) {
655660
return setParameter(alias, value ? 1 : 0);
@@ -761,9 +766,11 @@ public Query<T> setParameters(Property<?> property, long value1, long value2) {
761766
}
762767

763768
/**
764-
* Sets a parameter previously given to the {@link QueryBuilder} to new values.
769+
* Changes the parameters of the query condition with the matching {@code alias} to the new values.
765770
*
766-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
771+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
772+
* @param value1 The first value to use for the query condition.
773+
* @param value2 The second value to use for the query condition.
767774
*/
768775
public Query<T> setParameters(String alias, long value1, long value2) {
769776
checkOpen();
@@ -823,9 +830,11 @@ public Query<T> setParameters(Property<?> property, double value1, double value2
823830
}
824831

825832
/**
826-
* Sets a parameter previously given to the {@link QueryBuilder} to new values.
833+
* Changes the parameters of the query condition with the matching {@code alias} to the new values.
827834
*
828-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
835+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
836+
* @param value1 The first value to use for the query condition.
837+
* @param value2 The second value to use for the query condition.
829838
*/
830839
public Query<T> setParameters(String alias, double value1, double value2) {
831840
checkOpen();
@@ -864,9 +873,11 @@ public Query<T> setParameters(Property<?> property, String key, String value) {
864873
}
865874

866875
/**
867-
* Sets a parameter previously given to the {@link QueryBuilder} to new values.
876+
* Changes the parameters of the query condition with the matching {@code alias} to the new values.
868877
*
869-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
878+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
879+
* @param key The first value to use for the query condition.
880+
* @param value The second value to use for the query condition.
870881
*/
871882
public Query<T> setParameters(String alias, String key, String value) {
872883
checkOpen();
@@ -884,9 +895,10 @@ public Query<T> setParameter(Property<?> property, byte[] value) {
884895
}
885896

886897
/**
887-
* Sets a parameter previously given to the {@link QueryBuilder} to new values.
898+
* Changes the parameter of the query condition with the matching {@code alias} to a new {@code value}.
888899
*
889-
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
900+
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
901+
* @param value The new value to use for the query condition.
890902
*/
891903
public Query<T> setParameter(String alias, byte[] value) {
892904
checkOpen();

0 commit comments

Comments
 (0)