use of org.jkiss.dbeaver.model.struct.DBSDataType in project dbeaver by dbeaver.
the class ArrayAttributeTransformer method transformAttribute.
@Override
public void transformAttribute(@NotNull DBCSession session, @NotNull DBDAttributeBinding attribute, @NotNull List<Object[]> rows, @NotNull Map<String, Object> options) throws DBException {
if (!session.getDataSource().getContainer().getPreferenceStore().getBoolean(ModelPreferences.RESULT_TRANSFORM_COMPLEX_TYPES)) {
return;
}
DBSDataType collectionType;
if (attribute.getAttribute() instanceof DBSTypedObjectEx) {
collectionType = ((DBSTypedObjectEx) attribute.getAttribute()).getDataType();
} else {
collectionType = DBUtils.resolveDataType(session.getProgressMonitor(), session.getDataSource(), attribute.getTypeName());
}
if (collectionType != null) {
DBSDataType componentType = collectionType.getComponentType(session.getProgressMonitor());
if (componentType instanceof DBSEntity) {
ComplexTypeAttributeTransformer.createNestedTypeBindings(session, attribute, rows, (DBSEntity) componentType);
return;
}
}
// No component type found.
// Array items should be resolved in a lazy mode
MapAttributeTransformer.resolveMapsFromData(session, attribute, rows);
}
Aggregations