我有一个Entity LocationsCoordinates用于保存具有唯一位置和国家(制作复合主键)的数据库中位置的坐标,其定义如下:
@Entity
@Table(name = "LOCATIONS_COORDINATES")
@IdClass(LocationsCoordinatesPK.class)
public class LocationsCoordinates implements Serializable {
private static final long serialVersionUID = -4580217081464519853L;
@Id
@Column(name = "LOCATION")
String location;
@Id
@Column(name = "COUNTRY")
String country;
@Column(name = "LATITUDE")
Double latitude;
@Column(name = "LONGITUDE")
Double longitude;
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public Double getLatitude() {
return …Run Code Online (Sandbox Code Playgroud)