Package org.apache.cayenne.dba

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


            && batch.getDbEntity().getDataMap().isQuotingSQLIdentifiers();
       
        QuotingStrategy strategy =  getAdapter().getQuotingStrategy(status);
      
        StringBuffer query = new StringBuffer("DELETE FROM ");
        query.append(strategy.quoteFullyQualifiedName(batch.getDbEntity()));

        applyQualifier(query, batch);

        return query.toString();
    }
View Full Code Here


            status = false;
        }
        QuotingStrategy strategy = getAdapter().getQuotingStrategy(status);
   
        StringBuffer query = new StringBuffer("UPDATE ");
    query.append(strategy.quoteFullyQualifiedName(batch.getDbEntity()));
    query.append(" SET ");

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

            sql.append("')");
        }

        sql
                .append(" FROM ")
                .append(quoter.quoteFullyQualifiedName(joinEntity))
                .append(" WHERE ");
        int i = snapshot.size();
        for (Object key : snapshot.keySet()) {
            sql
                    .append(quoter.quoteString(String.valueOf(key)))
View Full Code Here

    public Collection<String> dropTableStatements(DbEntity table) {
        QuotingStrategy context = getQuotingStrategy(table
                .getDataMap()
                .isQuotingSQLIdentifiers());
        StringBuffer buf = new StringBuffer("DROP TABLE ");
        buf.append(context.quoteFullyQualifiedName(table));

        buf.append(" CASCADE CONSTRAINTS");
        return Collections.singleton(buf.toString());
    }
View Full Code Here

        // statement
        StringBuffer buf = new StringBuffer();
        QuotingStrategy context = getQuotingStrategy(table
                .getDataMap()
                .isQuotingSQLIdentifiers());
        buf.append(context.quoteFullyQualifiedName(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

            for (String constraint : constraints) {
                StringBuilder drop = new StringBuilder();

                drop.append("ALTER TABLE ").append(
                        strategy.quoteFullyQualifiedName(entity)).append(
                        " DROP CONSTRAINT ").append(constraint);
                executeDDL(conn, drop.toString());
            }
        }
    }
View Full Code Here

                .getDataMap()
                .isQuotingSQLIdentifiers());
        StringBuilder buf = new StringBuilder();

        buf.append("CREATE TABLE ");
        buf.append(context.quoteFullyQualifiedName(ent));
        buf.append(" (");

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

        }
        QuotingStrategy context = getQuotingStrategy(status);
        StringBuilder buf = new StringBuilder();
        buf.append("CREATE TABLE ");

        buf.append(context.quoteFullyQualifiedName(ent));

        buf.append(" (");

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

    public Collection<String> dropTableStatements(DbEntity table) {
        QuotingStrategy context = getQuotingStrategy(table
                .getDataMap()
                .isQuotingSQLIdentifiers());
        StringBuffer buf = new StringBuffer("DROP TABLE ");
        buf.append(context.quoteFullyQualifiedName(table));
        buf.append(" CASCADE");
        return Collections.singleton(buf.toString());
    }

    /**
 
View Full Code Here

                StringBuilder buf = new StringBuilder();
                QuotingStrategy context = adapter.getQuotingStrategy(getEntity()
                        .getDataMap()
                        .isQuotingSQLIdentifiers());
                buf.append("ALTER TABLE ");
                buf.append(context.quoteFullyQualifiedName(getEntity()));
                buf.append(" DROP COLUMN ");
                buf.append(context.quoteString(getColumn().getName()));
                buf.append(" RESTRICT ");

                return Collections.singletonList(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.