/*
 * 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 java.math.BigInteger;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEPARROQUIA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneparroquia.findAll", query = "SELECT t FROM Tgeneparroquia t"),
    @NamedQuery(name = "Tgeneparroquia.findByCountrycode", query = "SELECT t FROM Tgeneparroquia t WHERE t.tgeneparroquiaPK.countrycode = :countrycode"),
    @NamedQuery(name = "Tgeneparroquia.findByProvincecode", query = "SELECT t FROM Tgeneparroquia t WHERE t.tgeneparroquiaPK.provincecode = :provincecode"),
    @NamedQuery(name = "Tgeneparroquia.findByCantoncode", query = "SELECT t FROM Tgeneparroquia t WHERE t.tgeneparroquiaPK.cantoncode = :cantoncode"),
    @NamedQuery(name = "Tgeneparroquia.findByParroquiacode", query = "SELECT t FROM Tgeneparroquia t WHERE t.tgeneparroquiaPK.parroquiacode = :parroquiacode"),
    @NamedQuery(name = "Tgeneparroquia.findByRecordversion", query = "SELECT t FROM Tgeneparroquia t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgeneparroquia.findByDescription", query = "SELECT t FROM Tgeneparroquia t WHERE t.description = :description")})
public class Tgeneparroquia implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneparroquiaPK tgeneparroquiaPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tcustpersonaddress> tcustpersonaddressCollection;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tarmarmas> tarmarmasCollection;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tarmlectura> tarmlecturaCollection;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tcustpeople> tcustpeopleCollection;
    @JoinColumns({
        @JoinColumn(name = "COUNTRYCODE", referencedColumnName = "COUNTRYCODE", insertable = false, updatable = false),
        @JoinColumn(name = "PROVINCECODE", referencedColumnName = "PROVINCECODE", insertable = false, updatable = false),
        @JoinColumn(name = "CANTONCODE", referencedColumnName = "CANTONCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenecanton tgenecanton;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tarmsitioalmacenamiento> tarmsitioalmacenamientoCollection;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tarmagenciasucursal> tarmagenciasucursalCollection;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tarmdecomiso> tarmdecomisoCollection;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tcustpeoplerealassets> tcustpeoplerealassetsCollection;
    @OneToMany(mappedBy = "tgeneparroquia")
    private Collection<Tarmcentrocontrol> tarmcentrocontrolCollection;

    public Tgeneparroquia() {
    }

    public Tgeneparroquia(TgeneparroquiaPK tgeneparroquiaPK) {
        this.tgeneparroquiaPK = tgeneparroquiaPK;
    }

    public Tgeneparroquia(String countrycode, String provincecode, String cantoncode, String parroquiacode) {
        this.tgeneparroquiaPK = new TgeneparroquiaPK(countrycode, provincecode, cantoncode, parroquiacode);
    }

    public TgeneparroquiaPK getTgeneparroquiaPK() {
        return tgeneparroquiaPK;
    }

    public void setTgeneparroquiaPK(TgeneparroquiaPK tgeneparroquiaPK) {
        this.tgeneparroquiaPK = tgeneparroquiaPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

    public void setRecordversion(BigInteger recordversion) {
        this.recordversion = recordversion;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @XmlTransient
    public Collection<Tcustpersonaddress> getTcustpersonaddressCollection() {
        return tcustpersonaddressCollection;
    }

    public void setTcustpersonaddressCollection(Collection<Tcustpersonaddress> tcustpersonaddressCollection) {
        this.tcustpersonaddressCollection = tcustpersonaddressCollection;
    }

    @XmlTransient
    public Collection<Tarmarmas> getTarmarmasCollection() {
        return tarmarmasCollection;
    }

    public void setTarmarmasCollection(Collection<Tarmarmas> tarmarmasCollection) {
        this.tarmarmasCollection = tarmarmasCollection;
    }

    @XmlTransient
    public Collection<Tarmlectura> getTarmlecturaCollection() {
        return tarmlecturaCollection;
    }

    public void setTarmlecturaCollection(Collection<Tarmlectura> tarmlecturaCollection) {
        this.tarmlecturaCollection = tarmlecturaCollection;
    }

    @XmlTransient
    public Collection<Tcustpeople> getTcustpeopleCollection() {
        return tcustpeopleCollection;
    }

    public void setTcustpeopleCollection(Collection<Tcustpeople> tcustpeopleCollection) {
        this.tcustpeopleCollection = tcustpeopleCollection;
    }

    public Tgenecanton getTgenecanton() {
        return tgenecanton;
    }

    public void setTgenecanton(Tgenecanton tgenecanton) {
        this.tgenecanton = tgenecanton;
    }

    @XmlTransient
    public Collection<Tarmsitioalmacenamiento> getTarmsitioalmacenamientoCollection() {
        return tarmsitioalmacenamientoCollection;
    }

    public void setTarmsitioalmacenamientoCollection(Collection<Tarmsitioalmacenamiento> tarmsitioalmacenamientoCollection) {
        this.tarmsitioalmacenamientoCollection = tarmsitioalmacenamientoCollection;
    }

    @XmlTransient
    public Collection<Tarmagenciasucursal> getTarmagenciasucursalCollection() {
        return tarmagenciasucursalCollection;
    }

    public void setTarmagenciasucursalCollection(Collection<Tarmagenciasucursal> tarmagenciasucursalCollection) {
        this.tarmagenciasucursalCollection = tarmagenciasucursalCollection;
    }

    @XmlTransient
    public Collection<Tarmdecomiso> getTarmdecomisoCollection() {
        return tarmdecomisoCollection;
    }

    public void setTarmdecomisoCollection(Collection<Tarmdecomiso> tarmdecomisoCollection) {
        this.tarmdecomisoCollection = tarmdecomisoCollection;
    }

    @XmlTransient
    public Collection<Tcustpeoplerealassets> getTcustpeoplerealassetsCollection() {
        return tcustpeoplerealassetsCollection;
    }

    public void setTcustpeoplerealassetsCollection(Collection<Tcustpeoplerealassets> tcustpeoplerealassetsCollection) {
        this.tcustpeoplerealassetsCollection = tcustpeoplerealassetsCollection;
    }

    @XmlTransient
    public Collection<Tarmcentrocontrol> getTarmcentrocontrolCollection() {
        return tarmcentrocontrolCollection;
    }

    public void setTarmcentrocontrolCollection(Collection<Tarmcentrocontrol> tarmcentrocontrolCollection) {
        this.tarmcentrocontrolCollection = tarmcentrocontrolCollection;
    }

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

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