/*
 * 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.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
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.TGENECOUNTRY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenecountry.findAll", query = "SELECT t FROM Tgenecountry t"),
    @NamedQuery(name = "Tgenecountry.findByCountrycode", query = "SELECT t FROM Tgenecountry t WHERE t.countrycode = :countrycode"),
    @NamedQuery(name = "Tgenecountry.findByRecordversion", query = "SELECT t FROM Tgenecountry t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenecountry.findByInitials", query = "SELECT t FROM Tgenecountry t WHERE t.initials = :initials"),
    @NamedQuery(name = "Tgenecountry.findByAreacode", query = "SELECT t FROM Tgenecountry t WHERE t.areacode = :areacode"),
    @NamedQuery(name = "Tgenecountry.findByDescription", query = "SELECT t FROM Tgenecountry t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenecountry.findByCitizenship", query = "SELECT t FROM Tgenecountry t WHERE t.citizenship = :citizenship")})
public class Tgenecountry implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "COUNTRYCODE")
    private String countrycode;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "INITIALS")
    private String initials;
    @Column(name = "AREACODE")
    private Short areacode;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @Basic(optional = false)
    @Column(name = "CITIZENSHIP")
    private String citizenship;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecountry")
    private Collection<Tgeneprovince> tgeneprovinceCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecountry")
    private Collection<Tgenecountrydesc> tgenecountrydescCollection;
    @OneToMany(mappedBy = "cpaisorigen")
    private Collection<Tarmarmas> tarmarmasCollection;
    @OneToMany(mappedBy = "nacionality")
    private Collection<Tcustpeople> tcustpeopleCollection;
    @OneToMany(mappedBy = "paisorigen")
    private Collection<Tarmregistroarmas> tarmregistroarmasCollection;

    public Tgenecountry() {
    }

    public Tgenecountry(String countrycode) {
        this.countrycode = countrycode;
    }

    public Tgenecountry(String countrycode, String description, String citizenship) {
        this.countrycode = countrycode;
        this.description = description;
        this.citizenship = citizenship;
    }

    public String getCountrycode() {
        return countrycode;
    }

    public void setCountrycode(String countrycode) {
        this.countrycode = countrycode;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getInitials() {
        return initials;
    }

    public void setInitials(String initials) {
        this.initials = initials;
    }

    public Short getAreacode() {
        return areacode;
    }

    public void setAreacode(Short areacode) {
        this.areacode = areacode;
    }

    public String getDescription() {
        return description;
    }

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

    public String getCitizenship() {
        return citizenship;
    }

    public void setCitizenship(String citizenship) {
        this.citizenship = citizenship;
    }

    @XmlTransient
    public Collection<Tgeneprovince> getTgeneprovinceCollection() {
        return tgeneprovinceCollection;
    }

    public void setTgeneprovinceCollection(Collection<Tgeneprovince> tgeneprovinceCollection) {
        this.tgeneprovinceCollection = tgeneprovinceCollection;
    }

    @XmlTransient
    public Collection<Tgenecountrydesc> getTgenecountrydescCollection() {
        return tgenecountrydescCollection;
    }

    public void setTgenecountrydescCollection(Collection<Tgenecountrydesc> tgenecountrydescCollection) {
        this.tgenecountrydescCollection = tgenecountrydescCollection;
    }

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

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

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

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

    @XmlTransient
    public Collection<Tarmregistroarmas> getTarmregistroarmasCollection() {
        return tarmregistroarmasCollection;
    }

    public void setTarmregistroarmasCollection(Collection<Tarmregistroarmas> tarmregistroarmasCollection) {
        this.tarmregistroarmasCollection = tarmregistroarmasCollection;
    }

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

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