geom 컬럼 Geometry 형태로 선언
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
||||
import com.kamco.cd.kamcoback.common.utils.geometry.GeometrySerializer;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -53,6 +53,11 @@ public class MapSheetLearnDataGeomEntity {
|
||||
@Column(name = "area")
|
||||
private Double area;
|
||||
|
||||
@JsonDeserialize(using = GeometryDeserializer.class)
|
||||
@JsonSerialize(using = GeometrySerializer.class)
|
||||
@Column(name = "geom")
|
||||
private Geometry geom;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "geo_type", length = 100)
|
||||
private String geoType;
|
||||
@@ -70,11 +75,4 @@ public class MapSheetLearnDataGeomEntity {
|
||||
private Instant updatedDttm;
|
||||
@Column(name = "updated_uid")
|
||||
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