/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TARMBODEGA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmbodega.findAll", query = "SELECT t FROM Tarmbodega t"),
    @NamedQuery(name = "Tarmbodega.findByCbodega", query = "SELECT t FROM Tarmbodega t WHERE t.cbodega = :cbodega")})
public class Tarmbodega implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CBODEGA")
    private Long cbodega;
    @JoinColumn(name = "CARMA", referencedColumnName = "CARMA")
    @ManyToOne
    private Tarmarmas carma;
    @JoinColumn(name = "CCENTROCONTROL", referencedColumnName = "CCENTROCONTROL")
    @ManyToOne
    private Tarmcentrocontrol ccentrocontrol;

    public Tarmbodega() {
    }

    public Tarmbodega(Long cbodega) {
        this.cbodega = cbodega;
    }

    public Long getCbodega() {
        return cbodega;
    }

    public void setCbodega(Long cbodega) {
        this.cbodega = cbodega;
    }

    public Tarmarmas getCarma() {
        return carma;
    }

    public void setCarma(Tarmarmas carma) {
        this.carma = carma;
    }

    public Tarmcentrocontrol getCcentrocontrol() {
        return ccentrocontrol;
    }

    public void setCcentrocontrol(Tarmcentrocontrol ccentrocontrol) {
        this.ccentrocontrol = ccentrocontrol;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cbodega != null ? cbodega.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 Tarmbodega)) {
            return false;
        }
        Tarmbodega other = (Tarmbodega) object;
        if ((this.cbodega == null && other.cbodega != null) || (this.cbodega != null && !this.cbodega.equals(other.cbodega))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.Tarmbodega[ cbodega=" + cbodega + " ]";
    }
    
}
