【发布时间】:2015-09-15 15:05:34
【问题描述】:
让这个类AddressInfo带有一个内部类Coordinate我在部署时出错:“没有定义相应的setter方法”,但是定义了setter方法!
@SuppressWarnings("serial")
@Entity
@Immutable
@Table(name = "T_ADDRESS_INFO")
public class AddressInfo implements java.io.Serializable {
public class Coordinate {
double latitude;
double longitude;
Coordinate(int latitude, int longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
}
private Long id;
private String street;
private String address;
private String code;
private String city;
private String phone;
private String fax;
private String email;
private String website;
private String info;
private String latitude;
private String longitude;
public AddressInfo() {
}
...
}
我在部署时遇到此错误
Exception [EclipseLink-7174] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The getter method [method getLatitude] on entity class [class AddressInfo] does not have a corresponding setter method defined.
【问题讨论】:
标签: java spring-mvc jpa