Examples of DBTable


Examples of com.dci.intellij.dbn.object.DBTable

            List<DBObject> selectedObjects = DatabaseBrowserManager.getInstance(object.getProject()).getSelectedObjects();
            add(new GenerateSelectStatementAction(selectedObjects));
        }

        if (object instanceof DBTable) {
            DBTable table = (DBTable) object;
            add(new GenerateInsertStatementAction(table));
        }

        DatabaseCompatibilityInterface compatibilityInterface = DatabaseCompatibilityInterface.getInstance(object);
        if (object instanceof DBSchemaObject &&
View Full Code Here

Examples of com.dci.intellij.dbn.object.DBTable

            if (shortestPath[0] != null && shortestPath[0].size() < path.size()) {
                return;
            }
        }

        DBTable sourceTable = (DBTable) sourceColumn.getDataset();
        for (DBColumn column : sourceTable.getForeignKeyColumns()) {
            if (column != sourceColumn) {
                DBColumn fkColumn = column.getForeignKeyColumn();
                buildDependencyPath(path, fkColumn, targetColumn, shortestPath);
            }

        }

        for (DBColumn pkColumn : sourceTable.getPrimaryKeyColumns()) {
            if (pkColumn != sourceColumn) {
                for (DBColumn fkColumn : pkColumn.getReferencingColumns()) {
                    buildDependencyPath(path, fkColumn, targetColumn, shortestPath);
                }
            }
View Full Code Here

Examples of com.healthmarketscience.sqlbuilder.dbspec.basic.DbTable

  protected DbTable createSqlTable(SqlMapping mapping) {
    // create default schema
    DbSpec spec = new DbSpec();
    DbSchema schema = spec.addDefaultSchema();

    DbTable table = schema.addTable(mapping.getTableName());

    addColumn(table, primaryColumn);
    for(Map.Entry<String, Column> entry : mapping.getFields().entrySet()) {
      addColumn(table, entry.getValue());
    }
View Full Code Here

Examples of com.knowgate.dataobjs.DBTable

   * @throws SQLException
   */
  public QueryByForm(JDCConnection oConn, String sBaseTable, String sTableAlias, String sQueryGUID) throws SQLException {
    super(DB.k_queries, "QueryByForm");

    oBaseTable = new DBTable(oConn.getCatalog(), "dbo", sBaseTable, 1);
    oBaseTable.readColumns(oConn, oConn.getMetaData());
    sAlias = sTableAlias;

    Object aQry[] = { sQueryGUID };

View Full Code Here

Examples of dbfit.api.DbTable

    @Override
    protected DbObject getTargetDbObject() throws SQLException {
        if ((tableName == null || tableName.trim().length() == 0) && args.length > 0) {
            tableName = args[0];
        };
        return new DbTable(environment, tableName);
    }
View Full Code Here

Examples of de.mhus.lib.adb.annotations.DbTable

    this.tableName = tableName;
  }

  public void initDatabase(DbConnection con) throws Exception {
   
    DbTable table = clazz.getAnnotation(DbTable.class);
    if (tableName != null) {
      name = tableName;
    } else
    if (table == null || MString.isEmptyTrim(table.tableName())) {
      name = clazz.getSimpleName();
    } else {
      name = table.tableName();
    }
   
    if (table != null &&!MString.isEmptyTrim(table.attributes())) {
      attributes = MConfigFactory.getInstance().toConfig(table.attributes());
    } else {
      attributes = new HashConfig();
    }
   
    tableNameOrg = schema.getTableName(name);
    tableName = manager.getPool().getDialect().normalizeTableName(tableNameOrg);
   
    log().t("new table",name,tableName);
   
    parseFields();
   
    // features
    if (table != null && !MString.isEmptyTrim(table.features())) {
      for (String featureName : MString.split(table.features(),",")) {
        Feature feature = manager.getSchema().createFeature(manager, this, featureName);
        if (feature != null) features.add(feature);
      }
    }
   
View Full Code Here

Examples of jodd.db.oom.meta.DbTable

   * type is not annotated, table name will be set to wildcard pattern '*'
   * (to match all tables).
   */
  public static String resolveTableName(Class<?> type, TableNamingStrategy tableNamingStrategy) {
    String tableName = null;
    DbTable dbTable = type.getAnnotation(DbTable.class);
    if (dbTable != null) {
      tableName = dbTable.value().trim();
    }
    if ((tableName == null) || (tableName.length() == 0)) {
      tableName = tableNamingStrategy.convertEntityNameToTableName(type);
    } else {
      if (!tableNamingStrategy.isStrictAnnotationNames()) {
View Full Code Here

Examples of org.apache.empire.db.DBTable

    @Override
    public Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn)
    {   //Use Oracle Sequences
        if (useSequenceTable)
        {   // Use a sequence Table to generate Sequences
            DBTable t = db.getTable(sequenceTableName);
            return ((DBSeqTable)t).getNextValue(seqName, minValue, conn);
        }
        else
        {   // Post Detection
            return null;
View Full Code Here

Examples of org.apache.empire.db.DBTable

     *
     * @return true if the relation has been created successfully
     */
    protected boolean createRelation(DBRelation r, DBSQLScript script)
    {
        DBTable sourceTable = (DBTable) r.getReferences()[0].getSourceColumn().getRowSet();
        DBTable targetTable = (DBTable) r.getReferences()[0].getTargetColumn().getRowSet();

        StringBuilder sql = new StringBuilder();
        sql.append("-- creating foreign key constraint ");
        sql.append(r.getName());
        sql.append(" --\r\n");
        sql.append("ALTER TABLE ");
        sourceTable.addSQL(sql, DBExpr.CTX_FULLNAME);
        sql.append(" ADD CONSTRAINT ");
        appendElementName(sql, r.getName());
        sql.append(" FOREIGN KEY (");
        // Source Names
        boolean addSeparator = false;
        DBRelation.DBReference[] refs = r.getReferences();
        for (int i = 0; i < refs.length; i++)
        {
            sql.append((addSeparator) ? ", " : "");
            refs[i].getSourceColumn().addSQL(sql, DBExpr.CTX_NAME);
            addSeparator = true;
        }
        // References
        sql.append(") REFERENCES ");
        targetTable.addSQL(sql, DBExpr.CTX_FULLNAME);
        sql.append(" (");
        // Target Names
        addSeparator = false;
        for (int i = 0; i < refs.length; i++)
        {
View Full Code Here

Examples of org.apache.empire.db.DBTable

            }
            DBCommand cmd = db.createCommand();
            if (cmd == null) {
                throw new AssertionError("The DBCommand object is null.");
            }
            DBTable t = db.getTables().get(0);
            cmd.select(t.count());
            return (db.querySingleInt(cmd, -1, conn) >= 0);
        } catch (Exception e) {
            return false;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.