Skip to content

Commit 97da46c

Browse files
authored
Merge pull request #1610 from marklogic/feature/1603-docs
#1603 Deprecating the `directory` method that receives a depth value
2 parents 2acbd67 + ac237b7 commit 97da46c

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

examples/src/main/java/com/marklogic/client/example/cookbook/datamovement/BulkLoadFromJdbcRaw.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public void load() throws IOException, SQLException {
193193

194194
public void transform() throws IOException, SQLException {
195195
// search for all records in the /employees/ directory
196-
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(1, "/employees/");
196+
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(false, "/employees/");
197197

198198
// the QueryBatcher efficiently paginates through matching batches from all
199199
// appropriate nodes in the cluster then applies the transform on each batch

examples/src/main/java/com/marklogic/client/example/cookbook/datamovement/ExtractRowsViaTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static void main(String[] args) throws ParseException, IOException {
6363

6464
public void run() throws ParseException, IOException {
6565
setup();
66-
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(1, "/employees/");
66+
StructuredQueryDefinition query = new StructuredQueryBuilder().directory(false, "/employees/");
6767
QueryBatcher qb = moveMgr.newQueryBatcher(query)
6868
.onUrisReady(
6969
// This object will be closed by the QueryBatcher when stopJob is

marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,11 @@ public StructuredQueryDefinition directory(boolean isInfinite, String... uris) {
469469
* A value of 1 means to exclude subdirectories.
470470
* @param uris the identifiers for the criteria directories
471471
* @return the StructuredQueryDefinition for the directory query
472+
* @deprecated since 4.6.1; a directory query in MarkLogic does not support custom depths; it is either limited
473+
* to the given directory or it is "infinite". For that reason, prefer the {@code directory} method that accepts a
474+
* boolean indicating whether the directory query is infinite.
472475
*/
476+
@Deprecated
473477
public StructuredQueryDefinition directory(int depth, String... uris) {
474478
return new DirectoryQuery(depth, uris);
475479
}

marklogic-client-api/src/test/java/com/marklogic/client/test/BulkReadWriteTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public void testC_BulkSearch() {
197197
SearchHandle searchHandle = new SearchHandle();
198198
int pageLength = 100;
199199
docMgr.setPageLength(pageLength);
200-
DocumentPage page = docMgr.search(new StructuredQueryBuilder().directory(1, DIRECTORY), 1, searchHandle);
200+
DocumentPage page = docMgr.search(new StructuredQueryBuilder().directory(false, DIRECTORY), 1, searchHandle);
201201
try {
202202
for ( DocumentRecord record : page ) {
203203
validateRecord(record);

marklogic-client-api/src/test/java/com/marklogic/client/test/MarkLogicCloudAuthenticationDebugger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void main(String[] args) throws Exception {
4949
}
5050

5151
System.out.println(client.newQueryManager().search(
52-
client.newQueryManager().newStructuredQueryBuilder().directory(0, "/")
52+
client.newQueryManager().newStructuredQueryBuilder().directory(true, "/")
5353
, new JacksonHandle()).get().toPrettyString());
5454

5555
System.out.println("Successfully finished cloud-based authentication test");

marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/QueryBatcherFailureTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void invalidQuery() {
4040

4141
FailedRequestException ex = assertThrows(FailedRequestException.class, () ->
4242
client.newDataMovementManager().newQueryBatcher(
43-
client.newQueryManager().newStructuredQueryBuilder().directory(0, "/invalid/path")
43+
client.newQueryManager().newStructuredQueryBuilder().directory(false, "/invalid/path")
4444
).onQueryFailure(failure -> failureMessages.add(failure.getMessage()))
4545
);
4646

0 commit comments

Comments
 (0)