Skip to content

Commit ab7b854

Browse files
author
ehennum
committed
1 parent a72aa28 commit ab7b854

File tree

15 files changed

+635
-313
lines changed

15 files changed

+635
-313
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/expression/CtsExpr.java

Lines changed: 109 additions & 6 deletions
Large diffs are not rendered by default.

marklogic-client-api/src/main/java/com/marklogic/client/expression/FnExpr.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public interface FnExpr {
379379
*/
380380
public ServerExpression count(ServerExpression arg, ServerExpression maximum);
381381
/**
382-
* Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-date() is *implementation dependent*.
382+
* Returns xs:date(fn:current-dateTime()) . This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-date() is *implementation dependent*.
383383
*
384384
* <a name="ml-server-type-current-date"></a>
385385
@@ -399,7 +399,7 @@ public interface FnExpr {
399399
*/
400400
public ServerExpression currentDateTime();
401401
/**
402-
* Returns xs:time(fn:current-dateTime()). This is an xs:time (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-time() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-time() is *implementation dependent*.
402+
* Returns xs:time(fn:current-dateTime()) . This is an xs:time (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-time() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-time() is *implementation dependent*.
403403
*
404404
* <a name="ml-server-type-current-time"></a>
405405
@@ -1922,7 +1922,7 @@ public interface FnExpr {
19221922
* <p>
19231923
* Provides a client interface to the <a href="http://docs.marklogic.com/fn:sum" target="mlserverdoc">fn:sum</a> server function.
19241924
* @param arg The sequence of values to be summed. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
1925-
* @param zero The value to return as zero if the input sequence is the empty sequence. This parameter is not available in the 0.9-ml XQuery dialect. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
1925+
* @param zero The value to return as zero if the input sequence is the empty sequence. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
19261926
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a> server data type
19271927
*/
19281928
public ServerExpression sum(ServerExpression arg, String zero);
@@ -1931,7 +1931,7 @@ public interface FnExpr {
19311931
* <p>
19321932
* Provides a client interface to the <a href="http://docs.marklogic.com/fn:sum" target="mlserverdoc">fn:sum</a> server function.
19331933
* @param arg The sequence of values to be summed. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
1934-
* @param zero The value to return as zero if the input sequence is the empty sequence. This parameter is not available in the 0.9-ml XQuery dialect. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
1934+
* @param zero The value to return as zero if the input sequence is the empty sequence. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
19351935
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a> server data type
19361936
*/
19371937
public ServerExpression sum(ServerExpression arg, ServerExpression zero);

marklogic-client-api/src/main/java/com/marklogic/client/expression/MathExpr.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public interface MathExpr {
6666
*/
6767
public ServerExpression atan(ServerExpression x);
6868
/**
69-
* Returns the arc tangent of y/x, in radians, in the range from -pi/2 to +pi/2 (inclusive), using the signs of y and x to determine the appropriate quadrant.
69+
* Returns the arc tangent of y/x, in radians, in the range from -pi/2 to +pi/2 (inclusive), using the signs of y and x to determine the apropriate quadrant.
7070
* <p>
7171
* Provides a client interface to the <a href="http://docs.marklogic.com/math:atan2" target="mlserverdoc">math:atan2</a> server function.
7272
* @param y The floating point dividend. (of <a href="{@docRoot}/doc-files/types/xs_double.html">xs:double</a>)
@@ -75,7 +75,7 @@ public interface MathExpr {
7575
*/
7676
public ServerExpression atan2(ServerExpression y, double x);
7777
/**
78-
* Returns the arc tangent of y/x, in radians, in the range from -pi/2 to +pi/2 (inclusive), using the signs of y and x to determine the appropriate quadrant.
78+
* Returns the arc tangent of y/x, in radians, in the range from -pi/2 to +pi/2 (inclusive), using the signs of y and x to determine the apropriate quadrant.
7979
*
8080
* <a name="ml-server-type-atan2"></a>
8181

marklogic-client-api/src/main/java/com/marklogic/client/expression/PlanBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,14 +1279,14 @@ public interface ExportablePlan extends Plan, PlanBuilderBase.ExportablePlanBase
12791279
public interface ModifyPlan extends PreparePlan, PlanBuilderBase.ModifyPlanBase {
12801280
public abstract ModifyPlan bind(PlanExprColSeq columns);
12811281
/**
1282-
* This function adds a column based on an expression without altering the existing columns in the row set.
1282+
* This function is deprecated in favor of the bind() function and will not be supported in MarkLogic 11. This function adds a column based on an expression without altering the existing columns in the row set.
12831283
* @param column The name of the column to be defined.
12841284
* @param expression The expression that specifies the value the column in the row. (of <a href="{@docRoot}/doc-files/types/item.html">item</a>)
12851285
* @return a ModifyPlan object
12861286
*/
12871287
public abstract ModifyPlan bindAs(String column, ServerExpression expression);
12881288
/**
1289-
* This function adds a column based on an expression without altering the existing columns in the row set.
1289+
* This function is deprecated in favor of the bind() function and will not be supported in MarkLogic 11. This function adds a column based on an expression without altering the existing columns in the row set.
12901290
* @param column The name of the column to be defined.
12911291
* @param expression The expression that specifies the value the column in the row. (of <a href="{@docRoot}/doc-files/types/item.html">item</a>)
12921292
* @return a ModifyPlan object

marklogic-client-api/src/main/java/com/marklogic/client/expression/SqlExpr.java

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package com.marklogic.client.expression;
1717

18+
import com.marklogic.client.type.XsAnyAtomicTypeSeqVal;
1819
import com.marklogic.client.type.XsAnyAtomicTypeVal;
1920
import com.marklogic.client.type.XsBooleanVal;
2021
import com.marklogic.client.type.XsDecimalVal;
@@ -44,6 +45,47 @@ public interface SqlExpr {
4445
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_integer.html">xs:integer</a> server data type
4546
*/
4647
public ServerExpression bitLength(ServerExpression str);
48+
/**
49+
* Returns an integer specifying the index of the bucket the second parameter belongs to in buckets formed by the first parameter. Values that lie on the edge of a bucket fall to the lesser index.
50+
* <p>
51+
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:bucket" target="mlserverdoc">sql:bucket</a> server function.
52+
* @param bucketEdgesParam A sequence of ordered values indicating the edges of a collection of buckets. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
53+
* @param srchParam A value to find an index for in the bucket edge list. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
54+
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_unsignedLong.html">xs:unsignedLong</a> server data type
55+
*/
56+
public ServerExpression bucket(ServerExpression bucketEdgesParam, String srchParam);
57+
/**
58+
* Returns an integer specifying the index of the bucket the second parameter belongs to in buckets formed by the first parameter. Values that lie on the edge of a bucket fall to the lesser index.
59+
*
60+
* <a name="ml-server-type-bucket"></a>
61+
62+
* <p>
63+
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:bucket" target="mlserverdoc">sql:bucket</a> server function.
64+
* @param bucketEdgesParam A sequence of ordered values indicating the edges of a collection of buckets. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
65+
* @param srchParam A value to find an index for in the bucket edge list. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
66+
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_unsignedLong.html">xs:unsignedLong</a> server data type
67+
*/
68+
public ServerExpression bucket(ServerExpression bucketEdgesParam, ServerExpression srchParam);
69+
/**
70+
* Returns an integer specifying the index of the bucket the second parameter belongs to in buckets formed by the first parameter. Values that lie on the edge of a bucket fall to the lesser index.
71+
* <p>
72+
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:bucket" target="mlserverdoc">sql:bucket</a> server function.
73+
* @param bucketEdgesParam A sequence of ordered values indicating the edges of a collection of buckets. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
74+
* @param srchParam A value to find an index for in the bucket edge list. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
75+
* @param collationLiteral A collation identifier. (of <a href="{@docRoot}/doc-files/types/xs_string.html">xs:string</a>)
76+
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_unsignedLong.html">xs:unsignedLong</a> server data type
77+
*/
78+
public ServerExpression bucket(ServerExpression bucketEdgesParam, String srchParam, String collationLiteral);
79+
/**
80+
* Returns an integer specifying the index of the bucket the second parameter belongs to in buckets formed by the first parameter. Values that lie on the edge of a bucket fall to the lesser index.
81+
* <p>
82+
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:bucket" target="mlserverdoc">sql:bucket</a> server function.
83+
* @param bucketEdgesParam A sequence of ordered values indicating the edges of a collection of buckets. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
84+
* @param srchParam A value to find an index for in the bucket edge list. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
85+
* @param collationLiteral A collation identifier. (of <a href="{@docRoot}/doc-files/types/xs_string.html">xs:string</a>)
86+
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_unsignedLong.html">xs:unsignedLong</a> server data type
87+
*/
88+
public ServerExpression bucket(ServerExpression bucketEdgesParam, ServerExpression srchParam, ServerExpression collationLiteral);
4789
/**
4890
* Returns an rdf:collatedString value with the given value and collation tag. The rdf:collatedString type extends xs:string , and represents a collation tagged string in RDF.
4991
* <p>
@@ -229,7 +271,7 @@ public interface SqlExpr {
229271
* Returns a string that is the leftmost characters of the target string. The number of characters to return is specified by the second argument.
230272
* <p>
231273
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:left" target="mlserverdoc">sql:left</a> server function.
232-
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/item.html">item</a>)
274+
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
233275
* @param n The number of leftmost characters of the string to return. (of <a href="{@docRoot}/doc-files/types/xs_numeric.html">xs:numeric</a>)
234276
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_string.html">xs:string</a> server data type
235277
*/
@@ -241,7 +283,7 @@ public interface SqlExpr {
241283
242284
* <p>
243285
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:left" target="mlserverdoc">sql:left</a> server function.
244-
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/item.html">item</a>)
286+
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
245287
* @param n The number of leftmost characters of the string to return. (of <a href="{@docRoot}/doc-files/types/xs_numeric.html">xs:numeric</a>)
246288
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_string.html">xs:string</a> server data type
247289
*/
@@ -401,7 +443,7 @@ public interface SqlExpr {
401443
* Returns a string that is the rightmost characters of the target string. The number of characters to return is specified by the second argument.
402444
* <p>
403445
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:right" target="mlserverdoc">sql:right</a> server function.
404-
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/item.html">item</a>)
446+
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
405447
* @param n The number of rightmost characters of the string to return. (of <a href="{@docRoot}/doc-files/types/xs_numeric.html">xs:numeric</a>)
406448
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_string.html">xs:string</a> server data type
407449
*/
@@ -413,7 +455,7 @@ public interface SqlExpr {
413455
414456
* <p>
415457
* Provides a client interface to the <a href="http://docs.marklogic.com/sql:right" target="mlserverdoc">sql:right</a> server function.
416-
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/item.html">item</a>)
458+
* @param str The base string. If the value is not a string, its string value will be used. (of <a href="{@docRoot}/doc-files/types/xs_anyAtomicType.html">xs:anyAtomicType</a>)
417459
* @param n The number of rightmost characters of the string to return. (of <a href="{@docRoot}/doc-files/types/xs_numeric.html">xs:numeric</a>)
418460
* @return a server expression with the <a href="{@docRoot}/doc-files/types/xs_string.html">xs:string</a> server data type
419461
*/

marklogic-client-api/src/main/java/com/marklogic/client/impl/CtsExprImpl.java

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,90 @@ public CtsReferenceExpr collectionReference(ServerExpression options) {
249249
}
250250

251251

252+
@Override
253+
public CtsQueryExpr columnRangeQuery(String schema, String view, String column, String value) {
254+
return columnRangeQuery((schema == null) ? (XsStringVal) null : xs.string(schema), (view == null) ? (XsStringVal) null : xs.string(view), (column == null) ? (XsStringVal) null : xs.string(column), (value == null) ? (XsAnyAtomicTypeVal) null : xs.string(value));
255+
}
256+
257+
258+
@Override
259+
public CtsQueryExpr columnRangeQuery(ServerExpression schema, ServerExpression view, ServerExpression column, ServerExpression value) {
260+
if (schema == null) {
261+
throw new IllegalArgumentException("schema parameter for columnRangeQuery() cannot be null");
262+
}
263+
if (view == null) {
264+
throw new IllegalArgumentException("view parameter for columnRangeQuery() cannot be null");
265+
}
266+
if (column == null) {
267+
throw new IllegalArgumentException("column parameter for columnRangeQuery() cannot be null");
268+
}
269+
return new QueryCallImpl("cts", "column-range-query", new Object[]{ schema, view, column, value });
270+
}
271+
272+
273+
@Override
274+
public CtsQueryExpr columnRangeQuery(String schema, String view, String column, String value, String operator) {
275+
return columnRangeQuery((schema == null) ? (XsStringVal) null : xs.string(schema), (view == null) ? (XsStringVal) null : xs.string(view), (column == null) ? (XsStringVal) null : xs.string(column), (value == null) ? (XsAnyAtomicTypeVal) null : xs.string(value), (operator == null) ? (XsStringVal) null : xs.string(operator));
276+
}
277+
278+
279+
@Override
280+
public CtsQueryExpr columnRangeQuery(ServerExpression schema, ServerExpression view, ServerExpression column, ServerExpression value, ServerExpression operator) {
281+
if (schema == null) {
282+
throw new IllegalArgumentException("schema parameter for columnRangeQuery() cannot be null");
283+
}
284+
if (view == null) {
285+
throw new IllegalArgumentException("view parameter for columnRangeQuery() cannot be null");
286+
}
287+
if (column == null) {
288+
throw new IllegalArgumentException("column parameter for columnRangeQuery() cannot be null");
289+
}
290+
return new QueryCallImpl("cts", "column-range-query", new Object[]{ schema, view, column, value, operator });
291+
}
292+
293+
294+
@Override
295+
public CtsQueryExpr columnRangeQuery(String schema, String view, String column, String value, String operator, String... options) {
296+
return columnRangeQuery((schema == null) ? (XsStringVal) null : xs.string(schema), (view == null) ? (XsStringVal) null : xs.string(view), (column == null) ? (XsStringVal) null : xs.string(column), (value == null) ? (XsAnyAtomicTypeVal) null : xs.string(value), (operator == null) ? (XsStringVal) null : xs.string(operator), (options == null) ? (XsStringVal) null : xs.stringSeq(options));
297+
}
298+
299+
300+
@Override
301+
public CtsQueryExpr columnRangeQuery(ServerExpression schema, ServerExpression view, ServerExpression column, ServerExpression value, ServerExpression operator, ServerExpression options) {
302+
if (schema == null) {
303+
throw new IllegalArgumentException("schema parameter for columnRangeQuery() cannot be null");
304+
}
305+
if (view == null) {
306+
throw new IllegalArgumentException("view parameter for columnRangeQuery() cannot be null");
307+
}
308+
if (column == null) {
309+
throw new IllegalArgumentException("column parameter for columnRangeQuery() cannot be null");
310+
}
311+
return new QueryCallImpl("cts", "column-range-query", new Object[]{ schema, view, column, value, operator, options });
312+
}
313+
314+
315+
@Override
316+
public CtsQueryExpr columnRangeQuery(String schema, String view, String column, String value, String operator, String options, double weight) {
317+
return columnRangeQuery((schema == null) ? (XsStringVal) null : xs.string(schema), (view == null) ? (XsStringVal) null : xs.string(view), (column == null) ? (XsStringVal) null : xs.string(column), (value == null) ? (XsAnyAtomicTypeVal) null : xs.string(value), (operator == null) ? (XsStringVal) null : xs.string(operator), (options == null) ? (XsStringVal) null : xs.string(options), xs.doubleVal(weight));
318+
}
319+
320+
321+
@Override
322+
public CtsQueryExpr columnRangeQuery(ServerExpression schema, ServerExpression view, ServerExpression column, ServerExpression value, ServerExpression operator, ServerExpression options, ServerExpression weight) {
323+
if (schema == null) {
324+
throw new IllegalArgumentException("schema parameter for columnRangeQuery() cannot be null");
325+
}
326+
if (view == null) {
327+
throw new IllegalArgumentException("view parameter for columnRangeQuery() cannot be null");
328+
}
329+
if (column == null) {
330+
throw new IllegalArgumentException("column parameter for columnRangeQuery() cannot be null");
331+
}
332+
return new QueryCallImpl("cts", "column-range-query", new Object[]{ schema, view, column, value, operator, options, weight });
333+
}
334+
335+
252336
@Override
253337
public CtsPolygonExpr complexPolygon(ServerExpression outer, ServerExpression inner) {
254338
if (outer == null) {
@@ -1781,7 +1865,7 @@ public ServerExpression pointLongitude(ServerExpression point) {
17811865
return new XsExprImpl.NumericCallImpl("cts", "point-longitude", new Object[]{ point });
17821866
}
17831867

1784-
1868+
17851869
@Override
17861870
public CtsPolygonExpr polygon(ServerExpression vertices) {
17871871
return new PolygonCallImpl("cts", "polygon", new Object[]{ vertices });

0 commit comments

Comments
 (0)