public static List<MRelationType> retrieveTypes(final PO po,final int windowId){
  if (po.get_KeyColumns().length != 1) {
    logger.severe(po + " has " + po.get_KeyColumns().length+ " key column(s). Should have one.");
    PORelationException.throwWrongKeyColumnCount(po);
  }
  final String keyColumn=po.get_KeyColumns()[0];
  final int colId=MColumn.getColumn_ID(po.get_TableName(),keyColumn);
  final PreparedStatement pstmt=DB.prepareStatement(SQL,po.get_TrxName());
  ResultSet rs=null;
  try {
    pstmt.setInt(1,po.get_Table_ID());
    pstmt.setInt(2,colId);
    rs=pstmt.executeQuery();
    final List<MRelationType> result=evalResultSet(po,windowId,rs);
    logger.info("There are " + result.size() + " matching types for "+ po);
    return result;
  }
 catch (  SQLException e) {
    logger.severe(e.getMessage());
    throw new AdempiereException(e);
  }
 finally {
    DB.close(rs,pstmt);
  }
}

public static List < MRelationType > retrieveTypes ( final PO po , final int windowId ) { if ( po . get_KeyColumns ( ) . length != 1 ) { logger . severe ( po + " has " + po . get_KeyColumns ( ) . length + " key column(s). Should have one." ) ; PORelationException . throwWrongKeyColumnCount ( po ) ; } final String keyColumn = po . get_KeyColumns ( ) [ 0 ] ; final int colId = MColumn . getColumn_ID ( po . get_TableName ( ) , keyColumn ) ; final PreparedStatement pstmt = DB . prepareStatement ( SQL , po . get_TrxName ( ) ) ; ResultSet rs = null ; try { pstmt . setInt ( 1 , po . get_Table_ID ( ) ) ; pstmt . setInt ( 2 , colId ) ; rs = pstmt . executeQuery ( ) ; final List < MRelationType > result = evalResultSet ( po , windowId , rs ) ; logger . info ( "There are " + result . size ( ) + " matching types for " + po ) ; return result ; } catch ( SQLException e ) { logger . severe ( e . getMessage ( ) ) ; throw new AdempiereException ( e ) ; } finally { DB . close ( rs , pstmt ) ; } }
returns the types that define a relation which contains the given po . explicit types are returned even if they don ' t actually contain the given po .
