Examples of quotedFullyQualifiedName()


Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

        List<DbAttribute> dbAttributes = batch.getDbAttributes();
        QuotingStrategy strategy =  getAdapter().getQuotingStrategy();

        StringBuilder query = new StringBuilder("INSERT INTO ");
        query.append(strategy.quotedFullyQualifiedName(batch.getDbEntity()));
        query.append(" (");

        int columnCount = 0;
        for (DbAttribute attribute : dbAttributes) {
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

    public MergerToken createDropColumnToDb(DbEntity entity, DbAttribute column) {
        return new DropColumnToDb(entity, column) {
            public List<String> createSql(DbAdapter adapter) {
                QuotingStrategy quoting = adapter.getQuotingStrategy();
                StringBuilder builder = new StringBuilder("ALTER TABLE ");
                builder.append(quoting.quotedFullyQualifiedName(getEntity()));
                builder.append(" DROP ").append(quoting.quotedName(getColumn()));
                return Collections.singletonList(builder.toString());
            }
        };
    }
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

    @Override
    public MergerToken createSetNotNullToDb(DbEntity entity, DbAttribute column) {
        return new SetNotNullToDb(entity, column) {
            public List<String> createSql(DbAdapter adapter) {
                QuotingStrategy context = adapter.getQuotingStrategy();
                String entityName = context.quotedFullyQualifiedName(getEntity()) ;
                String columnName = context.quotedName(getColumn());
                // Firebird doesn't support ALTER TABLE table_name ALTER column_name SET NOT NULL
                // but this might be achived by modyfication of system tables
                return Collections.singletonList(String.format("UPDATE RDB$RELATION_FIELDS SET RDB$NULL_FLAG = 1 "+
                "WHERE RDB$FIELD_NAME = '%s' AND RDB$RELATION_NAME = '%s'", columnName, entityName));
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

    @Override
    public MergerToken createSetAllowNullToDb(DbEntity entity, DbAttribute column) {
        return new SetAllowNullToDb(entity, column) {
            public List<String> createSql(DbAdapter adapter) {
                QuotingStrategy context = adapter.getQuotingStrategy();
                String entityName = context.quotedFullyQualifiedName(getEntity()) ;
                String columnName = context.quotedName(getColumn());
                // Firebird doesn't support ALTER TABLE table_name ALTER column_name DROP NOT NULL
                // but this might be achived by modyfication system tables
                return Collections.singletonList(String.format("UPDATE RDB$RELATION_FIELDS SET RDB$NULL_FLAG = NULL "+
                " WHERE RDB$FIELD_NAME = '%s' AND RDB$RELATION_NAME = '%s'", columnName, entityName));
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

            sql.append("' '").append(TypesMapping.getJavaBySqlType(attribute.getType()));
            sql.append("' '").append("pk").append(i);
            sql.append("')");
        }

        sql.append(" FROM ").append(quoter.quotedFullyQualifiedName(joinEntity))
                .append(" WHERE ");
        int i = snapshot.size();
        for (Object key : snapshot.keySet()) {
            sql.append(quoter.quotedIdentifier(joinEntity, String.valueOf(key)))
                    .append(" #bindEqual($").append(key).append(")");
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

    protected void appendAddNewPrimaryKeySQL(DbAdapter adapter, List<String> sqls) {
        QuotingStrategy quotingStrategy = adapter.getQuotingStrategy();

        StringBuilder sql = new StringBuilder();
        sql.append("ALTER TABLE ");
        sql.append(quotingStrategy.quotedFullyQualifiedName(getEntity()));
        sql.append(" ADD PRIMARY KEY (");
        for (Iterator<DbAttribute> it = primaryKeyNew.iterator(); it.hasNext();) {
            sql.append(quotingStrategy.quotedName(it.next()));
            if (it.hasNext()) {
                sql.append(", ");
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

    @Override
    public List<String> createSql(DbAdapter adapter) {
        StringBuilder sqlBuffer = new StringBuilder();
        QuotingStrategy context = adapter.getQuotingStrategy();
        sqlBuffer.append("ALTER TABLE ");
        sqlBuffer.append(context.quotedFullyQualifiedName(getEntity()));
        sqlBuffer.append(" ALTER COLUMN ");
        sqlBuffer.append(context.quotedName(getColumn()));
        sqlBuffer.append(" SET NOT NULL");

        return Collections.singletonList(sqlBuffer.toString());
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

    @Override
    public List<String> createSql(DbAdapter adapter) {
        StringBuilder sqlBuffer = new StringBuilder();
        QuotingStrategy context = adapter.getQuotingStrategy();
        sqlBuffer.append("ALTER TABLE ");
        sqlBuffer.append(context.quotedFullyQualifiedName(getEntity()));
        sqlBuffer.append(" ALTER COLUMN ");
        sqlBuffer.append(context.quotedName(getColumn()));
        sqlBuffer.append(" DROP NOT NULL");

        return Collections.singletonList(sqlBuffer.toString());
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

            return Collections.emptyList();
        }
        QuotingStrategy context = adapter.getQuotingStrategy();
        StringBuilder buf = new StringBuilder();
        buf.append("ALTER TABLE ");
        buf.append(context.quotedFullyQualifiedName(getEntity()));
        buf.append(" DROP CONSTRAINT ");
        buf.append(fkName);

        return Collections.singletonList(buf.toString());
    }
View Full Code Here

Examples of org.apache.cayenne.dba.QuotingStrategy.quotedFullyQualifiedName()

    @Override
    public List<String> createSql(DbAdapter adapter) {
        StringBuilder sqlBuffer = new StringBuilder();
        QuotingStrategy context = adapter.getQuotingStrategy();
        sqlBuffer.append("ALTER TABLE ");
        sqlBuffer.append(context.quotedFullyQualifiedName(getEntity()));
        sqlBuffer.append(" DROP COLUMN ");
        sqlBuffer.append(context.quotedName(getColumn()));

        return Collections.singletonList(sqlBuffer.toString());
    }
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.