August 2017
Intermediate to advanced
332 pages
9h 16m
English
The next step is to rename the column in the source code model and to use both database columns for the set and get operations. We can change it in the Calculation class:
public class Calculation { ... private String sum; ... public Calculation(String a, String b, String sum, Timestamp createdAt) { this.a = a; this.b = b; this.sum = sum; this.result = sum; this.createdAt = createdAt; } public String getSum() { return sum != null ? sum : result; }}
From now on, every time we add a row into the database, the same value is written to ...
Read now
Unlock full access