private void initIndices ( ResultSet edges ) { try { ResultSetMetaData metaData = edges . getMetaData ( ) ; for ( int i = 1 ; i <= metaData . getColumnCount ( ) ; i ++ ) { final String columnName = metaData . getColumnName ( i ) ; if ( columnName . equalsIgnoreCase ( START_NODE ) ) startNodeIndex = i ; if ( columnName . equalsIgnoreCase ( END_NODE ) ) endNodeIndex = i ; if ( columnName . equalsIgnoreCase ( EDGE_ID ) ) edgeIDIndex = i ; if ( columnName . equalsIgnoreCase ( edgeOrientationColumnName ) ) edgeOrientationIndex = i ; if ( columnName . equalsIgnoreCase ( weightColumn ) ) weightColumnIndex = i ; } } catch ( SQLException e ) { LOGGER . error ( "Problem accessing edge table metadata." , e ) ; } verifyIndex ( startNodeIndex , START_NODE ) ; verifyIndex ( endNodeIndex , END_NODE ) ; verifyIndex ( edgeIDIndex , EDGE_ID ) ; if ( ! globalOrientation . equals ( GraphFunctionParser . Orientation . UNDIRECTED ) ) { verifyIndex ( edgeOrientationIndex , edgeOrientationColumnName ) ; } if ( weightColumn != null ) { verifyIndex ( weightColumnIndex , weightColumn ) ; } }
Recovers the indices from the metadata .