(String uri, String localName, String qName, Attributes attributes)
| 389 | } |
| 390 | |
| 391 | @SuppressWarnings({ "unchecked" }) |
| 392 | @Override |
| 393 | public final void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { |
| 394 | if (debug) |
| 395 | if (log.isDebugEnabled()) |
| 396 | log.debug("> " + qName); |
| 397 | |
| 398 | if (s.writer != null) { |
| 399 | s.writer.startElement(uri, localName, qName, attributes); |
| 400 | } |
| 401 | else if (!s.inResult && "result".equalsIgnoreCase(qName)) { |
| 402 | s.inResult = true; |
| 403 | } |
| 404 | else if (s.inColumn && "result".equalsIgnoreCase(qName)) { |
| 405 | Field<?> f = s.row.field(s.column); |
| 406 | |
| 407 | if (isMultisetOrArrayOfRecords(f)) { |
| 408 | states.push(s); |
| 409 | s = new State<>(ctx, (AbstractRow<R>) f.getDataType().getRow(), (Class<R>) f.getDataType().getRecordType()); |
| 410 | s.inResult = true; |
| 411 | } |
| 412 | else |
| 413 | throw new UnsupportedOperationException("Nested result sets not supported yet"); |
| 414 | } |
| 415 | else if (s.inResult && "fields".equalsIgnoreCase(qName)) { |
| 416 | s.inFields = true; |
| 417 | } |
| 418 | else if (s.inResult && s.inFields && "field".equalsIgnoreCase(qName)) { |
| 419 | String catalog = attributes.getValue("catalog"); |
| 420 | String schema = attributes.getValue("schema"); |
| 421 | String table = attributes.getValue("table"); |
| 422 | String name = attributes.getValue("name"); |
| 423 | String type = attributes.getValue("type"); |
| 424 | |
| 425 | // [#13426] Don't use the dialect specific data type, because that isn't what's being exported, either. |
| 426 | s.fields.add(field(name(catalog, schema, table, name), getDataType(null, defaultIfBlank(type, "VARCHAR")))); |
| 427 | } |
| 428 | else if (s.inResult && "records".equalsIgnoreCase(qName)) {} |
| 429 | else if (s.inResult && "record".equalsIgnoreCase(qName)) { |
| 430 | s.inRecord++; |
| 431 | s.nilRecord = isNil(attributes); |
| 432 | |
| 433 | if (s.inColumn) { |
| 434 | Field<?> f = s.row.field(s.column); |
| 435 | |
| 436 | if (f.getDataType().isRecord()) { |
| 437 | states.push(s); |
| 438 | s = new State<>(ctx, (AbstractRow<R>) f.getDataType().getRow(), (Class<R>) f.getDataType().getRecordType()); |
| 439 | s.inResult = true; |
| 440 | } |
| 441 | else |
| 442 | throw new UnsupportedOperationException("Nested records not supported yet"); |
| 443 | } |
| 444 | } |
| 445 | else if (s.inColumn && "element".equalsIgnoreCase(qName) && s.elements != null) { |
| 446 | s.inElement = true; |
| 447 | } |
| 448 | else { |
no test coverage detected