diff --git a/class.png b/class.png index f572945..912e422 100644 --- a/class.png +++ b/class.png Binary files differ diff --git a/class.pu b/class.pu index da9f304..96fbd23 100644 --- a/class.pu +++ b/class.pu @@ -3,20 +3,21 @@ database "h2" as db { entity city { + id : BIGINT - citycode : VARCHAR(255) - cityname : VARCHAR(255) - folder : VARCHAR(255) - lng : VARCHAR(255) - lat :VARCHAR(255) + - citycode : VARCHAR 255 + cityname : VARCHAR 255 + folder : VARCHAR 255 + lng : VARCHAR 255 + lat :VARCHAR 255 } + entity site_user { + id : BIGINT active : BOOLEAN admin : BOOLEAN - email : VARCHAR(255) - password : VARCHAR(255) - role :VARCHAR(255) - username :VARCHAR(20) + email : VARCHAR 255 + password : VARCHAR 255 + role :VARCHAR 255 + username :VARCHAR 20 } } note bottom of db : spring.datasource.url=jdbc:h2:./taskdb\nspring.jpa.hibernate.ddl-auto=update @@ -76,7 +77,7 @@ class City <> { + id : Long - - citycode : String + + citycode : String - cityname : String - folder : String - lng : String @@ -102,7 +103,9 @@ } CityIndex *-- City -interface CityRepository <> { +interface CityRepository <> { + deleteByCitycode(String) + findByCitycode(String) : Object } CityRepository <|-- City diff --git a/src/main/java/osm/surveyor/task/city/model/City.java b/src/main/java/osm/surveyor/task/city/model/City.java index a4fde59..6f5a7fd 100644 --- a/src/main/java/osm/surveyor/task/city/model/City.java +++ b/src/main/java/osm/surveyor/task/city/model/City.java @@ -16,9 +16,9 @@ public class City { @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - + @NotBlank private String citycode; @@ -34,20 +34,24 @@ @NotBlank private String lat = "0.0"; + public void setCitycode(String citycode) { + this.citycode = citycode; + } + public void setLng(String str) { - this.lng = str; + this.lng = str; } public void setLng(BigDecimal dec) { - this.lng = dec.toString(); + this.lng = dec.toString(); } public void setLat(String str) { - this.lat = str; + this.lat = str; } public void setLat(BigDecimal dec) { - this.lat = dec.toString(); + this.lat = dec.toString(); } public void setCoordinates(BigDecimal lng, BigDecimal lat) {