public String getCreateSQLWithoutName() { return getCreateSQL(false); }
public String getCreateSQL() { return getCreateSQL(true); }
@Override public String getCreateSQL() { return "CREATE DOMAIN " + getSQL() + " AS " + column.getCreateSQL(); }
/** {@inheritDoc} */ @SuppressWarnings("StringConcatenationInsideStringBufferAppend") @Override public String getCreateSQL() { StringBuilder sql = new StringBuilder(); sql.append("CREATE TABLE " + getTableName() + '('); boolean isFirst = true; for (Column col : getColumns()) { if (isFirst) isFirst = false; else sql.append(", "); sql.append(col.getCreateSQL()); } sql.append(')'); return sql.toString(); } }
/** * Check that the index columns are not CLOB or BLOB. * * @param columns the columns */ protected static void checkIndexColumnTypes(IndexColumn[] columns) { for (IndexColumn c : columns) { int type = c.column.getType(); if (type == Value.CLOB || type == Value.BLOB) { throw DbException.getUnsupportedException( "Index on BLOB or CLOB column: " + c.column.getCreateSQL()); } } }
/** * Convert a value to this column's type using the given {@link Mode}. * <p> * Use this method in case the conversion is Mode-dependent. * * @param v the value * @param mode the database {@link Mode} to use * @return the value */ public Value convert(Value v, Mode mode) { try { return v.convertTo(type, MathUtils.convertLongToInt(precision), mode, this, getEnumerators()); } catch (DbException e) { if (e.getErrorCode() == ErrorCode.DATA_CONVERSION_ERROR_1) { String target = (table == null ? "" : table.getName() + ": ") + getCreateSQL(); throw DbException.get( ErrorCode.DATA_CONVERSION_ERROR_1, e, v.getSQL() + " (" + target + ")"); } throw e; } }
@Override public String getSQL() { StatementBuilder buff = new StatementBuilder(getName()); buff.append('('); int i = 0; for (Expression e : args) { buff.appendExceptFirst(", "); buff.append(columnList[i++].getCreateSQL()).append('=').append(e.getSQL()); } return buff.append(')').toString(); }
/** * @param c Column to take type definition from. * @return Type. */ public static GridSqlType fromColumn(Column c) { if (c.getName() != null) c = new Column(null, c.getType(), c.getPrecision(), c.getScale(), c.getDisplaySize()); return new GridSqlType(c.getType(), c.getScale(), c.getPrecision(), c.getDisplaySize(), c.getCreateSQL()); }
throw DbException.throwInternalError(removeCol.getCreateSQL());
getCreateSQL(), s + " (" + value.getPrecision() + ")"); getCreateSQL(), s);
buff.append(args[0].getSQL()).append(" AS "). append(new Column(null, dataType, precision, scale, displaySize).getCreateSQL()); break; if (database.getMode().swapConvertFunctionParameters) { buff.append(new Column(null, dataType, precision, scale, displaySize).getCreateSQL()). append(',').append(args[0].getSQL()); } else { buff.append(args[0].getSQL()).append(','). append(new Column(null, dataType, precision, scale, displaySize).getCreateSQL());
for (Column column : columns) { buff.appendExceptFirst(",\n "); buff.append(column.getCreateSQL());
throw DbException.getUnsupportedException( "Spatial index on non-geometry column, " + col.column.getCreateSQL());
throw DbException.getUnsupportedException( "spatial index on non-geometry column, " + columns[0].column.getCreateSQL());
public String getCreateSQL() { StringBuffer buff = new StringBuffer(); buff.append("CREATE DOMAIN "); buff.append(getSQL()); buff.append(" AS "); buff.append(column.getCreateSQL()); return buff.toString(); }
@Override public String getCreateSQL() { return "CREATE DOMAIN " + getSQL() + " AS " + column.getCreateSQL(); }
@Override public String getCreateSQL() { return "CREATE DOMAIN " + getSQL() + " AS " + column.getCreateSQL(); }
@Override public String getSQL() { StatementBuilder buff = new StatementBuilder(getName()); buff.append('('); int i = 0; for (Expression e : args) { buff.appendExceptFirst(", "); buff.append(columnList[i++].getCreateSQL()).append('=').append(e.getSQL()); } return buff.append(')').toString(); }
@Override public String getSQL() { StatementBuilder buff = new StatementBuilder(getName()); buff.append('('); int i = 0; for (Expression e : args) { buff.appendExceptFirst(", "); buff.append(columnList[i++].getCreateSQL()).append('=').append(e.getSQL()); } return buff.append(')').toString(); }
/** * @param c Column to take type definition from. * @return Type. */ public static GridSqlType fromColumn(Column c) { if (c.getName() != null) c = new Column(null, c.getType(), c.getPrecision(), c.getScale(), c.getDisplaySize()); return new GridSqlType(c.getType(), c.getScale(), c.getPrecision(), c.getDisplaySize(), c.getCreateSQL()); }