Examples of DBIdentifier


Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

    /**
     * Returns a OpenJPA 3-compatible name for an auto-assign sequence.
     */
    protected String getOpenJPA3GeneratedKeySequenceName(Column col) {
        Table table = col.getTable();
        DBIdentifier sName = DBIdentifier.preCombine(table.getIdentifier(), "SEQ");
        return toDBName(getNamingUtil().makeIdentifierValid(sName, table.getSchema().
            getSchemaGroup(), maxTableNameLength, true));
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

    /**
     * Returns a OpenJPA 3-compatible name for an auto-assign trigger.
     */
    protected String getOpenJPA3GeneratedKeyTriggerName(Column col) {
        Table table = col.getTable();       
        DBIdentifier sName = DBIdentifier.preCombine(table.getIdentifier(), "TRIG");
        return toDBName(getNamingUtil().makeIdentifierValid(sName, table.getSchema().
            getSchemaGroup(), maxTableNameLength, true));
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

            Column pkColumn) {
        if (db2ServerType == db2ZOSV8xOrLater) {
            // build the index for the sequence tables
            // the index name will be the fully qualified table name + _IDX
            Table tab = schema.getTable(table);
            DBIdentifier fullIdxId = tab.getFullIdentifier().clone();
            DBIdentifier unQualifiedName = DBIdentifier.append(fullIdxId.getUnqualifiedName(), "IDX");
            fullIdxId.setName(getValidIndexName(unQualifiedName, tab));
            Index idx = tab.addIndex(fullIdxId);
            idx.setUnique(true);
            idx.addColumn(pkColumn);
        }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

        // sequence already exists?
        QualifiedDBIdentifier path = QualifiedDBIdentifier.getPath(_seqName);
        if (group.isKnownSequence(path))
            return;

        DBIdentifier schemaName = getSchemaIdentifier();
        if (DBIdentifier.isEmpty(schemaName)) {
            schemaName = path.getSchemaName();
            if (DBIdentifier.isEmpty(schemaName))
                schemaName = Schemas.getNewTableSchemaIdentifier(_conf);
        }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

    /**
     * Creates the sequence object.
     */
    private void buildSequence() {
        QualifiedDBIdentifier path = QualifiedDBIdentifier.getPath(_seqName);
        DBIdentifier seqName = path.getIdentifier();
        // JPA 2 added schema as a configurable attribute on 
        // sequence generator.  OpenJPA <= 1.x allowed this via
        // schema.sequence on the sequence name.  Specifying a schema
        // name on the annotation or in the orm will override the old
        // behavior.
        DBIdentifier schemaName = _schema;
        if (DBIdentifier.isEmpty(schemaName)) {
            schemaName = path.getSchemaName();
            if (DBIdentifier.isEmpty(schemaName))
                schemaName = Schemas.getNewTableSchemaIdentifier(_conf);
        }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

        StringBuilder buf = new StringBuilder();
        buf.append("CREATE ");
        if (index.isUnique())
            buf.append("UNIQUE ");
       
        DBIdentifier fullIdxName = index.getIdentifier();
        DBIdentifier unQualifiedName = fullIdxName.getUnqualifiedName();
        checkNameLength(toDBName(unQualifiedName), maxIndexNameLength,
                "long-index-name");
        String indexName = toDBName(fullIdxName);
        
        buf.append("INDEX ").append(indexName);
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

     * &lt;fk name&gt;</code> by default.
     */
    public String[] getDropForeignKeySQL(ForeignKey fk, Connection conn) {
        if (DBIdentifier.isNull(fk.getIdentifier())) {
            String[] retVal;
            DBIdentifier fkName = fk.loadIdentifierFromDB(this,conn);
            retVal = (fkName == null || fkName.getName() == null) new String[0] :
                new String[]{ "ALTER TABLE "
                + getFullName(fk.getTable(), false)
                + " DROP CONSTRAINT " + toDBName(fkName) };
            return retVal;
        }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

     * @param targetSchema if true, then the given schema was listed by
     * the user as one of his schemas
     */
    public boolean isSystemTable(DBIdentifier name, DBIdentifier schema,
        boolean targetSchema) {
        DBIdentifier sName = DBIdentifier.toUpper(name);
        if (systemTableSet.contains(sName.getName()))
            return true;
        DBIdentifier schName = DBIdentifier.toUpper(schema);
        return !targetSchema && schema != null
            && systemSchemaSet.contains(schName.getName());
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

    public boolean containsColumn(DBIdentifier name, DBDictionary dict) {
        if (DBIdentifier.isNull(name) || _colMap == null) {
            return false;
        }
        DBIdentifier sName = DBIdentifier.toUpper(name);
        return _colMap.containsKey(sName);
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.identifier.DBIdentifier

        DBIdentifier sName = DBIdentifier.toUpper(name);
        return _colMap.containsKey(sName);
    }

    public boolean containsColumn(Column col) {
        DBIdentifier colName = col.getIdentifier();
        if (DBIdentifier.isNull(colName) || _colMap == null) {
            return false;
        }
        DBIdentifier sName = DBIdentifier.toUpper(colName);
        Collection<Column> coll = _colMap.values();
        for (Column column : coll) {
            if (column.getIdentifier().equals(sName))
                return true;
        }
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.