public void visit(SqlObjectType sqlObjectType) { String targetTypeName = null; if (sqlObjectType.hasConversion()) { targetTypeName = sqlObjectType.getTargetTypeName(); } int numAttributes = 0; List<AttributeField> fields = null; try { fields = sqlObjectType.getDeclaredFields(false); numAttributes = fields.size(); } catch (Exception e) { } listener.beginObjectType(sqlObjectType.getName()); listener.handleObjectType(sqlObjectType.getName(), targetTypeName, numAttributes); if (fields != null && numAttributes > 0) { for (int idx = 0; idx < numAttributes; idx++) { AttributeField field = fields.get(idx); TypeClass typeClass = field.getType(); listener.handleAttributeField(field.getName(), idx); ((SqlType) typeClass).accept(this); } } try { listener.endObjectType(sqlObjectType.getName()); } catch (Exception e) { /* ignore */ } }
public void visit(PlsqlRecordType plsqlRecordType) { String targetTypeName = null; if (plsqlRecordType.hasConversion()) { targetTypeName = plsqlRecordType.getTargetTypeName(); } List<AttributeField> fields = null; int fieldsLength = 0; try { fields = plsqlRecordType.getFields(true); fieldsLength = fields.size(); } catch (Exception e) { /* ignore */ } listener.beginPlsqlRecord(plsqlRecordType.getTypeName(), targetTypeName, fieldsLength); if (fields != null && fieldsLength > 0) { for (int idx = 0; idx < fieldsLength; idx++) { AttributeField f = fields.get(idx); listener.beginPlsqlRecordField(f.getName(), idx); ((SqlType) f.getType()).accept(this); listener.endPlsqlRecordField(f.getName(), idx); } } try { listener.endPlsqlRecord( plsqlRecordType.getTypeName(), plsqlRecordType.getSqlTypeDecl(), plsqlRecordType.getSqlTypeDrop()); } catch (Exception e) { /* ignore */ } }