public class Point extends Object implements AttributeConverter<Point,byte[]>, Serializable
| 构造器和说明 |
|---|
Point(double longitude,
double latitude) |
Point(double longitude,
double latitude,
int srid) |
Point(double longitude,
double latitude,
int srid,
ByteOrder byteOrder) |
Point(Point point) |
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
convertToDatabaseColumn(Point point)
将实体属性值转换为数据库列的值。
|
Point |
convertToEntityAttribute(byte[] dbData)
将数据库列的值转换为实体属性值。
|
boolean |
equals(Object obj) |
ByteOrder |
getByteOrder()
获取字节序(Byte Order),表示字节的存储顺序。
|
double |
getLatitude()
获取纬度(Latitude),表示南北方向的位置,范围是-90到90。
|
double |
getLongitude()
获取经度(Longitude),表示东西方向的位置,范围是-180到180。
|
int |
getSrid()
获取SRID(空间参考系统标识符),用于标识空间参考坐标系统。
|
int |
hashCode() |
void |
setByteOrder(ByteOrder byteOrder)
设置字节序(Byte Order),用于指定数据的字节存储顺序。
|
void |
setLatitude(double latitude)
设置纬度(Latitude),表示南北方向的位置,范围是-90到90。
|
void |
setLongitude(double longitude)
设置经度(Longitude),表示东西方向的位置,范围是-180到180。
|
void |
setSrid(int srid)
设置SRID(空间参考系统标识符),用于标识空间参考坐标系统。
|
String |
toPointString()
以 WKT(Well-Known Text)格式返回点的字符串表示。
|
String |
toString() |
isSkipConvertToDatabaseColumn, isSkipConvertToEntityAttributepublic Point(double longitude,
double latitude)
public Point(double longitude,
double latitude,
int srid)
public Point(double longitude,
double latitude,
int srid,
ByteOrder byteOrder)
public double getLongitude()
public void setLongitude(double longitude)
longitude - 经度值public double getLatitude()
public void setLatitude(double latitude)
latitude - 纬度值public int getSrid()
public void setSrid(int srid)
srid - SRID值public ByteOrder getByteOrder()
public void setByteOrder(ByteOrder byteOrder)
byteOrder - 字节序(Byte Order)public String toPointString()
格式示例:
POINT (longitude latitude)例如:如果经度为 120.1234,纬度为 30.5678,则返回:
POINT (120.1234 30.5678)
public byte[] convertToDatabaseColumn(Point point)
AttributeConverterconvertToDatabaseColumn 在接口中 AttributeConverter<Point,byte[]>point - 实体属性值public Point convertToEntityAttribute(byte[] dbData)
AttributeConverterconvertToEntityAttribute 在接口中 AttributeConverter<Point,byte[]>dbData - 数据库列值Copyright © 2024–2025 Dynamic-SQL. All rights reserved.