November 2018
Beginner to intermediate
260 pages
6h 12m
English
SqlQuery takes a class and a SQL string. To fetch Eden Hazard's details, we need to construct a SqlQuery object with the following details:
SqlQuery<SoccerPlayerKey, SoccerPlayer> sqlQuery = new SqlQuery<>(SoccerPlayer.class, "name = ?");
The query method of IgniteCache takes a SqlQuery object and returns QueryCursor. The QueryCursor contains a collection of Entry. An Entry
represents a key-value pair. So, the SqlQuery can fetch you a collection of key-value pairs. The following code snippet queries the playerCache to return a collection of players where the name="Eden Hazard". It returns a QueryCursor of Entry<SoccerPlayerKey, SoccerPlayer>:
QueryCursor<Entry<SoccerPlayerKey, SoccerPlayer>> resultCursor = playerCache ...
Read now
Unlock full access