geom 컬럼 Geometry 형태로 선언
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.entity;
|
package com.kamco.cd.kamcoback.postgres.entity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
import jakarta.persistence.Entity;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
||||||
import jakarta.persistence.GenerationType;
|
import com.kamco.cd.kamcoback.common.utils.geometry.GeometrySerializer;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.SequenceGenerator;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import java.time.Instant;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.locationtech.jts.geom.Geometry;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -53,6 +53,11 @@ public class MapSheetLearnDataGeomEntity {
|
|||||||
@Column(name = "area")
|
@Column(name = "area")
|
||||||
private Double area;
|
private Double area;
|
||||||
|
|
||||||
|
@JsonDeserialize(using = GeometryDeserializer.class)
|
||||||
|
@JsonSerialize(using = GeometrySerializer.class)
|
||||||
|
@Column(name = "geom")
|
||||||
|
private Geometry geom;
|
||||||
|
|
||||||
@Size(max = 100)
|
@Size(max = 100)
|
||||||
@Column(name = "geo_type", length = 100)
|
@Column(name = "geo_type", length = 100)
|
||||||
private String geoType;
|
private String geoType;
|
||||||
@@ -70,11 +75,4 @@ public class MapSheetLearnDataGeomEntity {
|
|||||||
private Instant updatedDttm;
|
private Instant updatedDttm;
|
||||||
@Column(name = "updated_uid")
|
@Column(name = "updated_uid")
|
||||||
private Long updatedUid;
|
private Long updatedUid;
|
||||||
|
|
||||||
/*
|
|
||||||
TODO [Reverse Engineering] create field to map the 'geom' column
|
|
||||||
Available actions: Define target Java type | Uncomment as is | Remove column mapping
|
|
||||||
@Column(name = "geom", columnDefinition = "geometry")
|
|
||||||
private Object geom;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user