Package org.apache.cayenne.dba

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


        String srcName = getTableName(source);

        StringBuilder buf = new StringBuilder();

        buf.append("ALTER TABLE ").append(context.quoteString(srcName));
        buf.append(" ADD CONSTRAINT ");

        buf.append(context.quoteString(getSchemaName(source)));
        String name = "U_"
                + source.getName()
View Full Code Here


        StringBuilder buf = new StringBuilder();

        buf.append("ALTER TABLE ").append(context.quoteString(srcName));
        buf.append(" ADD CONSTRAINT ");

        buf.append(context.quoteString(getSchemaName(source)));
        String name = "U_"
                + source.getName()
                + "_"
                + (long) (System.currentTimeMillis() / (Math.random() * 100000));

 
View Full Code Here

        String name = "U_"
                + source.getName()
                + "_"
                + (long) (System.currentTimeMillis() / (Math.random() * 100000));

        buf.append(context.quoteString(name));
        buf.append(" UNIQUE (");

        Iterator<DbAttribute> it = columns.iterator();
        DbAttribute first = it.next();
        buf.append(context.quoteString(first.getName()));
View Full Code Here

        buf.append(context.quoteString(name));
        buf.append(" UNIQUE (");

        Iterator<DbAttribute> it = columns.iterator();
        DbAttribute first = it.next();
        buf.append(context.quoteString(first.getName()));

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

        buf.append(context.quoteString(first.getName()));

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

        buf.append(")");

        return buf.toString();
View Full Code Here

        String name = "U_"
                + rel.getSourceEntity().getName()
                + "_"
                + (long) (System.currentTimeMillis() / (Math.random() * 100000));

        buf.append(context.quoteString(name));
        buf.append(" FOREIGN KEY (");

        boolean first = true;
        for (DbJoin join : rel.getJoins()) {
            if (!first) {
View Full Code Here

                refBuf.append(", ");
            }
            else
                first = false;

            buf.append(context.quoteString(join.getSourceName()));
            refBuf.append(context.quoteString(join.getTargetName()));
        }

        buf.append(") REFERENCES ");
        buf.append(dstName);
View Full Code Here

            }
            else
                first = false;

            buf.append(context.quoteString(join.getSourceName()));
            refBuf.append(context.quoteString(join.getTargetName()));
        }

        buf.append(") REFERENCES ");
        buf.append(dstName);
        buf.append(" (");
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

            String entName = entity.getName();
            String seqName = _SEQUENCE_PREFIX + entName.toLowerCase();

            if (entity.getSchema() != null && entity.getSchema().length() > 0) {

                seqName = context.quoteString(entity.getSchema()) + "." +
                context.quoteString(seqName);
             } else {
                seqName = context.quoteString(seqName);
             }
            return seqName;
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.