Skip to content

Commit e06f761

Browse files
committed
Query.setParameters with String[]
1 parent 624e28a commit e06f761

File tree

1 file changed

+21
-0
lines changed
  • objectbox-java/src/main/java/io/objectbox/query

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ native void nativeSetParameter(long handle, int entityId, int propertyId, @Nulla
7878
native void nativeSetParameters(long handle, int entityId, int propertyId, @Nullable String parameterAlias,
7979
double value1, double value2);
8080

81+
native void nativeSetParameters(long handle, int entityId, int propertyId, @Nullable String parameterAlias,
82+
String[] values);
83+
8184
final Box<T> box;
8285
private final BoxStore store;
8386
private final boolean hasOrder;
@@ -535,6 +538,24 @@ public Query<T> setParameters(String alias, double value1, double value2) {
535538
return this;
536539
}
537540

541+
/**
542+
* Sets a parameter previously given to the {@link QueryBuilder} to new values.
543+
*/
544+
public Query<T> setParameters(Property property, String[] values) {
545+
nativeSetParameters(handle, property.getEntityId(), property.getId(), null, values);
546+
return this;
547+
}
548+
549+
/**
550+
* Sets a parameter previously given to the {@link QueryBuilder} to new values.
551+
*
552+
* @param alias as defined using {@link QueryBuilder#parameterAlias(String)}.
553+
*/
554+
public Query<T> setParameters(String alias, String[] values) {
555+
nativeSetParameters(handle, 0, 0, alias, values);
556+
return this;
557+
}
558+
538559
/**
539560
* Removes (deletes) all Objects matching the query
540561
*

0 commit comments

Comments
 (0)