@Deprecated public String getColumn() { if ( columns.size() == 0 ) { throw new IllegalArgumentException(); } return columns.get( 0 ).first.toString(); }
} else { stmt = conn.prepareStatement( sql, new String[] { autogenColumn.toString() } );
private void followJoins( List<TableJoin> joinedTables ) { if ( joinedTables != null ) { for ( TableJoin joinedTable : joinedTables ) { String fromTable = currentTable; String fromTableAlias = currentTableAlias; String toTable = joinedTable.getToTable().toString(); String toTableAlias = aliasManager.generateNew(); List<String> fromColumns = new ArrayList<String>( joinedTable.getFromColumns().size() ); for ( SQLIdentifier fromColumn : joinedTable.getFromColumns() ) { fromColumns.add( fromColumn.toString() ); } List<String> toColumns = new ArrayList<String>( joinedTable.getToColumns().size() ); for ( SQLIdentifier toColumn : joinedTable.getToColumns() ) { toColumns.add( toColumn.toString() ); } Join appliedJoin = new Join( fromTable, fromTableAlias, fromColumns, toTable, toTableAlias, toColumns ); joins.add( appliedJoin ); currentTable = toTable; currentTableAlias = toTableAlias; } } } }
writer.writeAttribute( "name", column.getFirst().toString() ); writer.writeAttribute( "type", column.getSecond().getXSTypeName() ); writer.writeEndElement();
private void map( FeatureMapping mapping, List<MappableStep> remaining ) throws UnmappableException { // followJoins( mapping.getJoinedTable() ); if ( remaining.size() < 2 ) { throw new UnmappableException( "Not enough steps." ); } MappableStep ftStep = remaining.get( 0 ); if ( !( ftStep instanceof ElementStep ) ) { throw new UnmappableException( "Must provide a feature type name." ); } QName ftName = ( (ElementStep) ftStep ).getNodeName(); FeatureTypeMapping ftMapping = schema.getFtMapping( ftName ); if ( ftMapping == null ) { throw new UnmappableException( "Feature type '" + ftName + " is not mapped to a table." ); } String fromTable = currentTable; String fromTableAlias = currentTableAlias; // TODO what do do with Href mappings here? Needs proper reference resolving code for mapping here... String fromColumn = mapping.getJoinedTable().get( 0 ).getFromColumns().get( 0 ).toString(); String toTable = ftMapping.getFtTable().toString(); String toTableAlias = aliasManager.generateNew(); String toColumn = ftMapping.getFidMapping().getColumn(); Join appliedJoin = new Join( fromTable, fromTableAlias, Collections.singletonList( fromColumn ), toTable, toTableAlias, Collections.singletonList( toColumn ) ); joins.add( appliedJoin ); currentTable = toTable; currentTableAlias = toTableAlias; map( ftMapping.getMappings(), remaining.subList( 1, remaining.size() ) ); }
jc = buildJoinTable( table, joinConfig ); DBField dbField = new DBField( jc.get( 0 ).getToTable().toString(), jc.get( 0 ).getToColumns().get( 0 ).toString() ); valueTable = new TableName( dbField.getTable(), dbField.getSchema() );