Package org.apache.cayenne.dba

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(" ALTER COLUMN ");
                sqlBuffer.append(context.quotedName(getColumn()));
                sqlBuffer.append(" NOT NULL");

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


                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(" NULL");

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

                throw new CayenneRuntimeException("Undefined type for attribute '" + ent.getFullyQualifiedName() + "."
                        + at.getName() + "': " + at.getType());
            }

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

            // append size and precision (if applicable)
            if (typeSupportsLength(at.getType())) {

                int len = at.getMaxLength();
View Full Code Here

                    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

                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(" ");
                sqlBuffer.append(adapter.externalTypesForJdbcType(getColumn().getType())[0]);

                if (TypesMapping.supportsLength(getColumn().getType()) && getColumn().getMaxLength() > 0) {
                    sqlBuffer.append("(");
View Full Code Here

        query.append(strategy.quotedFullyQualifiedName(batch.getDbEntity()));
        query.append(" (");

        for (Iterator<DbAttribute> i = dbAttributes.iterator(); i.hasNext();) {
            DbAttribute attribute = i.next();
            query.append(strategy.quotedName(attribute));
            if (i.hasNext()) {
                query.append(", ");
            }
        }
        query.append(") VALUES (");
View Full Code Here

        Iterator<DbAttribute> it = pk.iterator();

        // at this point we know that there is at least on PK column
        DbAttribute firstColumn = it.next();
        buffer.append(context.quotedName(firstColumn));

        while (it.hasNext()) {
            DbAttribute column = it.next();
            buffer.append(", ");
            buffer.append(context.quotedName(column));
View Full Code Here

        buffer.append(context.quotedName(firstColumn));

        while (it.hasNext()) {
            DbAttribute column = it.next();
            buffer.append(", ");
            buffer.append(context.quotedName(column));
        }

        buffer.append(")");
        return buffer.toString();
    }
View Full Code Here

        Iterator<DbAttribute> it = pk.iterator();

        // at this point we know that there is at least on PK column
        DbAttribute firstColumn = it.next();
        buffer.append(context.quotedName(firstColumn));

        while (it.hasNext()) {
            DbAttribute column = it.next();
            buffer.append(", ");
            buffer.append(context.quotedName(column));
View Full Code Here

        buffer.append(context.quotedName(firstColumn));

        while (it.hasNext()) {
            DbAttribute column = it.next();
            buffer.append(", ");
            buffer.append(context.quotedName(column));
        }
        buffer.append(")");
        return buffer.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.