package com.hendyirawan.jws1036;

import com.google.common.base.MoreObjects;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

@Entity
public class Country implements Serializable {
    @Id
    private String code;
    private String name;
    private String continent;
    private String region;
    @Column(name = "surfacearea")
    private String surfaceArea;
    @Column(name = "indepyear")
    private String indepYear;
    private String population;
    @Column(name = "lifeexpectancy")
    private Float lifeExpectancy;
    private BigDecimal gnp;
    @Column(name = "gnpold")
    private BigDecimal gnpOld;
    @Column(name = "localname")
    private String localName;
    @Column(name = "governmentform")
    private String governmentForm;
    @Column(name = "headofstate")
    private String headOfState;
    @ManyToOne @JoinColumn(name = "capital")
    private City capital;
    @Column(name = "capital", updatable = false, insertable = false)
    private Integer capitalId;
    private String code2;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContinent() {
        return continent;
    }

    public void setContinent(String continent) {
        this.continent = continent;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getSurfaceArea() {
        return surfaceArea;
    }

    public void setSurfaceArea(String surfaceArea) {
        this.surfaceArea = surfaceArea;
    }

    public String getIndepYear() {
        return indepYear;
    }

    public void setIndepYear(String indepYear) {
        this.indepYear = indepYear;
    }

    public String getPopulation() {
        return population;
    }

    public void setPopulation(String population) {
        this.population = population;
    }

    public Float getLifeExpectancy() {
        return lifeExpectancy;
    }

    public void setLifeExpectancy(Float lifeExpectancy) {
        this.lifeExpectancy = lifeExpectancy;
    }

    public BigDecimal getGnp() {
        return gnp;
    }

    public void setGnp(BigDecimal gnp) {
        this.gnp = gnp;
    }

    public BigDecimal getGnpOld() {
        return gnpOld;
    }

    public void setGnpOld(BigDecimal gnpOld) {
        this.gnpOld = gnpOld;
    }

    public String getLocalName() {
        return localName;
    }

    public void setLocalName(String localName) {
        this.localName = localName;
    }

    public String getGovernmentForm() {
        return governmentForm;
    }

    public void setGovernmentForm(String governmentForm) {
        this.governmentForm = governmentForm;
    }

    public String getHeadOfState() {
        return headOfState;
    }

    public void setHeadOfState(String headOfState) {
        this.headOfState = headOfState;
    }

    public City getCapital() {
        return capital;
    }

    public void setCapital(City capital) {
        this.capital = capital;
    }

    public Integer getCapitalId() {
        return capitalId;
    }

    public void setCapitalId(Integer capitalId) {
        this.capitalId = capitalId;
    }

    public String getCode2() {
        return code2;
    }

    public void setCode2(String code2) {
        this.code2 = code2;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("code", code)
                .add("name", name)
                .add("continent", continent)
                .add("region", region)
                .add("surfaceArea", surfaceArea)
                .add("indepYear", indepYear)
                .add("population", population)
                .add("lifeExpectancy", lifeExpectancy)
                .add("gnp", gnp)
                .add("gnpOld", gnpOld)
                .add("localName", localName)
                .add("governmentForm", governmentForm)
                .add("headOfState", headOfState)
                .add("capitalId", capitalId)
                .add("code2", code2)
                .toString();
    }
}

@@ -374,22 +374,21 @@
 private 
-String
+Float
  surface
@@ -438,21 +438,20 @@
 rivate S
-tring
+hort
  indepYe
@@ -466,22 +466,23 @@
 private 
-String
+Integer
  populat
@@ -1612,30 +1612,29 @@
 %0A    public 
-String
+Float
  getSurfaceA
@@ -1707,22 +1707,21 @@
 aceArea(
-String
+Float
  surface
@@ -1783,29 +1783,28 @@
     public S
-tring
+hort
  getIndepYea
@@ -1872,21 +1872,20 @@
 epYear(S
-tring
+hort
  indepYe
@@ -1940,30 +1940,31 @@
 %0A    public 
-String
+Integer
  getPopulati
@@ -2034,22 +2034,23 @@
 ulation(
-String
+Integer
  populat

fix types