package semesterprojectv5;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
*
* @author alexa
*/
@Table(name = "COUNTRY")
@NamedQueries({
@NamedQuery(name = "Country.findAll", query = "SELECT c FROM Country c"),
@NamedQuery(name = "Country.findByCountry", query = "SELECT c FROM Country c WHERE c.country = :country"),
@NamedQuery(name = "Country.findByName", query = "SELECT c FROM Country c WHERE c.name = :name"),
@NamedQuery(name = "Country.findByLat", query = "SELECT c FROM Country c WHERE c.lat = :lat"),
@NamedQuery(name = "Country.findByLong1", query = "SELECT c FROM Country c WHERE c.long1 = :long1")})
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "COUNTRY")
@Basic(optional = false)
@Column(name = "NAME")
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "LAT")
@Column(name = "LONG")
@OneToMany(cascade = CascadeType.ALL, mappedBy = "country")
private Collection<Coviddata> coviddataCollection;
public Country() {
}
this.country = country;
}
this.country = country;
this.name = name;
}
return country;
}
public void setCountry
(Integer country
) {
this.country = country;
}
return name;
}
public void setName
(String name
) {
this.name = name;
}
return lat;
}
public void setLat
(Double lat
) {
this.lat = lat;
}
return long1;
}
public void setLong1
(Double long1
) {
this.long1 = long1;
}
public Collection<Coviddata> getCoviddataCollection() {
return coviddataCollection;
}
public void setCoviddataCollection(Collection<Coviddata> coviddataCollection) {
this.coviddataCollection = coviddataCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (country != null ? country.hashCode() : 0);
return hash;
}
@Override
public boolean equals
(Object object
) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Country)) {
return false;
}
Country other = (Country) object;
if ((this.country == null && other.country != null) || (this.country != null && !this.country.equals(other.country))) {
return false;
}
return true;
}
@Override
return "semesterprojectv5.Country[ country=" + country + " ]";
}
}