November 2018
Beginner to intermediate
260 pages
6h 12m
English
In this section, we will use an affinity key to store the related objects together. We will create two caches: player_sql_cache & club_sql_cache, to store the soccer players and clubs respectively, then use SQL queries to fetch details. The following class represents a SoccerPlayer:
public class SoccerPlayer implements Serializable { private static final long serialVersionUID = 1L; @QuerySqlField(index=true) private Long id; @QuerySqlField private String name; @QuerySqlField private double salary; @QuerySqlField(index=true) private Long clubId; public SoccerPlayer(Long id, String name, double salary, Long clubId) { super(); this.id = id; this.name = name; this.salary = salary; this.clubId = clubId; } @Override public String Read now
Unlock full access