
package org.openhds.domain.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.openhds.domain.annotations.Description;
import org.openhds.domain.constraint.CheckFieldNotBlank;
import org.openhds.domain.constraint.ExtensionStringConstraint;
import org.openhds.domain.constraint.Searchable;


/**
 * Generated by JCodeModel
 * 
 */
@Description(description = "All distinct Locations within the area of study are represented here. A Location is identified by a uniquely generated identifier that the system uses internally. Each Location has a name associated with it and resides at a particular level within the Location Hierarchy.")
@Entity
@Table(name = "location")
public class Location
    extends AuditableCollectedEntity
    implements Serializable
{

    public final static long serialVersionUID = 169551578162260199L;
    @NotNull
    @CheckFieldNotBlank
    @Searchable
    @Description(description = "External Id of the location. This id is used internally.")
    private String extId;
    @CheckFieldNotBlank
    @Searchable
    @Description(description = "Name of the location.")
    private String locationName;
    @ManyToOne
    @Cascade(CascadeType.SAVE_UPDATE)
    private LocationHierarchy locationLevel = new LocationHierarchy();
    @ExtensionStringConstraint(constraint = "locationTypeConstraint", message = "Invalid Value for location type", allowNull = true)
    @Description(description = "The type of Location.")
    private String locationType;
    @OneToMany(targetEntity = org.openhds.domain.model.Residency.class)
    @JoinColumn(name = "location_uuid")
    private List<Residency> residencies;

    public String getExtId() {
        return extId;
    }

    public void setExtId(String id) {
        extId = id;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String name) {
        locationName = name;
    }

    public LocationHierarchy getLocationLevel() {
        return locationLevel;
    }

    public void setLocationLevel(LocationHierarchy level) {
        locationLevel = level;
    }

    public String getLocationType() {
        return locationType;
    }

    public void setLocationType(String type) {
        locationType = type;
    }

    public List<Residency> getResidencies() {
        return residencies;
    }

    public void setResidencies(List<Residency> list) {
        residencies = list;
    }

}

@@ -1833,24 +1833,442 @@
 ationType;%0D%0A
+    @Description(description = %22The longitude for the Location%22)%0D%0A    private String longitude;%0D%0A    @Description(description = %22The latitude for the Location%22)%0D%0A    private String latitude;%0D%0A    @Description(description = %22How accurate are the longitude/latitude readings for the Location%22)%0D%0A    private String accuracy;%0D%0A    @Description(description = %22The altitude for the Location%22)%0D%0A    private String altitude;%0D%0A
     @OneToMa
@@ -3061,32 +3061,628 @@
 type;%0D%0A    %7D%0D%0A%0D%0A
+    public String getLongitude() %7B%0D%0A        return longitude;%0D%0A    %7D%0D%0A%0D%0A    public void setLongitude(String longi) %7B%0D%0A        longitude = longi;%0D%0A    %7D%0D%0A%0D%0A    public String getLatitude() %7B%0D%0A        return latitude;%0D%0A    %7D%0D%0A%0D%0A    public void setLatitude(String lat) %7B%0D%0A        latitude = lat;%0D%0A    %7D%0D%0A%0D%0A    public String getAccuracy() %7B%0D%0A        return accuracy;%0D%0A    %7D%0D%0A%0D%0A    public void setAccuracy(String acc) %7B%0D%0A        accuracy = acc;%0D%0A    %7D%0D%0A%0D%0A    public String getAltitude() %7B%0D%0A        return altitude;%0D%0A    %7D%0D%0A%0D%0A    public void setAltitude(String alt) %7B%0D%0A        altitude = alt;%0D%0A    %7D%0D%0A%0D%0A
     public List%3C

Added longitude, latitude, accuracy, and altitude to the Location entity.