package of.the.entities;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author santiago.tapia
*/
@Entity
@Table(name = "ANULACION")
//IF YOU NEED JPA NamedQueries put them here.
public class Anulacion implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@SequenceGenerator(name = "SEQ_FOR_MY_ENTITY", sequenceName = "SEQ_FOR_MY_ENTITY", allocationSize = 1/*, initialValue=1*/)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_FOR_MY_ENTITY")
@NotNull
@Column(name = "ID")
private BigDecimal id;
@ManyToMany()
private List<Error1> err;
public Anulacion() {
}
public Anulacion(BigDecimal id) {
this.id = id;
}
public BigDecimal getId() {
return id;
}
public void setId(BigDecimal id) {
this.id = id;
}
@XmlTransient
public List<Error1> getErr() {
return err;
}
public void setErr(List<Error1> err) {
this.err = err;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.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 Anulacion)) {
return false;
}
Anulacion other = (Anulacion) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "Anulacion[ id=" + id + " ]";
}
}