From 4eacde203330ad515ec21f4c8d085ae38788de9d Mon Sep 17 00:00:00 2001 From: CyrilFeng <1491087363@qq.com> Date: Thu, 26 Oct 2023 00:20:46 +0800 Subject: [PATCH] IGNITE-20552 Fix ScanQuery code snippet (#10974) --- .../org/apache/ignite/snippets/UsingScanQueries.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/UsingScanQueries.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/UsingScanQueries.java index e14668b948158..92aac8be2aa43 100644 --- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/UsingScanQueries.java +++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/UsingScanQueries.java @@ -101,11 +101,12 @@ void executingIndexQueriesExample() { try (Ignite ignite = Ignition.start()) { //tag::idxQry[] // Create index by 2 fields (orgId, salary). + LinkedHashMap fields = new LinkedHashMap<>(); + fields.put("orgId", Integer.class.getName()); + fields.put("salary", Integer.class.getName()); + QueryEntity personEntity = new QueryEntity(Integer.class, Person.class) - .setFields(new LinkedHashMap() {{ - put("orgId", Integer.class.getName()); - put("salary", Integer.class.getName()); - }}) + .setFields(fields) .setIndexes(Collections.singletonList( new QueryIndex(Arrays.asList("orgId", "salary"), QueryIndexType.SORTED) .setName("ORG_SALARY_IDX")