/*
 * 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.TARMCARGADETALLE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmcargadetalle.findAll", query = "SELECT t FROM Tarmcargadetalle t"),
    @NamedQuery(name = "Tarmcargadetalle.findByCcargadetalle", query = "SELECT t FROM Tarmcargadetalle t WHERE t.ccargadetalle = :ccargadetalle"),
    @NamedQuery(name = "Tarmcargadetalle.findByCarma", query = "SELECT t FROM Tarmcargadetalle t WHERE t.carma = :carma")})
public class Tarmcargadetalle implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CCARGADETALLE")
    private String ccargadetalle;
    @Basic(optional = false)
    @Column(name = "CARMA")
    private String carma;
    @JoinColumn(name = "CCARGA", referencedColumnName = "CCARGA")
    @ManyToOne(optional = false)
    private Tarmcarga ccarga;

    public Tarmcargadetalle() {
    }

    public Tarmcargadetalle(String ccargadetalle) {
        this.ccargadetalle = ccargadetalle;
    }

    public Tarmcargadetalle(String ccargadetalle, String carma) {
        this.ccargadetalle = ccargadetalle;
        this.carma = carma;
    }

    public String getCcargadetalle() {
        return ccargadetalle;
    }

    public void setCcargadetalle(String ccargadetalle) {
        this.ccargadetalle = ccargadetalle;
    }

    public String getCarma() {
        return carma;
    }

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

    public Tarmcarga getCcarga() {
        return ccarga;
    }

    public void setCcarga(Tarmcarga ccarga) {
        this.ccarga = ccarga;
    }

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

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