/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
// Собственно тут мы описываем необходимые поля и методы доступа к ним.
// Сгенерировано Нетбинсом на основании моей таблицы Детали.
package diplom;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
*
* @author konstantin
*/
@Entity
@Table(name = "detali", catalog = "diplom", schema = "")
@NamedQueries({@NamedQuery(name = "Detali.findAll", query = "SELECT d FROM Detali d"), @NamedQuery(name = "Detali.findById", query = "SELECT d FROM Detali d WHERE d.id = :id"), @NamedQuery(name = "Detali.findByNaimenovanie", query = "SELECT d FROM Detali d WHERE d.naimenovanie = :naimenovanie"), @NamedQuery(name = "Detali.findByPrice", query = "SELECT d FROM Detali d WHERE d.price = :price"), @NamedQuery(name = "Detali.findByKolichestvo", query = "SELECT d FROM Detali d WHERE d.kolichestvo = :kolichestvo"), @NamedQuery(name = "Detali.findBySklad", query = "SELECT d FROM Detali d WHERE d.sklad = :sklad"), @NamedQuery(name = "Detali.findByIzgotovitel", query = "SELECT d FROM Detali d WHERE d.izgotovitel = :izgotovitel")})
public class Detali implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "ID")
private Integer id;
@Column(name = "naimenovanie")
private String naimenovanie;
@Column(name = "price")
private Integer price;
@Column(name = "kolichestvo")
private Integer kolichestvo;
@Column(name = "sklad")
private Integer sklad;
@Column(name = "izgotovitel")
private String izgotovitel;
public Detali() {
}
public Detali(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldId = this.id;
this.id = id;
changeSupport.firePropertyChange("id", oldId, id);
}
public String getNaimenovanie() {
return naimenovanie;
}
public void setNaimenovanie(String naimenovanie) {
String oldNaimenovanie = this.naimenovanie;
this.naimenovanie = naimenovanie;
changeSupport.firePropertyChange("naimenovanie", oldNaimenovanie, naimenovanie);
}
public Integer getPrice() {
return price;
}
public void setPrice(Integer price) {
Integer oldPrice = this.price;
this.price = price;
changeSupport.firePropertyChange("price", oldPrice, price);
}
public Integer getKolichestvo() {
return kolichestvo;
}
public void setKolichestvo(Integer kolichestvo) {
Integer oldKolichestvo = this.kolichestvo;
this.kolichestvo = kolichestvo;
changeSupport.firePropertyChange("kolichestvo", oldKolichestvo, kolichestvo);
}
public Integer getSklad() {
return sklad;
}
public void setSklad(Integer sklad) {
Integer oldSklad = this.sklad;
this.sklad = sklad;
changeSupport.firePropertyChange("sklad", oldSklad, sklad);
}
public String getIzgotovitel() {
return izgotovitel;
}
public void setIzgotovitel(String izgotovitel) {
String oldIzgotovitel = this.izgotovitel;
this.izgotovitel = izgotovitel;
changeSupport.firePropertyChange("izgotovitel", oldIzgotovitel, izgotovitel);
}
@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 Detali)) {
return false;
}
Detali other = (Detali) 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 "diplom.Detali[id=" + id + "]";
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
changeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
changeSupport.removePropertyChangeListener(listener);
}
}