package com.gurkensalat.osm.entity;

import org.springframework.data.jpa.domain.AbstractPersistable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.persistence.Version;

@Entity
@Table(name = "PLACES")
public class Place extends AbstractPersistable<Long>
{
    @Version
    @Column(name = "VERSION")
    private Integer version;

    @Column(name = "LAT")
    private double lat;

    @Column(name = "LON")
    private double lon;

    @Column(name = "NAME", length = 80)
    private String name;

    @Column(name = "TYPE", length = 20)
    @Enumerated(EnumType.STRING)
    private PlaceType type;

    protected Place()
    {
    }

    public  Place(String name, PlaceType type)
    {
        this.name = name;
        this.type = type;
    }

    public double getLat()
    {
        return lat;
    }

    public double getLon()
    {
        return lon;
    }

    public String getName()
    {
        return name;
    }

    public PlaceType getType()
    {
        return type;
    }

    public Integer getVersion()
    {
        return version;
    }

    public void setLat(double lat)
    {
        this.lat = lat;
    }

    public void setLon(double lon)
    {
        this.lon = lon;
    }

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

    public void setType(PlaceType type)
    {
        this.type = type;
    }

    public void setVersion(Integer version)
    {
        this.version = version;
    }
}

@@ -456,24 +456,126 @@
 r version;%0A%0A
+    @Column(name = %22TYPE%22, length = 20)%0A    @Enumerated(EnumType.STRING)%0A    private PlaceType type;%0A%0A
     @Column(
@@ -742,36 +742,43 @@
 @Column(name = %22
-TYPE
+ADDR_STREET
 %22, length = 20)%0A
@@ -777,71 +777,366 @@
 h = 
-2
+8
 0)%0A    
-@Enumerated(EnumType.STRING)%0A    private PlaceType type
+private String addrStreet;%0A%0A    @Column(name = %22ADDR_NUMBER%22, length = 10)%0A    private String addrHouseNumber;%0A%0A    @Column(name = %22ADDR_POSTCODE%22, length = 10)%0A    private String addrPostcode;%0A%0A    @Column(name = %22ADDR_STATE%22, length = 80)%0A    private String addrState;%0A%0A    @Column(name = %22ADDR_COUNTRY%22, length = 80)%0A    private String addrCountry
 ;%0A%0A 
@@ -1296,20 +1296,27 @@
 lic 
-double getLa
+String getAddrStree
 t()%0A
@@ -1336,18 +1336,25 @@
  return 
-l
 a
+ddrStree
 t;%0A    %7D
@@ -1370,21 +1370,133 @@
 lic 
-double getLon
+void setAddrStreet(String addrStreet)%0A    %7B%0A        this.addrStreet = addrStreet;%0A    %7D%0A%0A    public String getAddrHouseNumber
 ()%0A 
@@ -1515,19 +1515,31 @@
  return 
-lon
+addrHouseNumber
 ;%0A    %7D%0A
@@ -1554,21 +1554,149 @@
 lic 
-String getNam
+void setAddrHouseNumber(String addrHouseNumber)%0A    %7B%0A        this.addrHouseNumber = addrHouseNumber;%0A    %7D%0A%0A    public String getAddrPostcod
 e()%0A
@@ -1716,19 +1716,27 @@
  return 
-nam
+addrPostcod
 e;%0A    %7D
@@ -1752,24 +1752,134 @@
 lic 
-PlaceType getTyp
+void setAddrPostcode(String addrPostcode)%0A    %7B%0A        this.addrPostcode = addrPostcode;%0A    %7D%0A%0A    public String getAddrStat
 e()%0A
@@ -1899,19 +1899,24 @@
  return 
-typ
+addrStat
 e;%0A    %7D
@@ -1932,57 +1932,324 @@
 lic 
-Integer getVersion()%0A    %7B%0A        return version
+void setAddrState(String addrState)%0A    %7B%0A        this.addrState = addrState;%0A    %7D%0A%0A    public String getAddrCountry()%0A    %7B%0A        return addrCountry;%0A    %7D%0A%0A    public void setAddrCountry(String addrCountry)%0A    %7B%0A        this.addrCountry = addrCountry;%0A    %7D%0A%0A    public double getLat()%0A    %7B%0A        return lat
 ;%0A  
@@ -2317,32 +2317,92 @@
 t = lat;%0A    %7D%0A%0A
+    public double getLon()%0A    %7B%0A        return lon;%0A    %7D%0A%0A
     public void 
@@ -2449,32 +2449,94 @@
 n = lon;%0A    %7D%0A%0A
+    public String getName()%0A    %7B%0A        return name;%0A    %7D%0A%0A
     public void 
@@ -2610,67 +2610,201 @@
 lic 
-void setType(PlaceType type)%0A    %7B%0A        this.type = type
+PlaceType getType()%0A    %7B%0A        return type;%0A    %7D%0A%0A    public void setType(PlaceType type)%0A    %7B%0A        this.type = type;%0A    %7D%0A%0A    public Integer getVersion()%0A    %7B%0A        return version
 ;%0A  

Add explicit columns for address types