+ private void writeObject(ObjectOutputStream oos) throws IOException {}
+
+ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {}
+
+ public Country getResidenceCountry() {
+ return residenceCountry;
+ }
+
+ public void setResidenceCountry(Country residenceCountry) {
+ this.residenceCountry = residenceCountry;
+ rawUpdateCountryData();
+ }
+
+ private void rawUpdateCountryData() {
+ try (GigiPreparedStatement update = new GigiPreparedStatement("UPDATE users SET country=? WHERE id=?")) {
+ update.setString(1, residenceCountry == null ? null : residenceCountry.getCode());
+ update.setInt(2, getId());
+ update.executeUpdate();
+ }
+ }