/*
 * Created on 6 Aug 2015 ( Time 16:35:19 )
 * Generated by Telosys Tools Generator ( version 2.1.1 )
 */
// This Bean has a basic Primary Key (not composite) 

package com.abm.mainet.brms.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

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.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * Persistent class for entity stored in table "TB_COMPARENT_DET"
 *
 * @author Telosys Tools Generator
 *
 */

@Entity
@Table(name="TB_COMPARENT_DET")
// Define named queries here
@NamedQueries ( {
  @NamedQuery ( name="TbComparentDetEntity.countAll", query="SELECT COUNT(x) FROM TbComparentDetEntity x" )
} )
public class TbComparentDetEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    //----------------------------------------------------------------------
    // ENTITY PRIMARY KEY ( BASED ON A SINGLE FIELD )
    //----------------------------------------------------------------------
    @Id
    @Column(name="COD_ID", nullable=false)
    private Long codId        ;


    //----------------------------------------------------------------------
    // ENTITY DATA FIELDS 
    //----------------------------------------------------------------------    
    @Column(name="COD_DESC", nullable=false)
    private String     codDesc      ;

    @Column(name="COD_VALUE", nullable=false)
    private String     codValue     ;

    @Column(name="ORGID", nullable=false)
    private Long orgid        ;

    @Column(name="USER_ID", nullable=false)
    private Long userId       ;

    @Column(name="LANG_ID", nullable=false)
    private Long langId       ;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="LMODDATE", nullable=false)
    private Date       lmoddate     ;

    @Column(name="UPDATED_BY")
    private Long updatedBy    ;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="UPDATED_DATE")
    private Date       updatedDate  ;

    @Column(name="CPD_DEFAULT", length=1)
    private String     cpdDefault   ;

    @Column(name="COD_STATUS")
    private String     codStatus    ;

    @Column(name="COD_DESC_MAR")
    private String     codDescMar   ;

    @Column(name="LG_IP_MAC", length=100)
    private String     lgIpMac      ;

    @Column(name="LG_IP_MAC_UPD", length=100)
    private String     lgIpMacUpd   ;

	// "comId" (column "COM_ID") is not defined by itself because used as FK in a link 
	// "parentId" (column "PARENT_ID") is not defined by itself because used as FK in a link 


    //----------------------------------------------------------------------
    // ENTITY LINKS ( RELATIONSHIP )
    //----------------------------------------------------------------------
    @ManyToOne
    @JoinColumn(name="PARENT_ID", referencedColumnName="COD_ID")
    private TbComparentDetEntity tbComparentDet;

    @ManyToOne
    @JoinColumn(name="COM_ID", referencedColumnName="COM_ID")
    private TbComparentMasEntity tbComparentMas;

    @OneToMany(mappedBy="tbComparentDet", targetEntity=TbComparentDetEntity.class)
    private List<TbComparentDetEntity> listOfTbComparentDet;

    @Transient
    private long tempId;
    //----------------------------------------------------------------------
    // CONSTRUCTOR(S)
    //----------------------------------------------------------------------
    public TbComparentDetEntity() {
		super();
    }
    
    //----------------------------------------------------------------------
    // GETTER & SETTER FOR THE KEY FIELD
    //----------------------------------------------------------------------
    public void setCodId( Long codId ) {
        this.codId = codId ;
    }
    public Long getCodId() {
        return this.codId;
    }

    //----------------------------------------------------------------------
    // GETTERS & SETTERS FOR FIELDS
    //----------------------------------------------------------------------
    //--- DATABASE MAPPING : COD_DESC ( NVARCHAR2 ) 
    public void setCodDesc( String codDesc ) {
        this.codDesc = codDesc;
    }
    public String getCodDesc() {
        return this.codDesc;
    }

    //--- DATABASE MAPPING : COD_VALUE ( NVARCHAR2 ) 
    public void setCodValue( String codValue ) {
        this.codValue = codValue;
    }
    public String getCodValue() {
        return this.codValue;
    }

    //--- DATABASE MAPPING : ORGID ( NUMBER ) 
    public void setOrgid( Long orgid ) {
        this.orgid = orgid;
    }
    public Long getOrgid() {
        return this.orgid;
    }

    //--- DATABASE MAPPING : USER_ID ( NUMBER ) 
    public void setUserId( Long userId ) {
        this.userId = userId;
    }
    public Long getUserId() {
        return this.userId;
    }

    //--- DATABASE MAPPING : LANG_ID ( NUMBER ) 
    public void setLangId( Long langId ) {
        this.langId = langId;
    }
    public Long getLangId() {
        return this.langId;
    }

    //--- DATABASE MAPPING : LMODDATE ( DATE ) 
    public void setLmoddate( Date lmoddate ) {
        this.lmoddate = lmoddate;
    }
    public Date getLmoddate() {
        return this.lmoddate;
    }

    //--- DATABASE MAPPING : UPDATED_BY ( NUMBER ) 
    public void setUpdatedBy( Long updatedBy ) {
        this.updatedBy = updatedBy;
    }
    public Long getUpdatedBy() {
        return this.updatedBy;
    }

    //--- DATABASE MAPPING : UPDATED_DATE ( DATE ) 
    public void setUpdatedDate( Date updatedDate ) {
        this.updatedDate = updatedDate;
    }
    public Date getUpdatedDate() {
        return this.updatedDate;
    }

    //--- DATABASE MAPPING : CPD_DEFAULT ( CHAR ) 
    public void setCpdDefault( String cpdDefault ) {
        this.cpdDefault = cpdDefault;
    }
    public String getCpdDefault() {
        return this.cpdDefault;
    }

    //--- DATABASE MAPPING : COD_STATUS ( NVARCHAR2 ) 
    public void setCodStatus( String codStatus ) {
        this.codStatus = codStatus;
    }
    public String getCodStatus() {
        return this.codStatus;
    }

    //--- DATABASE MAPPING : COD_DESC_MAR ( NVARCHAR2 ) 
    public void setCodDescMar( String codDescMar ) {
        this.codDescMar = codDescMar;
    }
    public String getCodDescMar() {
        return this.codDescMar;
    }

    //--- DATABASE MAPPING : LG_IP_MAC ( VARCHAR2 ) 
    public void setLgIpMac( String lgIpMac ) {
        this.lgIpMac = lgIpMac;
    }
    public String getLgIpMac() {
        return this.lgIpMac;
    }

    //--- DATABASE MAPPING : LG_IP_MAC_UPD ( VARCHAR2 ) 
    public void setLgIpMacUpd( String lgIpMacUpd ) {
        this.lgIpMacUpd = lgIpMacUpd;
    }
    public String getLgIpMacUpd() {
        return this.lgIpMacUpd;
    }


    //----------------------------------------------------------------------
    // GETTERS & SETTERS FOR LINKS
    //----------------------------------------------------------------------
    public void setTbComparentDet( TbComparentDetEntity tbComparentDet ) {
        this.tbComparentDet = tbComparentDet;
    }
    public TbComparentDetEntity getTbComparentDet() {
        return this.tbComparentDet;
    }

    public void setTbComparentMas( TbComparentMasEntity tbComparentMas ) {
        this.tbComparentMas = tbComparentMas;
    }
    public TbComparentMasEntity getTbComparentMas() {
        return this.tbComparentMas;
    }

    public void setListOfTbComparentDet( List<TbComparentDetEntity> listOfTbComparentDet ) {
        this.listOfTbComparentDet = listOfTbComparentDet;
    }
    public List<TbComparentDetEntity> getListOfTbComparentDet() {
        return this.listOfTbComparentDet;
    }

    public long getTempId() {
		return tempId;
	}
    
    public void setTempId(long tempId) {
		this.tempId = tempId;
	}

    //----------------------------------------------------------------------
    // toString METHOD
    //----------------------------------------------------------------------
    @Override
	public String toString() { 
        StringBuffer sb = new StringBuffer(); 
        sb.append("["); 
        sb.append(codId);
        sb.append("]:"); 
        sb.append(codDesc);
        sb.append("|");
        sb.append(codValue);
        sb.append("|");
        sb.append(orgid);
        sb.append("|");
        sb.append(userId);
        sb.append("|");
        sb.append(langId);
        sb.append("|");
        sb.append(lmoddate);
        sb.append("|");
        sb.append(updatedBy);
        sb.append("|");
        sb.append(updatedDate);
        sb.append("|");
        sb.append(cpdDefault);
        sb.append("|");
        sb.append(codStatus);
        sb.append("|");
        sb.append(codDescMar);
        sb.append("|");
        sb.append(lgIpMac);
        sb.append("|");
        sb.append(lgIpMacUpd);
        return sb.toString(); 
    } 
    
    public String[] getPkValues() {
        return new String[] { "COM", "TB_COMPARENT_DET", "COD_ID" };
    }

}
