Tabnine Logo
ca.nrc.cadc.tap.schema
Code IndexAdd Tabnine to your IDE (free)

How to use ca.nrc.cadc.tap.schema

Best Java code snippets using ca.nrc.cadc.tap.schema (Showing top 20 results out of 315)

origin: org.opencadc/cadc-tap-schema

public TableDesc(String schemaName, String tableName) 
{
  TapSchema.assertNotNull(TableDesc.class, "schemaName", schemaName);
  TapSchema.assertNotNull(TableDesc.class, "tableName", tableName);
  this.schemaName = schemaName;
  this.tableName = tableName;
}
origin: org.opencadc/cadc-tap-schema

public TableDesc findTable(String tableName)
{
  for (SchemaDesc sd : schemaDescs)
  {
    TableDesc td = sd.getTable(tableName);
    if (td != null)
      return td;
  }
  return null;
}
origin: org.opencadc/cadc-tap-schema

/** 
 * Get the complete TapSchema.
 * 
 * @return complete TapSchema
 */
public TapSchema get()
{
  // depth MIN = schemas and tables
  // depth MAX = columns + keys + functions
  return get(MAX_DEPTH);
}

origin: org.opencadc/cadc-tap-schema

/**
 * Create a VOTableField from a ColumnDesc.
 *
 * @param column
 * @return The associated VOTableField
 */
public static VOTableField convert(ColumnDesc column) {
  VOTableField vtf = new VOTableField(
    column.getColumnName(), column.getDatatype().getDatatype(),
    column.getDatatype().arraysize);
  vtf.xtype = column.getDatatype().xtype;
  return vtf;
}
origin: org.opencadc/cadc-tap-schema

private String generateInsertSQL(TableDesc td) {
  
  StringBuilder sb = new StringBuilder("insert into ");
  sb.append(td.getTableName());
  sb.append(" (");
  for (ColumnDesc cd : td.getColumnDescs()) {
    sb.append(cd.getColumnName());
    sb.append(", ");
  }
  sb.setLength(sb.length() - 2);
  sb.append(") values (");
  for (ColumnDesc cd : td.getColumnDescs()) {
    sb.append("?, ");
  }
  sb.setLength(sb.length() - 2);
  sb.append(")");
  return sb.toString();
}

origin: org.opencadc/cadc-tap-schema

SchemaDesc getSchema(String schemaName) {
  // List of TAP_SCHEMA.schemas
  GetSchemasStatement gss = new GetSchemasStatement(schemasTableName);
  if (ordered)
    gss.setOrderBy(orderSchemaClause);
  JdbcTemplate jdbc = new JdbcTemplate(dataSource);
  List<SchemaDesc> schemaDescs = jdbc.query(gss, new SchemaMapper());
  for (SchemaDesc sd : schemaDescs) {
    if (sd.getSchemaName().equals(schemaName)) {
      return sd;
    }
  }
  return null;
}

origin: org.opencadc/cadc-tap-schema

/**
 *
 * @param columnDesc
 * @return data type code for use in PreparedStatement set methods
 */
@Override
public Integer getType(ColumnDesc columnDesc) {
  TapDataType tt = columnDesc.getDatatype();
  TypePair dbt = findTypePair(tt);
  return dbt.num;
}
origin: org.opencadc/cadc-adql

private TapDataType getDatatypeFromExpression(Expression expression)
{
  // TODO: could check constant types instead iof lazy string
  return new TapDataType("char", "*", null);
}

origin: org.opencadc/cadc-tap-schema

public static void checkValidTableName(String identifier)  throws ADQLIdentifierException {
  String[] parts = identifier.split("[.]");
  String schemaName = null;
  String tableName = identifier;
  if (parts.length == 2) {
    schemaName = parts[0];
    tableName = parts[1];
  } else if (parts.length > 2) {
    throw new ADQLIdentifierException("invalid table name: " + identifier + " (too many parts)");
  }
  if (schemaName != null) {
    checkValidIdentifier(schemaName);
  }
  
  checkValidIdentifier(tableName);
}
origin: org.opencadc/cadc-tap-schema

  public Object mapRow(ResultSet rs, int rowNum) throws SQLException
  {
    String sn = rs.getString("schema_name");
    String tn = rs.getString("table_name");
    TableDesc tableDesc = new TableDesc(sn, tn);
    
    tableDesc.tableType = TableDesc.TableType.toValue(rs.getString("table_type"));
    tableDesc.description = rs.getString("description");
    tableDesc.utype = rs.getString("utype");
    
    return tableDesc;
  }
}
origin: org.opencadc/cadc-tap-schema

  public Object mapRow(ResultSet rs, int rowNum) throws SQLException
  {
    String sn = rs.getString("schema_name");
    SchemaDesc schemaDesc = new SchemaDesc(sn);
    
    schemaDesc.description = rs.getString("description");
    schemaDesc.utype = rs.getString("utype");
    
    return schemaDesc;
  }
}
origin: org.opencadc/cadc-tap-schema

protected TapSchemaDAO getTapSchemaDAO()
{
  return new TapSchemaDAO();
}

origin: org.opencadc/cadc-tap-schema

@Override
public int hashCode()
{
  return toString().hashCode();
}

origin: org.opencadc/cadc-tap-schema

  public Object mapRow(ResultSet rs, int rowNum) throws SQLException
  {
    String kid = rs.getString("key_id");
    String fc = rs.getString("from_column");
    String tc = rs.getString("target_column");
    KeyColumnDesc keyColumnDesc = new KeyColumnDesc(kid, fc, tc);
    return keyColumnDesc;
  }
}
origin: org.opencadc/cadc-tap-schema

  public Object mapRow(ResultSet rs, int rowNum) throws SQLException
  {
    String kid = rs.getString("key_id");
    String ft = rs.getString("from_table");
    String tt = rs.getString("target_table");
    KeyDesc keyDesc = new KeyDesc(kid, ft, tt);
    
    keyDesc.description = rs.getString("description");
    keyDesc.utype = rs.getString("utype");
    
    return keyDesc;
  }
}
origin: org.opencadc/cadc-tap-schema

public TapDataType(String datatype) 
{
  TapSchema.assertNotNull(TapDataType.class, "datatype", datatype);
  this.datatype = datatype;
}

origin: org.opencadc/cadc-tap-schema

public FunctionDesc(String name, TapDataType datatype)
{
  TapSchema.assertNotNull(FunctionDesc.class, "name", name);
  TapSchema.assertNotNull(FunctionDesc.class, "datatype", datatype);
  this.name = name;
  this.datatype = datatype;
}

origin: org.opencadc/cadc-tap-schema

public ColumnDesc(String tableName, String columnName, TapDataType datatype)
{
  TapSchema.assertNotNull(TableDesc.class, "tableName", tableName);
  TapSchema.assertNotNull(TableDesc.class, "columnName", columnName);
  TapSchema.assertNotNull(TableDesc.class, "datatype", datatype);
  this.tableName = tableName;
  this.columnName = columnName;
  this.datatype = datatype;
}
origin: org.opencadc/cadc-tap-schema

public SchemaDesc(String schemaName)
{
  TapSchema.assertNotNull(SchemaDesc.class, "schemaName", schemaName);
  this.schemaName = schemaName;
}
origin: org.opencadc/cadc-tap-server

/**
 * A new column created by some sort of expression. This could be a function call, algebraic 
 * expression, case statement, etc. The calling code must set any additional column
 * metadata.
 * 
 * @param name
 * @param datatype
 */
public TapSelectItem(String name, TapDataType datatype)
{
  TapSchema.assertNotNull(TapSelectItem.class, "name", name);
  TapSchema.assertNotNull(TapSelectItem.class, "datatype", datatype);
  this.name = name;
  this.datatype = datatype;
}
ca.nrc.cadc.tap.schema

Most used classes

  • ColumnDesc
    Descriptor Class to represent a TAP_SCHEMA.columns table.
  • TapDataType
    TAP data type descriptor.
  • SchemaDesc
    Descriptor class to represent a TAP_SCHEMA.schemas table.
  • TableDesc
    Descriptor Class to represent a TAP_SCHEMA.tables table.
  • TapSchema
    Class to represent a TAP_SCHEMA.
  • TapSchemaDAO,
  • TapSchemaUtil,
  • ADQLIdentifierException,
  • KeyColumnDesc,
  • KeyDesc,
  • TableDesc$TableType,
  • TapSchemaDAO$ColumnMapper,
  • TapSchemaDAO$DeleteColumnsStatement,
  • TapSchemaDAO$DeleteTableStatement,
  • TapSchemaDAO$GetColumnsStatement,
  • TapSchemaDAO$GetKeyColumnsStatement,
  • TapSchemaDAO$GetKeysStatement,
  • TapSchemaDAO$GetSchemasStatement,
  • TapSchemaDAO$GetTablesStatement
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