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")