Nuñito Calzada
Nuñito Calzada

Reputation: 2056

org.eclipse.persistence.exceptions.ValidationException in Spring Framework 3.2.8

Having this class AddressInfo with an inner class Coordinate I have an error when deploying: "does not have a corresponding setter method defined", but the setter method is defined !

@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() {
    }

...

}

I got this error while deploying

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.

Upvotes: 1

Views: 993

Answers (1)

Nuñito Calzada
Nuñito Calzada

Reputation: 2056

Fixed !

@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;
        }

        @Column(name = "LATITUDE")
        public double getLatitude() {
            return latitude;
        }

        public void setLatitude(double latitude) {
            this.latitude = latitude;
        }

        @Column(name = "LONGITUDE")
        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;


    public AddressInfo() {
    }

Upvotes: 3

Related Questions