Examples of quotedName()


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

                        + "': "
                        + at.getType());
            }

            String type = types[0];
            buf.append(context.quotedName(at)).append(' ').append(type);

            // append size and precision (if applicable)
            if (TypesMapping.supportsLength(at.getType())) {
                int len = at.getMaxLength();
                int scale = TypesMapping.isDecimal(at.getType()) ? at.getScale() : -1;
View Full Code Here

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

                    firstPk = false;
                else
                    buf.append(", ");

                DbAttribute at = pkit.next();
                buf.append(context.quotedName(at));
            }
            buf.append(')');
        }
        buf.append(')');
        return buf.toString();
View Full Code Here

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

            if (i > 0) {
                query.append(", ");
            }

            DbAttribute attribute = updatedDbAttributes.get(i);
            query.append(strategy.quotedName(attribute));
            query.append(" = ");
            appendUpdatedParameter(query, attribute, batch.getValue(i));
        }

        query.append(" WHERE ");
View Full Code Here

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

                StringBuilder sqlBuffer = new StringBuilder();
                QuotingStrategy context = adapter.getQuotingStrategy();
                sqlBuffer.append("ALTER TABLE ");
                sqlBuffer.append(context.quotedFullyQualifiedName(getEntity()));
                sqlBuffer.append(" DROP ");
                sqlBuffer.append(context.quotedName(getColumn()));

                return Collections.singletonList(sqlBuffer.toString());
            }

        };
View Full Code Here

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

            if (includeInBatch(attribute)) {

                if (columnCount > 0) {
                    query.append(", ");
                }
                query.append(strategy.quotedName(attribute));
                columnCount++;
            }
        }

        query.append(") VALUES (");
View Full Code Here

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

        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.quotedName()

    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.quotedName()

    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.quotedName()

            }

            DbAttribute attribute = pkList.get(i);

            sql.append("#result('");
            sql.append(quoter.quotedName(attribute));

            // since the name of the column can potentially be quoted and
            // use reserved keywords as name, let's specify generated column
            // name parameters to ensure the query doesn't explode
            sql.append("' '").append(TypesMapping.getJavaBySqlType(attribute.getType()));
View Full Code Here

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

        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(", ");
            }
        }
        sql.append(")");
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.