public int getClusterNodeIdType() { return dialect.getJDBCTypeAndString(ColumnType.CLUSTERNODE).jdbcType; }
int jdbcType; if (object instanceof String[]) { jdbcType = dialect.getJDBCTypeAndString(ColumnType.STRING).jdbcType; } else if (object instanceof Boolean[]) { jdbcType = dialect.getJDBCTypeAndString(ColumnType.BOOLEAN).jdbcType; } else if (object instanceof Long[]) { jdbcType = dialect.getJDBCTypeAndString(ColumnType.LONG).jdbcType; } else if (object instanceof Double[]) { jdbcType = dialect.getJDBCTypeAndString(ColumnType.DOUBLE).jdbcType; } else if (object instanceof java.sql.Date[]) { jdbcType = Types.DATE; jdbcType = Types.CLOB; } else if (object instanceof Calendar[]) { jdbcType = dialect.getJDBCTypeAndString(ColumnType.TIMESTAMP).jdbcType; object = dialect.getTimestampFromCalendar((Calendar[]) object); } else if (object instanceof Integer[]) { jdbcType = dialect.getJDBCTypeAndString(ColumnType.INTEGER).jdbcType; } else { jdbcType = dialect.getJDBCTypeAndString(ColumnType.CLOB).jdbcType;
@Override public void visitFunction(Function node) { String func = node.name.toUpperCase(); Reference ref = (Reference) node.args.get(0); ref.accept(this); // whatColumns / whatKeys for column // replace column info with aggregate Column col = whatColumns.removeLast(); String key = whatKeys.removeLast(); final String aggFQN = func + "(" + col.getFullQuotedName() + ")"; final ColumnType aggType = getAggregateType(func, col.getType()); final int aggJdbcType = dialect.getJDBCTypeAndString(aggType).jdbcType; Column cc = new Column(col, col.getTable()) { private static final long serialVersionUID = 1L; @Override public String getFullQuotedName() { return aggFQN; } @Override public ColumnType getType() { return aggType; } @Override public int getJdbcType() { return aggJdbcType; } }; whatColumns.add(cc); whatKeys.add(func + "(" + key + ")"); }
/** * Creates a new column with the given name and type. * * @param table the column's table * @param physicalName the column physical name * @param type the column's type * @param key the associated field name */ public Column(Table table, String physicalName, ColumnType type, String key) { this.table = table; dialect = table.getDialect(); this.physicalName = physicalName; this.type = type; JDBCInfo jdbcInfo = dialect.getJDBCTypeAndString(type); jdbcType = jdbcInfo.jdbcType; jdbcTypeString = jdbcInfo.string; jdbcBaseType = jdbcInfo.jdbcBaseType; jdbcBaseTypeString = jdbcInfo.jdbcBaseTypeString; this.key = key; quotedName = dialect.openQuote() + physicalName + dialect.closeQuote(); freeVariableSetter = dialect.getFreeVariableSetterForType(type); }