congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Table.getCatalog
Code IndexAdd Tabnine to your IDE (free)

How to use
getCatalog
method
in
org.jumpmind.db.model.Table

Best Java code snippets using org.jumpmind.db.model.Table.getCatalog (Showing top 17 results out of 315)

origin: org.jumpmind.symmetric/symmetric-core

public boolean matches(Table table, String defaultCatalog, String defaultSchema,
    boolean ignoreCase) {
  boolean schemaAndCatalogMatch = (StringUtils.equals(sourceCatalogName, table.getCatalog()) || (StringUtils
      .isBlank(sourceCatalogName) && StringUtils.equals(defaultCatalog,
      table.getCatalog())))
      && (StringUtils.equals(sourceSchemaName, table.getSchema()) || (StringUtils
          .isBlank(sourceSchemaName) && StringUtils.equals(defaultSchema,
          table.getSchema())));
  boolean tableMatches = ignoreCase ? table.getName().equalsIgnoreCase(sourceTableName)
      : table.getName().equals(sourceTableName);
  if (!tableMatches && isSourceTableNameWildCarded()) {
    String[] wildcardTokens = sourceTableName.split(",");
    for (String wildcardToken : wildcardTokens) {
      if (FormatUtils.isWildCardMatch(table.getName(), wildcardToken, ignoreCase)) {
        if (!wildcardToken.startsWith(FormatUtils.NEGATE_TOKEN)) {
          tableMatches = true;
        } else {
          tableMatches = false;
        }
      }
    }
  }
  return schemaAndCatalogMatch && tableMatches;
}
origin: org.jumpmind.symmetric/symmetric-core

private boolean containsExactMatchForSourceTableName(Table table, List<Trigger> triggers,
    boolean ignoreCase) {
  for (Trigger trigger : triggers) {
    String sourceCatalogName = trigger.getSourceCatalogName() != null ? trigger.getSourceCatalogName() : platform.getDefaultCatalog();            
    String sourceSchemaName = trigger.getSourceSchemaName() != null ? trigger.getSourceSchemaName() : platform.getDefaultSchema();
    if (trigger.getSourceTableName().equals(table.getName()) 
        && (sourceCatalogName == null || sourceCatalogName.equals(table.getCatalog())) && 
        (sourceSchemaName == null || sourceSchemaName.equals(table.getSchema()))) {
      return true;
    } else if (ignoreCase && trigger.getSourceTableName().equalsIgnoreCase(table.getName())
        && sourceCatalogName.equalsIgnoreCase(table.getCatalog()) && sourceSchemaName.equalsIgnoreCase(table.getSchema())) {
      return true;
    }
  }
  return false;
}
origin: org.jumpmind.symmetric/symmetric-jdbc

if (table.getCatalog() != null && !table.getCatalog().trim().equals("")) {
  appendIdentifier(query, table.getCatalog());
  query.append(catalogSeparator);
origin: org.jumpmind.symmetric/symmetric-io

/**
 * Select a random row from the table in the connected database. Return null if there are no rows.
 *
 * TODO: Cache rows.
 *
 * @param sqlTemplate
 * @param table The table to select a row from.
 * @return A random row from the table. Null if there are no rows.
 */
private Row selectRandomRow(Table table) {
  Row row = null;
  // Select all rows and return the primary key columns.
  String sql = platform.createDmlStatement(DmlType.SELECT_ALL, table.getCatalog(), table.getSchema(), table.getName(),
      table.getPrimaryKeyColumns(), table.getColumns(), null).getSql();
  final List<Row> rows = new ArrayList<Row>();
  platform.getSqlTemplate().query(sql, RANDOM_SELECT_SIZE, new ISqlRowMapper<Object>() {
    public Object mapRow(Row row) {
      rows.add(row);
      return Boolean.TRUE;
    }
  }, null, null);
  if (rows.size() != 0) {
    int rowNum = getRand().nextInt(rows.size());
    row = rows.get(rowNum);
  }
  return row;
}
origin: org.jumpmind.symmetric/symmetric-io

protected void importTablesFromCsv(InputStream in, String tableName) {
  Table table = platform.readTableFromDatabase(catalog, schema, tableName);
  if (table == null) {
    throw new RuntimeException("Unable to find table");
  }
  CsvTableDataReader reader = new CsvTableDataReader(BinaryEncoding.HEX, table.getCatalog(),
      table.getSchema(), table.getName(), in);
  DatabaseWriter writer = new DatabaseWriter(platform, buildDatabaseWriterSettings());
  DataProcessor dataProcessor = new DataProcessor(reader, writer, "import");
  dataProcessor.process();
}
origin: org.jumpmind.symmetric/symmetric-io

public boolean start(Table table) {
  if (!batch.isIgnored()) {
    this.table = table;
    
    if (!backwardsCompatible) {
      String catalogName = table.getCatalog();
      println(CsvConstants.CATALOG, StringUtils.isNotBlank(catalogName) ? catalogName
          : "");
      String schemaName = table.getSchema();
      println(CsvConstants.SCHEMA, StringUtils.isNotBlank(schemaName) ? schemaName : "");
    }
    
    String tableKey = table.getTableKey();
    String fullyQualifiedTableName = table.getFullyQualifiedTableName();
    String previousTableKey = processedTables.get(fullyQualifiedTableName);
    println(CsvConstants.TABLE, table.getName());
    if (!tableKey.equals(previousTableKey)) {
      println(CsvConstants.KEYS, table.getPrimaryKeyColumns());
      println(CsvConstants.COLUMNS, table.getColumns());
      this.processedTables.put(fullyQualifiedTableName, tableKey);
    }
    return true;
  } else {
    return false;
  }
}
origin: org.jumpmind.symmetric/symmetric-io

Table table = targetTables.get(tableNameKey);
if (table == null) {
  table = platform.getTableFromCache(sourceTable.getCatalog(), sourceTable.getSchema(),
      sourceTable.getName(), false);
  if (table != null) {
        this.writerSettings.isUsePrimaryKeysFromSource());
    if (StringUtils.isBlank(sourceTable.getCatalog())) {
      table.setCatalog(null);
origin: org.jumpmind.symmetric/symmetric-core

public void syncTriggers(Table table, boolean force) {
  boolean ignoreCase = this.parameterService.is(ParameterConstants.DB_METADATA_IGNORE_CASE);
  /* Re-lookup just in case the table was just altered */
  platform.resetCachedTableModel();
  table = platform.getTableFromCache(table.getCatalog(), table.getSchema(), table.getName(),
      true);
  List<Trigger> triggersForCurrentNode = getTriggersForCurrentNode();
  for (Trigger trigger : triggersForCurrentNode) {
    if (trigger.matches(table, platform.getDefaultCatalog(), platform.getDefaultSchema(),
        ignoreCase)) {
      log.info("Synchronizing triggers for {}", table.getFullyQualifiedTableName());
      updateOrCreateDatabaseTriggers(trigger, table, null, force, true);
      log.info("Done synchronizing triggers for {}", table.getFullyQualifiedTableName());
    }
  }
}
origin: org.jumpmind.symmetric/symmetric-io

targetTable.getCatalog(), targetTable.getSchema(),
targetTable.getName(),
lookupKeys.toArray(new Column[lookupKeys.size()]),
origin: org.jumpmind.symmetric/symmetric-io

    targetTable.getCatalog(), targetTable.getSchema(), targetTable.getName(),
    lookupKeys.toArray(new Column[lookupKeys.size()]), null, nullKeyValues);
if (log.isDebugEnabled()) {
origin: org.jumpmind.symmetric/symmetric-core

if (!table.getName().toLowerCase().startsWith(engine.getTablePrefix() + "_")) {
  wildcardLoadFilters = loadFilters.get(Table.getFullyQualifiedTableName(
      table.getCatalog(), table.getSchema(), FormatUtils.WILDCARD));
  tableName = Table.getFullyQualifiedTableName(table.getCatalog(), table.getSchema(), table.getName().toUpperCase(), "");
origin: org.jumpmind.symmetric/symmetric-io

String sqlSelect = platform.createDmlStatement(DmlType.SELECT, table.getCatalog(), table.getSchema(), table.getName(),
    selectColumnArray, table.getColumns(), null).getSql();
Object[] values = new Object[selectColumnArray.length];
origin: org.jumpmind.symmetric/symmetric-io

    table.getCatalog(), table.getSchema(), table.getName(),
    table.getPrimaryKeyColumns(), table.getNonPrimaryKeyColumns(), null);
Column[] columns = updStatement.getMetaData();
origin: org.jumpmind.symmetric/symmetric-io

public boolean start(Table table) {
  /*
   * in the case when the target schema or catalog is set then we need to
   * use the previous schema or catalog to look up the table locally.
   */
  this.currentTable = platform.getTableFromCache(table.getOldCatalog(), table.getOldSchema(), table.getName(), false);
  this.currentTable = currentTable.copyAndFilterColumns(table.getColumnNames(),
      table.getPrimaryKeyColumnNames(), true);   
  /*
   * restore the schema and catalog from the passed in table because they
   * might have not been originally set, but were set when looking up the table locally
   */
  this.currentTable.setSchema(table.getSchema());
  this.currentTable.setCatalog(table.getCatalog());
  this.currentTable.setName(table.getName());
  return true;
}
origin: org.jumpmind.symmetric/symmetric-core

error.setBatchId(this.currentBatch.getBatchId());
error.setNodeId(this.currentBatch.getNodeId());
error.setTargetCatalogName(context.getTable().getCatalog());
error.setTargetSchemaName(context.getTable().getSchema());
error.setTargetTableName(context.getTable().getName());                            
origin: org.jumpmind.symmetric/symmetric-io

protected String preprocessSqlStatement(String sql) {
  sql = FormatUtils.replace("nodeId", batch.getTargetNodeId(), sql);
  if (targetTable != null) {
    sql = FormatUtils.replace("catalogName", quoteString(targetTable.getCatalog()),sql);
    sql = FormatUtils.replace("schemaName", quoteString(targetTable.getSchema()), sql);
    sql = FormatUtils.replace("tableName", quoteString(targetTable.getName()), sql);
  } else if (sourceTable != null){
    sql = FormatUtils.replace("catalogName", quoteString(sourceTable.getCatalog()),sql);
    sql = FormatUtils.replace("schemaName", quoteString(sourceTable.getSchema()), sql);
    sql = FormatUtils.replace("tableName", quoteString(sourceTable.getName()), sql);
  }
  sql = platform.scrubSql(sql);
  
  sql = FormatUtils.replace("sourceNodeId", (String) context.get("sourceNodeId"), sql);
  sql = FormatUtils.replace("sourceNodeExternalId",
      (String) context.get("sourceNodeExternalId"), sql);
  sql = FormatUtils.replace("sourceNodeGroupId", (String) context.get("sourceNodeGroupId"),
      sql);
  sql = FormatUtils.replace("targetNodeId", (String) context.get("targetNodeId"), sql);
  sql = FormatUtils.replace("targetNodeExternalId",
      (String) context.get("targetNodeExternalId"), sql);
  sql = FormatUtils.replace("targetNodeGroupId", (String) context.get("targetNodeGroupId"),
      sql);
  return sql;
}
origin: org.jumpmind.symmetric/symmetric-io

context.getTable().getCatalog(), context.getTable().getSchema(),
context.getTable().getName(), false);
org.jumpmind.db.modelTablegetCatalog

Popular methods of Table

  • getFullyQualifiedTableName
  • getColumns
  • <init>
  • getColumnCount
  • getColumnNames
  • getColumnWithName
  • getName
  • getPrimaryKeyColumns
  • getSchema
  • setCatalog
  • setName
  • setSchema
  • setName,
  • setSchema,
  • addColumn,
  • addColumns,
  • calculateTableHashcode,
  • copy,
  • copyAndFilterColumns,
  • findColumn,
  • getColumn

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • putExtra (Intent)
  • setScale (BigDecimal)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now