/*
 * 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.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
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.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.MD_SCHEMAS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MdSchemas.findAll", query = "SELECT m FROM MdSchemas m"),
    @NamedQuery(name = "MdSchemas.findById", query = "SELECT m FROM MdSchemas m WHERE m.id = :id"),
    @NamedQuery(name = "MdSchemas.findByName", query = "SELECT m FROM MdSchemas m WHERE m.name = :name"),
    @NamedQuery(name = "MdSchemas.findByType", query = "SELECT m FROM MdSchemas m WHERE m.type = :type"),
    @NamedQuery(name = "MdSchemas.findByCharacterSet", query = "SELECT m FROM MdSchemas m WHERE m.characterSet = :characterSet"),
    @NamedQuery(name = "MdSchemas.findByVersionTag", query = "SELECT m FROM MdSchemas m WHERE m.versionTag = :versionTag"),
    @NamedQuery(name = "MdSchemas.findByNativeKey", query = "SELECT m FROM MdSchemas m WHERE m.nativeKey = :nativeKey"),
    @NamedQuery(name = "MdSchemas.findByComments", query = "SELECT m FROM MdSchemas m WHERE m.comments = :comments"),
    @NamedQuery(name = "MdSchemas.findBySecurityGroupId", query = "SELECT m FROM MdSchemas m WHERE m.securityGroupId = :securityGroupId"),
    @NamedQuery(name = "MdSchemas.findByCreatedOn", query = "SELECT m FROM MdSchemas m WHERE m.createdOn = :createdOn"),
    @NamedQuery(name = "MdSchemas.findByCreatedBy", query = "SELECT m FROM MdSchemas m WHERE m.createdBy = :createdBy"),
    @NamedQuery(name = "MdSchemas.findByLastUpdatedOn", query = "SELECT m FROM MdSchemas m WHERE m.lastUpdatedOn = :lastUpdatedOn"),
    @NamedQuery(name = "MdSchemas.findByLastUpdatedBy", query = "SELECT m FROM MdSchemas m WHERE m.lastUpdatedBy = :lastUpdatedBy")})
public class MdSchemas implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Column(name = "NAME")
    private String name;
    @Column(name = "TYPE")
    private Character type;
    @Column(name = "CHARACTER_SET")
    private String characterSet;
    @Column(name = "VERSION_TAG")
    private String versionTag;
    @Lob
    @Column(name = "NATIVE_SQL")
    private String nativeSql;
    @Column(name = "NATIVE_KEY")
    private String nativeKey;
    @Column(name = "COMMENTS")
    private String comments;
    @Basic(optional = false)
    @Column(name = "SECURITY_GROUP_ID")
    private BigInteger securityGroupId;
    @Basic(optional = false)
    @Column(name = "CREATED_ON")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdOn;
    @Column(name = "CREATED_BY")
    private String createdBy;
    @Column(name = "LAST_UPDATED_ON")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedOn;
    @Column(name = "LAST_UPDATED_BY")
    private String lastUpdatedBy;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdUserDefinedDataTypes> mdUserDefinedDataTypesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdSequences> mdSequencesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdPrivileges> mdPrivilegesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdOtherObjects> mdOtherObjectsCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdTables> mdTablesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdSynonyms> mdSynonymsCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdGroups> mdGroupsCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdMigrWeakdep> mdMigrWeakdepCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdStoredPrograms> mdStoredProgramsCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdTablespaces> mdTablespacesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdViews> mdViewsCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdPackages> mdPackagesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "schemaIdFk")
    private Collection<MdUsers> mdUsersCollection;
    @JoinColumn(name = "CATALOG_ID_FK", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private MdCatalogs catalogIdFk;

    public MdSchemas() {
    }

    public MdSchemas(BigDecimal id) {
        this.id = id;
    }

    public MdSchemas(BigDecimal id, BigInteger securityGroupId, Date createdOn) {
        this.id = id;
        this.securityGroupId = securityGroupId;
        this.createdOn = createdOn;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Character getType() {
        return type;
    }

    public void setType(Character type) {
        this.type = type;
    }

    public String getCharacterSet() {
        return characterSet;
    }

    public void setCharacterSet(String characterSet) {
        this.characterSet = characterSet;
    }

    public String getVersionTag() {
        return versionTag;
    }

    public void setVersionTag(String versionTag) {
        this.versionTag = versionTag;
    }

    public String getNativeSql() {
        return nativeSql;
    }

    public void setNativeSql(String nativeSql) {
        this.nativeSql = nativeSql;
    }

    public String getNativeKey() {
        return nativeKey;
    }

    public void setNativeKey(String nativeKey) {
        this.nativeKey = nativeKey;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public BigInteger getSecurityGroupId() {
        return securityGroupId;
    }

    public void setSecurityGroupId(BigInteger securityGroupId) {
        this.securityGroupId = securityGroupId;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getLastUpdatedOn() {
        return lastUpdatedOn;
    }

    public void setLastUpdatedOn(Date lastUpdatedOn) {
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public String getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    @XmlTransient
    public Collection<MdUserDefinedDataTypes> getMdUserDefinedDataTypesCollection() {
        return mdUserDefinedDataTypesCollection;
    }

    public void setMdUserDefinedDataTypesCollection(Collection<MdUserDefinedDataTypes> mdUserDefinedDataTypesCollection) {
        this.mdUserDefinedDataTypesCollection = mdUserDefinedDataTypesCollection;
    }

    @XmlTransient
    public Collection<MdSequences> getMdSequencesCollection() {
        return mdSequencesCollection;
    }

    public void setMdSequencesCollection(Collection<MdSequences> mdSequencesCollection) {
        this.mdSequencesCollection = mdSequencesCollection;
    }

    @XmlTransient
    public Collection<MdPrivileges> getMdPrivilegesCollection() {
        return mdPrivilegesCollection;
    }

    public void setMdPrivilegesCollection(Collection<MdPrivileges> mdPrivilegesCollection) {
        this.mdPrivilegesCollection = mdPrivilegesCollection;
    }

    @XmlTransient
    public Collection<MdOtherObjects> getMdOtherObjectsCollection() {
        return mdOtherObjectsCollection;
    }

    public void setMdOtherObjectsCollection(Collection<MdOtherObjects> mdOtherObjectsCollection) {
        this.mdOtherObjectsCollection = mdOtherObjectsCollection;
    }

    @XmlTransient
    public Collection<MdTables> getMdTablesCollection() {
        return mdTablesCollection;
    }

    public void setMdTablesCollection(Collection<MdTables> mdTablesCollection) {
        this.mdTablesCollection = mdTablesCollection;
    }

    @XmlTransient
    public Collection<MdSynonyms> getMdSynonymsCollection() {
        return mdSynonymsCollection;
    }

    public void setMdSynonymsCollection(Collection<MdSynonyms> mdSynonymsCollection) {
        this.mdSynonymsCollection = mdSynonymsCollection;
    }

    @XmlTransient
    public Collection<MdGroups> getMdGroupsCollection() {
        return mdGroupsCollection;
    }

    public void setMdGroupsCollection(Collection<MdGroups> mdGroupsCollection) {
        this.mdGroupsCollection = mdGroupsCollection;
    }

    @XmlTransient
    public Collection<MdMigrWeakdep> getMdMigrWeakdepCollection() {
        return mdMigrWeakdepCollection;
    }

    public void setMdMigrWeakdepCollection(Collection<MdMigrWeakdep> mdMigrWeakdepCollection) {
        this.mdMigrWeakdepCollection = mdMigrWeakdepCollection;
    }

    @XmlTransient
    public Collection<MdStoredPrograms> getMdStoredProgramsCollection() {
        return mdStoredProgramsCollection;
    }

    public void setMdStoredProgramsCollection(Collection<MdStoredPrograms> mdStoredProgramsCollection) {
        this.mdStoredProgramsCollection = mdStoredProgramsCollection;
    }

    @XmlTransient
    public Collection<MdTablespaces> getMdTablespacesCollection() {
        return mdTablespacesCollection;
    }

    public void setMdTablespacesCollection(Collection<MdTablespaces> mdTablespacesCollection) {
        this.mdTablespacesCollection = mdTablespacesCollection;
    }

    @XmlTransient
    public Collection<MdViews> getMdViewsCollection() {
        return mdViewsCollection;
    }

    public void setMdViewsCollection(Collection<MdViews> mdViewsCollection) {
        this.mdViewsCollection = mdViewsCollection;
    }

    @XmlTransient
    public Collection<MdPackages> getMdPackagesCollection() {
        return mdPackagesCollection;
    }

    public void setMdPackagesCollection(Collection<MdPackages> mdPackagesCollection) {
        this.mdPackagesCollection = mdPackagesCollection;
    }

    @XmlTransient
    public Collection<MdUsers> getMdUsersCollection() {
        return mdUsersCollection;
    }

    public void setMdUsersCollection(Collection<MdUsers> mdUsersCollection) {
        this.mdUsersCollection = mdUsersCollection;
    }

    public MdCatalogs getCatalogIdFk() {
        return catalogIdFk;
    }

    public void setCatalogIdFk(MdCatalogs catalogIdFk) {
        this.catalogIdFk = catalogIdFk;
    }

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

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