Package org.apache.cayenne.dba

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


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

                DbAttribute at = pkit.next();
                sqlBuffer.append(context.quoteString(at.getName()));
            }
            sqlBuffer.append(')');
        }

        // if FK constraints are supported, we must add indices to all FKs
View Full Code Here


                    Iterator<DbAttribute> columns = relationship
                            .getSourceAttributes()
                            .iterator();
                    DbAttribute column = columns.next();
                    sqlBuffer.append(context.quoteString(column.getName()));

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

                    sqlBuffer.append(context.quoteString(column.getName()));

                    while (columns.hasNext()) {
                        column = columns.next();
                        sqlBuffer.append(", ").append(
                                context.quoteString(column.getName()));
                    }

                    sqlBuffer.append(")");
                }
            }
View Full Code Here

        // assemble...
        // note that max length for types like XYZ FOR BIT DATA must be entered in the
        // middle of type name, e.g. VARCHAR (100) FOR BIT DATA.

        sqlBuffer.append(context.quoteString(column.getName()));
      
        sqlBuffer.append(' ');
        if (length.length() > 0 && type.endsWith(FOR_BIT_DATA_SUFFIX)) {
            sqlBuffer.append(type.substring(0, type.length()
                    - FOR_BIT_DATA_SUFFIX.length()));
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 (TypesMapping.supportsLength(at.getType())) {
                int len = at.getMaxLength();
                int scale = TypesMapping.isDecimal(at.getType()) ? at.getScale() : -1;
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

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

                return Collections.singletonList(sqlBuffer.toString());
            }

        };
View Full Code Here

    protected String getSchemaName(DbEntity entity) {
        if (entity.getSchema() != null && entity.getSchema().length() > 0) {
            QuotingStrategy context = getQuotingStrategy(entity
                    .getDataMap()
                    .isQuotingSQLIdentifiers());
            return context.quoteString(entity.getSchema()) + ".";
        }

        return "";
    }
View Full Code Here

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

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

            // Mapping LONGVARCHAR without length creates a column with lenght "1" which
            // is defintely not what we want...so just use something very large (1Gb seems
            // to be the limit for FB)
            if (at.getType() == Types.LONGVARCHAR) {
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

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.