Examples of quotedFullyQualifiedName()


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

                StringBuffer sqlBuffer = new StringBuffer();

                QuotingStrategy context = adapter.getQuotingStrategy();

                sqlBuffer.append("ALTER TABLE ");
                sqlBuffer.append(context.quotedFullyQualifiedName(getEntity()));
                sqlBuffer.append(" CHANGE ");
                sqlBuffer.append(context.quotedName(getColumn()));
                sqlBuffer.append(" ");
                adapter.createTableAppendColumn(sqlBuffer, column);
View Full Code Here

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

                StringBuffer sqlBuffer = new StringBuffer();

                QuotingStrategy context = adapter.getQuotingStrategy();

                sqlBuffer.append("ALTER TABLE ");
                sqlBuffer.append(context.quotedFullyQualifiedName(getEntity()));
                sqlBuffer.append(" CHANGE ");
                sqlBuffer.append(context.quotedName(getColumn()));
                sqlBuffer.append(" ");
                adapter.createTableAppendColumn(sqlBuffer, column);
View Full Code Here

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

                }
                QuotingStrategy context = adapter.getQuotingStrategy();
                StringBuilder buf = new StringBuilder();
                // http://dev.mysql.com/tech-resources/articles/mysql-cluster-50.html
                buf.append("ALTER TABLE ");
                buf.append(context.quotedFullyQualifiedName(entity));
                buf.append(" DROP FOREIGN KEY ");
                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(" ALTER COLUMN ");
                sqlBuffer.append(context.quotedName(getColumn()));
                sqlBuffer.append(" NULL");

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

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

        List<DbAttribute> qualifierAttributes = updateBatch.getQualifierAttributes();
        List<DbAttribute> updatedDbAttributes = updateBatch.getUpdatedAttributes();

        StringBuffer query = new StringBuffer("UPDATE ");
        query.append(strategy.quotedFullyQualifiedName(batch.getDbEntity()));
        query.append(" SET ");

        int len = updatedDbAttributes.size();
        for (int i = 0; i < len; i++) {
            if (i > 0) {
View Full Code Here

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

        // note that CASCADE is a noop as of MySQL 5.0, so we have to use FK
        // checks
        // statement
        StringBuffer buf = new StringBuffer();
        QuotingStrategy context = getQuotingStrategy();
        buf.append(context.quotedFullyQualifiedName(table));

        return Arrays.asList("SET FOREIGN_KEY_CHECKS=0", "DROP TABLE IF EXISTS " + buf.toString() + " CASCADE",
                "SET FOREIGN_KEY_CHECKS=1");
    }
View Full Code Here

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

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

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

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

    @Override
    public String createTable(DbEntity ent) {
        QuotingStrategy context = getQuotingStrategy();
        StringBuilder buf = new StringBuilder();
        buf.append("CREATE TABLE ");
        buf.append(context.quotedFullyQualifiedName(ent));
        buf.append(" (");

        // columns
        Iterator<DbAttribute> it = ent.getAttributes().iterator();
        boolean first = true;
View Full Code Here

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

                    QuotingStrategy context = adapter.getQuotingStrategy();
                    StringBuilder buf = new StringBuilder();
                    StringBuilder refBuf = new StringBuilder();

                    buf.append("ALTER TABLE ");
                    buf.append(context.quotedFullyQualifiedName(source));

                    // requires the ADD CONSTRAINT statement
                    buf.append(" ADD CONSTRAINT ");
                    String name = "U_" + rel.getSourceEntity().getName() + "_"
                            + (long) (System.currentTimeMillis() / (Math.random() * 100000));
 
View Full Code Here

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

    @Override
    public Collection<String> dropTableStatements(DbEntity table) {

        QuotingStrategy context = getQuotingStrategy();
        StringBuffer buf = new StringBuffer("DROP TABLE ");
        buf.append(context.quotedFullyQualifiedName(table));

        buf.append(" CASCADE");
        return Collections.singleton(buf.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.