Skip to content

Commit

Permalink
IGNITE-20552 Fix ScanQuery code snippet (#10974)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrilFeng authored Oct 25, 2023
1 parent 6ac26a0 commit 4eacde2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ void executingIndexQueriesExample() {
try (Ignite ignite = Ignition.start()) {
//tag::idxQry[]
// Create index by 2 fields (orgId, salary).
LinkedHashMap<String,String> 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<String, String>() {{
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")
Expand Down

0 comments on commit 4eacde2

Please sign in to comment.