break;
case PROCEDUREPARAMS:
for (Schema schema : getVisibleSchemas(vdb, metadata)) {
for (Procedure proc : schema.getProcedures().values()) {
for (ProcedureParameter param : proc.getParameters()) {
Datatype dt = param.getDatatype();
rows.add(Arrays.asList(vdbName, proc.getParent().getName(), proc.getName(), param.getName(), dt!=null?dt.getRuntimeTypeName():null, param.getPosition(), param.getType().toString(), param.isOptional(),
param.getPrecision(), param.getLength(), param.getScale(), param.getRadix(), param.getNullType().toString(), param.getUUID(), param.getAnnotation(), oid++));
}
if (proc.getResultSet() != null) {
for (Column param : proc.getResultSet().getColumns()) {
Datatype dt = param.getDatatype();
rows.add(Arrays.asList(vdbName, proc.getParent().getName(), proc.getName(), param.getName(), dt!=null?dt.getRuntimeTypeName():null, param.getPosition(), "ResultSet", false, //$NON-NLS-1$
param.getPrecision(), param.getLength(), param.getScale(), param.getRadix(), param.getNullType().toString(), param.getUUID(), param.getAnnotation(), oid++));
}
}
}
}
break;
case PROPERTIES: //TODO: consider storing separately in the metadatastore
Collection<AbstractMetadataRecord> records = getAllPropertiedObjects(metadata, getVisibleSchemas(vdb, metadata));
for (AbstractMetadataRecord record : records) {
for (Map.Entry<String, String> entry : record.getProperties().entrySet()) {
String value = entry.getValue();
Clob clobValue = null;
if (value != null) {
try {
clobValue = new ClobType(new SerialClob(value.toCharArray()));
} catch (SQLException e) {
throw new TeiidProcessingException(e);
}
}
rows.add(Arrays.asList(entry.getKey(), entry.getValue(), record.getUUID(), oid++, clobValue));
}
}
break;
default:
for (Schema schema : getVisibleSchemas(vdb, metadata)) {
for (Table table : schema.getTables().values()) {
switch (sysTable) {
case TABLES:
rows.add(Arrays.asList(vdbName, schema.getName(), table.getName(), table.getTableType().toString(), table.getNameInSource(),
table.isPhysical(), table.supportsUpdate(), table.getUUID(), table.getCardinality(), table.getAnnotation(), table.isSystem(), table.isMaterialized(), oid++));
break;
case COLUMNS:
for (Column column : table.getColumns()) {
Datatype dt = column.getDatatype();
rows.add(Arrays.asList(vdbName, schema.getName(), table.getName(), column.getName(), column.getPosition(), column.getNameInSource(),
dt!=null?dt.getRuntimeTypeName():null, column.getScale(), column.getLength(), column.isFixedLength(), column.isSelectable(), column.isUpdatable(),
column.isCaseSensitive(), column.isSigned(), column.isCurrency(), column.isAutoIncremented(), column.getNullType().toString(), column.getMinimumValue(),
column.getMaximumValue(), column.getDistinctValues(), column.getNullValues(), column.getSearchType().toString(), column.getFormat(),
column.getDefaultValue(), dt!=null?dt.getJavaClassName():null, column.getPrecision(),
column.getCharOctetLength(), column.getRadix(), column.getUUID(), column.getAnnotation(), oid++));
}
break;
case KEYS:
for (KeyRecord key : table.getAllKeys()) {