Package org.apache.cayenne.dba

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


                QuotingStrategy context = adapter.getQuotingStrategy(status);
                StringBuilder buf = new StringBuilder();
                StringBuilder refBuf = new StringBuilder();
       
                buf.append("ALTER TABLE ");
                buf.append(context.quoteFullyQualifiedName(source));
       
                // requires the ADD CONSTRAINT statement
                buf.append(" ADD CONSTRAINT ");
                String name = "U_"
                        + rel.getSourceEntity().getName()
View Full Code Here


                    buf.append(context.quoteString(join.getSourceName()));
                    refBuf.append(context.quoteString(join.getTargetName()));
                }
       
                buf.append(") REFERENCES ");
                buf.append(context.quoteFullyQualifiedName((DbEntity) rel.getTargetEntity()));
                buf.append(" (");
                buf.append(refBuf.toString());
                buf.append(')');
               
                // also make sure we delete dependent FKs
View Full Code Here

                StringBuilder sqlBuffer = new StringBuilder();
                QuotingStrategy context = adapter.getQuotingStrategy(getEntity()
                        .getDataMap()
                        .isQuotingSQLIdentifiers());
                sqlBuffer.append("ALTER TABLE ");
                sqlBuffer.append(context.quoteFullyQualifiedName(getEntity()));
                sqlBuffer.append(" ALTER COLUMN ");
                sqlBuffer.append(context.quoteString(getColumn().getName()));
                sqlBuffer.append(" ");
                sqlBuffer.append(adapter.externalTypesForJdbcType(getColumn().getType())[0]);
             
View Full Code Here

                QuotingStrategy context = adapter.getQuotingStrategy(getEntity()
                        .getDataMap()
                        .isQuotingSQLIdentifiers());
                StringBuilder buf = new StringBuilder();
                buf.append("ALTER TABLE ");
                buf.append(context.quoteFullyQualifiedName(getEntity()));
                buf.append(" DROP CONSTRAINT ");
                buf.append(fkName);
                buf.append(" CASCADE ");

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

     */
    protected String getTableName(DbEntity entity) {
        QuotingStrategy context = getQuotingStrategy(entity
                .getDataMap()
                .isQuotingSQLIdentifiers());
        return context.quoteFullyQualifiedName(entity);
    }

    /**
     * Generate fully-qualified name for 1.8 and on. Subclass generates unqualified name.
     *
 
View Full Code Here

            status = false;
        }
        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();
        boolean first = true;
View Full Code Here

        else {
            status = false;
        }
        QuotingStrategy context = getQuotingStrategy(status);
        StringBuffer buf = new StringBuffer("DROP TABLE ");
        buf.append(context.quoteFullyQualifiedName(table));

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

    public String dropTable(DbEntity table) {
        QuotingStrategy context = getQuotingStrategy(table
                .getDataMap()
                .isQuotingSQLIdentifiers());
        StringBuffer buf = new StringBuffer("DROP TABLE IF EXISTS ");
        buf.append(context.quoteFullyQualifiedName(table));
        buf.append(" CASCADE");
        return 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

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.