private DefaultMutableTreeNode icomponent(int AD_Client_ID,int PP_Product_BOMLine_ID,int M_Product_ID,DefaultMutableTreeNode bom){
  final String sql="SELECT pbom.M_Product_ID , pbom.Value , pbom.PP_Product_BOM_ID FROM  PP_Product_BOMLine pboml" + " INNER JOIN PP_Product_BOM pbom ON (pbom.PP_Product_BOM_ID = pboml.PP_Product_BOM_ID)" + " WHERE pbom.IsActive=? AND pboml.IsActive=? AND pboml.AD_Client_ID=? AND pboml.PP_Product_BOMLine_ID=? ";
  PreparedStatement pstmt=null;
  ResultSet rs=null;
  try {
    pstmt=DB.prepareStatement(sql,m_trxName);
    DB.setParameters(pstmt,new Object[]{true,true,AD_Client_ID,PP_Product_BOMLine_ID});
    rs=pstmt.executeQuery();
    while (rs.next()) {
      if (M_Product_ID != rs.getInt(1)) {
        if (!tableproduct(rs.getInt(1),rs.getInt(3))) {
          bom.add(iparent(AD_Client_ID,rs.getInt(1),rs.getInt(3)));
        }
 else {
          throw new AdempiereException("Cycle BOM & Formula:" + rs.getString(2) + "("+ rs.getString(3)+ ")");
        }
      }
 else {
        MProduct product=MProduct.get(m_ctx,M_Product_ID);
        throw new AdempiereException("Cycle BOM & Formula:" + rs.getString(2) + "("+ rs.getString(3)+ ")"+ " - Component: "+ product.getValue()+ "("+ product.getM_Product_ID()+ ")");
      }
    }
  }
 catch (  SQLException e) {
    throw new DBException(e,sql);
  }
 finally {
    DB.close(rs,pstmt);
    rs=null;
    pstmt=null;
  }
  return null;
}

private DefaultMutableTreeNode icomponent ( int AD_Client_ID , int PP_Product_BOMLine_ID , int M_Product_ID , DefaultMutableTreeNode bom ) { final String sql = "SELECT pbom.M_Product_ID , pbom.Value , pbom.PP_Product_BOM_ID FROM  PP_Product_BOMLine pboml" + " INNER JOIN PP_Product_BOM pbom ON (pbom.PP_Product_BOM_ID = pboml.PP_Product_BOM_ID)" + " WHERE pbom.IsActive=? AND pboml.IsActive=? AND pboml.AD_Client_ID=? AND pboml.PP_Product_BOMLine_ID=? " ; PreparedStatement pstmt = null ; ResultSet rs = null ; try { pstmt = DB . prepareStatement ( sql , m_trxName ) ; DB . setParameters ( pstmt , new Object [ ] { true , true , AD_Client_ID , PP_Product_BOMLine_ID } ) ; rs = pstmt . executeQuery ( ) ; while ( rs . next ( ) ) { if ( M_Product_ID != rs . getInt ( 1 ) ) { if ( ! tableproduct ( rs . getInt ( 1 ) , rs . getInt ( 3 ) ) ) { bom . add ( iparent ( AD_Client_ID , rs . getInt ( 1 ) , rs . getInt ( 3 ) ) ) ; } else { throw new AdempiereException ( "Cycle BOM & Formula:" + rs . getString ( 2 ) + "(" + rs . getString ( 3 ) + ")" ) ; } } else { MProduct product = MProduct . get ( m_ctx , M_Product_ID ) ; throw new AdempiereException ( "Cycle BOM & Formula:" + rs . getString ( 2 ) + "(" + rs . getString ( 3 ) + ")" + " - Component: " + product . getValue ( ) + "(" + product . getM_Product_ID ( ) + ")" ) ; } } } catch ( SQLException e ) { throw new DBException ( e , sql ) ; } finally { DB . close ( rs , pstmt ) ; rs = null ; pstmt = null ; } return null ; }
get an implotion the product
