Package com.ads.mm.db.dao

# Class DBEnvironment

java.lang.Object
com.ads.mm.db.dao.DBComponent
com.ads.mm.db.dao.DBEnvironment

public class DBEnvironment extends DBComponent
This class provides some beans control methods related to Environments,Schemas, Tables. This class extends DBComponent class wherein it specifies whether the node is Marked or not.

Author:
  AnalytiX DS

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `DBEnvironment.DatabaseType`
  These constants are used to specify whether the DatabaseType is of any of the listed Types : Excel, CWM, ETL, ERWin, Access,DSV,JSON, XSD, SqlServer, Oracle, SqlServerWindows, GreenPlum, TeraData, VERTICA, Pervasive, DB2, MySQL, SYBASE, SAP, BigDataCloudera, BigDataHortonWorks, BigDataMapR, NETEZZA, AmazonRedshift, Salesforce, Snowflake, BigQuery and None.
  `static enum`
  `DBEnvironment.DBOperation`
  These constants are used to specify whether the DBOperation can be an UPDATE, INSERT, VALIDATE, INVALIDATE OR SKIP.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBEnvironment()`
  `DBEnvironment(String envName)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DBEnvironment`
  `addAssociationsList(com.ads.association.export.model.ExportedAssociation associationObj)`
  It will not add association to this object as it is being used internally.
  `DBEnvironment`
  `addExtendedProperty(KeyValue extendedProperty)`
  Adds the KeyValue Object for the specified table.
  `void`
  `addSchema(DBSchema schema)`
  Adds the schema as specified.
  `void`
  `addSchema(String schemaName, DBTable table)`
  Adds the specified schemaName to schemas.
  `void`
  `addTable(DBTable table)`
  Adds the table to the DBTable Object.
  `void`
  `addTable(String name, DBTable table)`
  Adds the table to DBTable Object as specified in name.
  `void`
  `addTableByReferenceId(DBTable table)`
  `void`
  `addTables(Map<String,DBTable> tables)`
  Adds the List of tables to DBTable.
  `DBEnvironment`
  `addTag(Tag tagvo)`
  `List<com.ads.association.export.model.ExportedAssociation>`
  `getAssociationsList()`
  It will not return any associations particular to this object as it is being used internally.
  `String`
  `getBusinessEntityType()`
  Returns the businessEntityType.
  `String`
  `getChangeDescription()`
  Returns the changeDescription.
  `int`
  `getComponentsCount()`
  Returns the ComponentsCount.
  `String`
  `getDatabseType()`
  Returns the databseType.
  `int`
  `getEnvironmentId()`
  `String`
  `getEnvironmentName()`
  Returns the environmentName.
  `DBEnvironment.DatabaseType`
  `getEnvironmentType()`
  Returns the environmentType.
  `List<KeyValue>`
  `getExtendedProperties()`
  Returns the list of KeyValue objects.
  `String`
  `getRefreshedBy()`
  Returns the refreshedBy value.
  `DBSchema`
  `getSchema(String schemaName)`
  Returns the DBSchema Object as specified.
  `HashMap<String,DBSchema>`
  `getSchemas()`
  Returns the HashMap of DBSchema Object.
  `List<SDIClassification>`
  `getSdiClassifications()`
  `int`
  `getSynonymsCount()`
  Returns the synonymsCount.
  `DBSystem`
  `getSystem()`
  Returns DBSystem consisting of system details like systemId, SystemName, Tables, Views, Synonyms,components,
  Tables count, Views count, Synonyms count , Components count, Schemas etc..
  `DBTable`
  `getTable(String name)`
  Returns DBTable consisting of TableType, EntityBaseType, TableName, TableDefinition,TableComments, Audit Details, UserDefined Fields etc...
  `int`
  `getTableCount()`
  Returns the tableCount.
  `Map<String,DBTable>`
  `getTableMap()`
  Returns the tableMapi.e parentTable, schemaName, tableDefinitionComments, tableDefinition,
  tableComments, logicalTableName, actualTableName, auditHistory Details etc...
  `List<Tag>`
  `getTags()`
  `Object`
  `getUserData()`
  Returns the userData.
  `String`
  `getVersion()`
  Returns the version.
  `String`
  `getVersionLabel()`
  Returns the versionLabel.
  `int`
  `getViewCount()`
  Returns the viewCount.
  `int`
  `getVisibility()`
  Returns the visibility.
  `void`
  `incrementTableCount(DBTable table)`
  `boolean`
  `isDataStewardChecked()`
  Deprecated.
  `boolean`
  `isValidateData()`
  Returns the validateData as true or false.
  `boolean`
  `isVersionIfChangesExists()`
  Returns the versionIfChangesExists.
  `DBEnvironment`
  `markDBOperations(DBEnvironment targetEnvironment, boolean freshUploadMode, boolean updateAppendMode, boolean insertMode, boolean updateExistingMode, DBHelper dbHelper)`
  Returns the DBEnvironment Object for the specified targetEnvironment, operation modes in which the environment will be saved i.e fresh upload, update append and insert modes.
  `DBEnvironment`
  `markDBOperationsByReferenceId(DBEnvironment targetEnvironment, boolean freshUploadMode, boolean updateAppendMode, boolean insertMode, boolean updateExistingMode)`
  Returns the DBEnvironment Object for the specified targetEnvironment and operation modes in which the environment will be saved i.e fresh upload, update append and insert modes.
  `void`
  `markDBOpertionForAll(DBEnvironment.DBOperation operation)`
  Marks the operation.
  `DBEnvironment`
  `setAssociationsList(List<com.ads.association.export.model.ExportedAssociation> associations)`
  It will not set any associations particular to this object as it is being used internally.
  `void`
  `setBusinessEntityType(String businessEntityType)`
  Sets the businessEntityType as specified.
  `void`
  `setChangeDescription(String changeDescription)`
  Sets the changeDescription as specified.
  `void`
  `setComponentsCount(int _componentsCount)`
  Sets the componentsCount.
  `void`
  `setDatabseType(String databseType)`
  Sets the databseType as specified.
  `void`
  `setDataStewardChecked(boolean dataStewardChecked)`
  Deprecated.
  `void`
  `setEnvironmentId(int environmentId)`
  Sets the environmentId as specified.
  `void`
  `setEnvironmentName(String environmentName)`
  Sets the environmentName as specified.
  `void`
  `setEnvironmentType(DBEnvironment.DatabaseType environmentType)`
  Sets the environmentType as specified.
  `void`
  `setExtendedProperties(List<KeyValue> extendedProperties)`
  Method sets the list of KeyValue objects as specified.
  `void`
  `setRefreshedBy(String refreshedBy)`
  Sets the refreshedBy value as specified.
  `void`
  `setSchemas(HashMap<String,DBSchema> schemas)`
  Sets the schemas as specified.
  `void`
  `setSdiClassifications(List<SDIClassification> sdiClassifications)`
  `void`
  `setSynonymsCount(int _synonymsCount)`
  `void`
  `setSystem(DBSystem system)`
  Sets the System value as specified.
  `void`
  `setTableCount(int _tableCount)`
  `void`
  `setTableMap(Map<String,DBTable> tableMap)`
  Sets the tableMap as specified.
  `void`
  `setTags(List<Tag> tags)`
  `void`
  `setUserData(Object userData)`
  Sets the userData as specified.
  `void`
  `setValidateData(boolean validateData)`
  Sets the validateData as true or false.
  `void`
  `setVersion(String version)`
  Sets the version as specified.
  `void`
  `setVersionIfChangesExists(boolean versionIfChangesExists)`
  Sets the versionIfChangesExists as specified.
  `void`
  `setVersionLabel(String versionLabel)`
  Sets the versionLabel as specified.
  `void`
  `setViewCount(int _viewCount)`
  `void`
  `setVisibility(int visibility)`
  Sets the visibility as specified.
  `String`
  `toString()`
  toString() method returns the string representation of the schemas.
  `void`
  `validate(boolean valid)`
  validates the tableType as true or false for TABLE, VIEW, SYNONYM.

  ### Methods inherited from class com.ads.mm.db.dao.DBComponent

  `getDataStewardName, isMarked, setDataStewardName, setMarked`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DBEnvironment

    public DBEnvironment()

  - ### DBEnvironment

    public DBEnvironment(String envName)
    Parameters:
      `envName` - String

- ## Method Details

  - ### getEnvironmentId

    public int getEnvironmentId()
    Returns:

  - ### setEnvironmentId

    public void setEnvironmentId(int environmentId)
    Sets the environmentId as specified.
    Parameters:
      `environmentId` - int

  - ### getSystem

    public DBSystem getSystem()
    Returns DBSystem consisting of system details like systemId, SystemName, Tables, Views, Synonyms,components,
    Tables count, Views count, Synonyms count , Components count, Schemas etc..
    Returns:
      DBSystem - object

  - ### setSystem

    public void setSystem(DBSystem system)
    Sets the System value as specified.
    Parameters:
      `system` - DBSystem Object

  - ### getEnvironmentName

    public String getEnvironmentName()
    Returns the environmentName.
    Returns:
      environmentName String

  - ### setEnvironmentName

    public void setEnvironmentName(String environmentName)
    Sets the environmentName as specified.
    Parameters:
      `environmentName` - String

  - ### getRefreshedBy

    public String getRefreshedBy()
    Returns the refreshedBy value.
    Returns:
      refreshedBy String

  - ### setRefreshedBy

    public void setRefreshedBy(String refreshedBy)
    Sets the refreshedBy value as specified.
    Parameters:
      `refreshedBy` - String

  - ### getTableMap

    public Map<String,DBTable> getTableMap()
    Returns the tableMapi.e parentTable, schemaName, tableDefinitionComments, tableDefinition,
    tableComments, logicalTableName, actualTableName, auditHistory Details etc...
    Returns:
      tableMap Map

  - ### setTableMap

    public void setTableMap(Map<String,DBTable> tableMap)
    Sets the tableMap as specified.
    Parameters:
      `tableMap` - Map

  - ### getTable

    public DBTable getTable(String name)
    Returns DBTable consisting of TableType, EntityBaseType, TableName, TableDefinition,TableComments, Audit Details, UserDefined Fields etc...
    Parameters:
      `name` - String
    Returns:
      DBTable - object

  - ### addTable

    public void addTable(String name, DBTable table)
    Adds the table to DBTable Object as specified in name. Specifying the name is mandatory.
    Parameters:
      `name` - String
      `table` - DBTable Object

  - ### getExtendedProperties

    public List<KeyValue> getExtendedProperties()
    Returns the list of KeyValue objects.
    Returns:
      extendedProperties List

  - ### setExtendedProperties

    public void setExtendedProperties(List<KeyValue> extendedProperties)
    Method sets the list of KeyValue objects as specified.
    Parameters:
      `extendedProperties` - String

  - ### addExtendedProperty

    public DBEnvironment addExtendedProperty(KeyValue extendedProperty)
    Adds the KeyValue Object for the specified table.
    Parameters:
      `extendedProperty` - KeyValue
    Returns:
      DBEnvironment object.

  - ### addTable

    public void addTable(DBTable table)
    Adds the table to the DBTable Object.
    Parameters:
      `table` - DBTable

  - ### addTableByReferenceId

    public void addTableByReferenceId(DBTable table)

  - ### addTables

    public void addTables(Map<String,DBTable> tables)
    Adds the List of tables to DBTable.
    Parameters:
      `tables` - Map

  - ### setTableCount

    public void setTableCount(int _tableCount)

  - ### getTableCount

    public int getTableCount()
    Returns the tableCount.
    Returns:
      int - tableCount

  - ### setViewCount

    public void setViewCount(int _viewCount)

  - ### getViewCount

    public int getViewCount()
    Returns the viewCount.
    Returns:
      int - viewCount

  - ### setSynonymsCount

    public void setSynonymsCount(int _synonymsCount)

  - ### getSynonymsCount

    public int getSynonymsCount()
    Returns the synonymsCount.
    Returns:
      int - synonymsCount

  - ### setComponentsCount

    public void setComponentsCount(int _componentsCount)
    Sets the componentsCount.
    Parameters:
      `_componentsCount` - int

  - ### getComponentsCount

    public int getComponentsCount()
    Returns the ComponentsCount.
    Returns:
      int - componentsCount

  - ### incrementTableCount

    public void incrementTableCount(DBTable table)

  - ### getSchemas

    public HashMap<String,DBSchema> getSchemas()
    Returns the HashMap of DBSchema Object.
    DBSchema consists of details related to table, tableMap, tables, view, viewMap, views, synonym, synonymMap, synonyms, component, componentMap, components.
    Returns:
      hashMap - Schemas

  - ### setSchemas

    public void setSchemas(HashMap<String,DBSchema> schemas)
    Sets the schemas as specified.
    Parameters:
      `schemas` - HashMap

  - ### addSchema

    public void addSchema(String schemaName, DBTable table)
    Adds the specified schemaName to schemas.
    Parameters:
      `schemaName` - String
      `table` - DBTable Object

  - ### markDBOperationsByReferenceId

    public DBEnvironment markDBOperationsByReferenceId(DBEnvironment targetEnvironment, boolean freshUploadMode, boolean updateAppendMode, boolean insertMode, boolean updateExistingMode)
    Returns the DBEnvironment Object for the specified targetEnvironment and operation modes in which the environment will be saved i.e fresh upload, update append and insert modes.
    Specification of targetEnvironment and operation are mandatory.

    DBProperties Object specifies the operation modes in which the environment will be saved i.e fresh upload, update append and append modes.
    Simple insertMode is used when environment is save for the first time i.e add new option.
    Update append mode is used when previously loaded environment is modified and few new tables are appended to the environment.
    Fresh upload mode is used when the previously loaded environment tables are to be deleted and new tables will be inserted in to the environment.

    This method is used in the event when the useReferenceId is set, i.e useReferenceId value is set to true or false depending on the databaseType in which the environment is saved.

    useReferenceId value for ERWIN and CWM is true, for other databaseTypes it is false.

    If the useReferenceId is true, the environment is loaded based on checking the table reference id which is set to the tables in the specific environment. If the value is false, the environment gets loaded with out checking the table referenceId which is set to the tables.

    Parameters:
      `targetEnvironment` - DBEnvironment Object
      `freshUploadMode` - boolean
      `updateAppendMode` - boolean
      `insertMode` - boolean
    Returns:
      DBEnvironment Object

  - ### markDBOperations

    public DBEnvironment markDBOperations(DBEnvironment targetEnvironment, boolean freshUploadMode, boolean updateAppendMode, boolean insertMode, boolean updateExistingMode, DBHelper dbHelper)
    Returns the DBEnvironment Object for the specified targetEnvironment, operation modes in which the environment will be saved i.e fresh upload, update append and insert modes.
    Simple insertMode is used when environment is saves for the first time i.e add new option.
    Update append mode is used when previously loaded environment is modified and few new tables are appended to the environment.
    Fresh upload mode is used when the previously loaded environment tables are to be deleted and new tables will be inserted in to the environment.

    Parameters:
      `targetEnvironment` - DBEnvironment
      `freshUploadMode` - boolean
      `updateAppendMode` - boolean
      `insertMode` - boolean
    Returns:
      DBEnvironment Object

  - ### markDBOpertionForAll

    public void markDBOpertionForAll(DBEnvironment.DBOperation operation)
    Marks the operation. Operation can be UPDATE, INSERT, VALIDATE, INVALIDATE, SKIP.
    Parameters:
      `operation` - DBEnvironment Object

  - ### validate

    public void validate(boolean valid)
    validates the tableType as true or false for TABLE, VIEW, SYNONYM.
    Parameters:
      `valid` - boolean

  - ### getSchema

    public DBSchema getSchema(String schemaName)
    Returns the DBSchema Object as specified.
    Parameters:
      `schemaName` - String
    Returns:
      DBSchema - Object

  - ### addSchema

    public void addSchema(DBSchema schema)
    Adds the schema as specified.
    Parameters:
      `schema` - DBSchema Object

  - ### toString

    public String toString()
    toString() method returns the string representation of the schemas.
    Overrides:
      `toString` in class `Object`
    Returns:
      String

  - ### getEnvironmentType

    public DBEnvironment.DatabaseType getEnvironmentType()
    Returns the environmentType.
    Returns:
      DatabaseType environmentType

  - ### setEnvironmentType

    public void setEnvironmentType(DBEnvironment.DatabaseType environmentType)
    Sets the environmentType as specified.
    environmentType can be Excel, CWM, ETL, ERWin, Access,DSV,JSON, XSD, SqlServer, Oracle, SqlServerWindows, GreenPlum,
    Teradata, Vertica, Pervasive, DB2, MySQL, Sybase, SAP, BigDataCloudera, BigDataHortonWorks, BigDataMapR, BigQuery, Netezza, AmazonRedshift, None.
    Parameters:
      `environmentType` - DatabaseType

  - ### getUserData

    public Object getUserData()
    Returns the userData.
    Returns:
      Object

  - ### setUserData

    public void setUserData(Object userData)
    Sets the userData as specified.
    Parameters:
      `userData` - Object

  - ### isDataStewardChecked

    @Deprecated public boolean isDataStewardChecked()
    Deprecated.
    Returns the dataStewardChecked as true or false.
    Returns:
      dataStewardChecked boolean

  - ### setDataStewardChecked

    @Deprecated public void setDataStewardChecked(boolean dataStewardChecked)
    Deprecated.
    Sets the dataStewardChecked as specified as true or false.
    Parameters:
      `dataStewardChecked` - boolean

  - ### getVersion

    public String getVersion()
    Returns the version.
    Returns:
      version String

  - ### setVersion

    public void setVersion(String version)
    Sets the version as specified.
    Parameters:
      `version` - String

  - ### getVersionLabel

    public String getVersionLabel()
    Returns the versionLabel.
    Returns:
      versionLabel String

  - ### setVersionLabel

    public void setVersionLabel(String versionLabel)
    Sets the versionLabel as specified.
    Parameters:
      `versionLabel` - String

  - ### getChangeDescription

    public String getChangeDescription()
    Returns the changeDescription.
    Returns:
      changeDescription String

  - ### setChangeDescription

    public void setChangeDescription(String changeDescription)
    Sets the changeDescription as specified.
    Parameters:
      `changeDescription` - String

  - ### getVisibility

    public int getVisibility()
    Returns the visibility.
    Returns:
      visibility int

  - ### setVisibility

    public void setVisibility(int visibility)
    Sets the visibility as specified.
    Parameters:
      `visibility` - int

  - ### getDatabseType

    public String getDatabseType()
    Returns the databseType.
    Returns:
      databseType String

  - ### setDatabseType

    public void setDatabseType(String databseType)
    Sets the databseType as specified.
    Parameters:
      `databseType` - String

  - ### isValidateData

    public boolean isValidateData()
    Returns the validateData as true or false.
    Returns:
      validateData boolean

  - ### setValidateData

    public void setValidateData(boolean validateData)
    Sets the validateData as true or false.
    Parameters:
      `validateData` - boolean

  - ### getBusinessEntityType

    public String getBusinessEntityType()
    Returns the businessEntityType.
    Returns:
      businessEntityType String

  - ### setBusinessEntityType

    public void setBusinessEntityType(String businessEntityType)
    Sets the businessEntityType as specified.
    Parameters:
      `businessEntityType` - String

  - ### isVersionIfChangesExists

    public boolean isVersionIfChangesExists()
    Returns the versionIfChangesExists.
    Returns:
      versionIfChangesExists boolean

  - ### setVersionIfChangesExists

    public void setVersionIfChangesExists(boolean versionIfChangesExists)
    Sets the versionIfChangesExists as specified.
    Parameters:
      `versionIfChangesExists` - boolean

  - ### getTags

    public List<Tag> getTags()

  - ### setTags

    public void setTags(List<Tag> tags)

  - ### addTag

    public DBEnvironment addTag(Tag tagvo)

  - ### getAssociationsList

    public List<com.ads.association.export.model.ExportedAssociation> getAssociationsList()
    It will not return any associations particular to this object as it is being used internally. Please use Associations api to fetch the associations.
    Returns:
      list of associations

  - ### setAssociationsList

    public DBEnvironment setAssociationsList(List<com.ads.association.export.model.ExportedAssociation> associations)
    It will not set any associations particular to this object as it is being used internally.
    Parameters:
      `associations` -
    Returns:

  - ### addAssociationsList

    public DBEnvironment addAssociationsList(com.ads.association.export.model.ExportedAssociation associationObj)
    It will not add association to this object as it is being used internally.
    Parameters:
      `associations` -
    Returns:

  - ### getSdiClassifications

    public List<SDIClassification> getSdiClassifications()

  - ### setSdiClassifications

    public void setSdiClassifications(List<SDIClassification> sdiClassifications)