jpa的一些说明

jpa保存地理空间数据

@ColumnTransformer(read = "st_astext(shape)", write = "st_geometry(?,4490)")
String shape;
shape是wkt格式的数据

 

创建联合索引

@Table(name = "table_project_authority", schema = "mis", uniqueConstraints = {@UniqueConstraint(columnNames = {"userId", "proId"})})
@EqualsAndHashCode(callSuper = true)
@EntityListeners(AuditingEntityListener.class)
public class ProjectAuthorityDO extends BaseEntity{
    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "项目id")
    private Long proId;
}

创建单个索引

@Table(name = "table_users", uniqueConstraints ={@UniqueConstraint(columnNames="account")}, schema = "mis")

  

posted on 2022-04-08 20:51  james-roger  阅读(54)  评论(0编辑  收藏  举报