/*
 * 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.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEBASEACCOUNT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebaseaccount.findAll", query = "SELECT t FROM Tgenebaseaccount t"),
    @NamedQuery(name = "Tgenebaseaccount.findByAccount", query = "SELECT t FROM Tgenebaseaccount t WHERE t.tgenebaseaccountPK.account = :account"),
    @NamedQuery(name = "Tgenebaseaccount.findByCompany", query = "SELECT t FROM Tgenebaseaccount t WHERE t.tgenebaseaccountPK.company = :company"),
    @NamedQuery(name = "Tgenebaseaccount.findByLockdb", query = "SELECT t FROM Tgenebaseaccount t WHERE t.lockdb = :lockdb")})
public class Tgenebaseaccount implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebaseaccountPK tgenebaseaccountPK;
    @Column(name = "LOCKDB")
    private String lockdb;

    public Tgenebaseaccount() {
    }

    public Tgenebaseaccount(TgenebaseaccountPK tgenebaseaccountPK) {
        this.tgenebaseaccountPK = tgenebaseaccountPK;
    }

    public Tgenebaseaccount(String account, long company) {
        this.tgenebaseaccountPK = new TgenebaseaccountPK(account, company);
    }

    public TgenebaseaccountPK getTgenebaseaccountPK() {
        return tgenebaseaccountPK;
    }

    public void setTgenebaseaccountPK(TgenebaseaccountPK tgenebaseaccountPK) {
        this.tgenebaseaccountPK = tgenebaseaccountPK;
    }

    public String getLockdb() {
        return lockdb;
    }

    public void setLockdb(String lockdb) {
        this.lockdb = lockdb;
    }

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

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