@Override public boolean equals( Object obj ) { if ( !( obj instanceof KeyPropagation ) ) { return false; } KeyPropagation that = (KeyPropagation) obj; if ( !this.source.equals( that.source ) || !this.target.equals( that.target ) ) { return false; } for ( int i = 0; i < pkColumns.size(); i++ ) { if ( !this.pkColumns.get( i ).equals( that.pkColumns.get( i ) ) ) { return false; } if ( !this.fkColumns.get( i ).equals( that.fkColumns.get( i ) ) ) { return false; } } return true; }
@Override public Object get( SQLIdentifier id ) { int idx = 0; for ( Pair<SQLIdentifier, BaseType> p : ftMapping.getFidMapping().getColumns() ) { if ( p.first.equals( id ) ) { // TODO need to use something other than string here? return idParts[idx]; } ++idx; } return null; } };
private String retrieveTypeOfPrimaryKey( TableName fromTable, SQLIdentifier toColumn, FIDMapping fidMapping ) { if ( fidMapping != null ) { for ( Pair<SQLIdentifier, BaseType> column : fidMapping.getColumns() ) { if ( toColumn.equals( column.getFirst() ) ) { return getDBType( column.getSecond() ); } } } // in joins not connected to the main feature type table 'integer' is used by default if ( !fromTable.equals( currentFtTable ) ) { return "integer"; } return "varchar(2000)"; }
private String retrieveTypeOfPrimaryKey( TableName fromTable, SQLIdentifier toColumn, FIDMapping fidMapping ) { if ( fidMapping != null ) { for ( Pair<SQLIdentifier, BaseType> column : fidMapping.getColumns() ) { if ( toColumn.equals( column.getFirst() ) ) { return getDBType( column.getSecond() ); } } } // TODO implement this correctly // in joins not connected to the main feature type table 'integer' is used by default if ( !fromTable.equals( currentFtTable ) ) { return "integer"; } return "varchar(2000)"; }
private String retrieveTypeOfPrimaryKey( TableName fromTable, SQLIdentifier toColumn, FIDMapping fidMapping ) { if ( fidMapping != null ) { for ( Pair<SQLIdentifier, BaseType> column : fidMapping.getColumns() ) { if ( toColumn.equals( column.getFirst() ) ) { return getDBType( column.getSecond() ); } } } // TODO implement this correctly // in joins not connected to the main feature type table 'integer' is used by default if ( !fromTable.equals( currentFtTable ) ) { return "integer"; } return "text"; }