Package org.apache.cayenne.dba

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


                        .getDataMap()
                        .isQuotingSQLIdentifiers());
                sqlBuffer.append("ALTER TABLE ");
                sqlBuffer.append(context.quoteFullyQualifiedName(getEntity()));
                sqlBuffer.append(" ALTER COLUMN ");
                sqlBuffer.append(context.quoteString(getColumn().getName()));
                sqlBuffer.append(" NULL");

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


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

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

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

                        .getDataMap()
                        .isQuotingSQLIdentifiers());
                sqlBuffer.append("ALTER TABLE ");
                sqlBuffer.append(context.quoteFullyQualifiedName(getEntity()));
                sqlBuffer.append(" ALTER COLUMN ");
                sqlBuffer.append(context.quoteString(getColumn().getName()));
                sqlBuffer.append(" NULL");

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

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

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

        } else {
            status = false;
        }
        QuotingStrategy context =  getAdapter().getQuotingStrategy(status);

        buffer.append(context.quoteString(entity.getName()));

        buffer.append(" (");

        Iterator<DbAttribute> it = pk.iterator();
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.quoteString(firstColumn.getName()));

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

        buffer.append(context.quoteString(firstColumn.getName()));

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

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

        // compound PK doesn't work well with UNIQUE index...
        // create a regular one in this case
        buffer.append(pk.size() == 1 ? "CREATE UNIQUE INDEX " : "CREATE INDEX ");
        buffer.append(context.quoteString(entity.getName()));
        buffer.append(" (");

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

        // at this point we know that there is at least on PK column
View Full Code Here

                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
                ResultSet rs = sel.executeQuery(sql);
                try {
                    List<String> sequenceList = new ArrayList<String>();
                    while (rs.next()) {                       
                        sequenceList.add(context.quoteString(rs.getString(1)));
                    }
                    return sequenceList;
                }
                finally {
                    rs.close();
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.quoteString(firstColumn.getName()));

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