public void parentImplotion(int PP_Product_BOMLine_ID) throws Exception {
  int PP_Product_BOM_ID=0;
  int M_Product_ID=0;
  X_T_BOMLine tboml=new X_T_BOMLine(ctx,0,null);
  PP_Product_BOM_ID=DB.getSQLValue(null,"SELECT PP_Product_BOM_ID FROM PP_Product_BOMLine WHERE PP_Product_BOMLine_ID=?",PP_Product_BOMLine_ID);
  if (PP_Product_BOM_ID < 0)   throw new Exception(CLogger.retrieveErrorString("Error: PrintBOM.parentImplotion()"));
  M_Product_ID=DB.getSQLValue(null,"SELECT M_Product_ID FROM PP_Product_BOM WHERE PP_Product_BOM_ID=?",PP_Product_BOM_ID);
  if (M_Product_ID < 0)   throw new Exception(CLogger.retrieveErrorString("Error: PrintBOM.parentImplotion()"));
  tboml.setPP_Product_BOM_ID(PP_Product_BOM_ID);
  tboml.setPP_Product_BOMLine_ID(PP_Product_BOMLine_ID);
  tboml.setM_Product_ID(M_Product_ID);
  tboml.setLevelNo(LevelNo);
  tboml.setSel_Product_ID(p_M_Product_ID);
  tboml.setImplosion(p_implosion);
  if (LevelNo >= 11)   tboml.setLevels(levels + ">" + LevelNo);
 else   if (LevelNo >= 1)   tboml.setLevels(levels.substring(0,LevelNo) + LevelNo);
  tboml.setSeqNo(SeqNo);
  tboml.setAD_PInstance_ID(AD_PInstance_ID);
  tboml.save();
  PreparedStatement stmt=null;
  ResultSet rs=null;
  String sql="SELECT PP_Product_BOM_ID, M_Product_ID FROM PP_Product_BOM " + "WHERE IsActive = 'Y' AND M_Product_ID = ? ";
  try {
    stmt=DB.prepareStatement(sql,get_TrxName());
    stmt.setInt(1,M_Product_ID);
    rs=stmt.executeQuery();
    while (rs.next()) {
      SeqNo+=1;
      component(rs.getInt(2));
    }
  }
 catch (  SQLException e) {
    log.log(Level.SEVERE,e.getLocalizedMessage() + sql,e);
    throw new Exception("SQLException: " + e.getLocalizedMessage());
  }
 finally {
    DB.close(rs,stmt);
    rs=null;
    stmt=null;
  }
}

public void parentImplotion ( int PP_Product_BOMLine_ID ) throws Exception { int PP_Product_BOM_ID = 0 ; int M_Product_ID = 0 ; X_T_BOMLine tboml = new X_T_BOMLine ( ctx , 0 , null ) ; PP_Product_BOM_ID = DB . getSQLValue ( null , "SELECT PP_Product_BOM_ID FROM PP_Product_BOMLine WHERE PP_Product_BOMLine_ID=?" , PP_Product_BOMLine_ID ) ; if ( PP_Product_BOM_ID < 0 ) throw new Exception ( CLogger . retrieveErrorString ( "Error: PrintBOM.parentImplotion()" ) ) ; M_Product_ID = DB . getSQLValue ( null , "SELECT M_Product_ID FROM PP_Product_BOM WHERE PP_Product_BOM_ID=?" , PP_Product_BOM_ID ) ; if ( M_Product_ID < 0 ) throw new Exception ( CLogger . retrieveErrorString ( "Error: PrintBOM.parentImplotion()" ) ) ; tboml . setPP_Product_BOM_ID ( PP_Product_BOM_ID ) ; tboml . setPP_Product_BOMLine_ID ( PP_Product_BOMLine_ID ) ; tboml . setM_Product_ID ( M_Product_ID ) ; tboml . setLevelNo ( LevelNo ) ; tboml . setSel_Product_ID ( p_M_Product_ID ) ; tboml . setImplosion ( p_implosion ) ; if ( LevelNo >= 11 ) tboml . setLevels ( levels + ">" + LevelNo ) ; else if ( LevelNo >= 1 ) tboml . setLevels ( levels . substring ( 0 , LevelNo ) + LevelNo ) ; tboml . setSeqNo ( SeqNo ) ; tboml . setAD_PInstance_ID ( AD_PInstance_ID ) ; tboml . save ( ) ; PreparedStatement stmt = null ; ResultSet rs = null ; String sql = "SELECT PP_Product_BOM_ID, M_Product_ID FROM PP_Product_BOM " + "WHERE IsActive = 'Y' AND M_Product_ID = ? " ; try { stmt = DB . prepareStatement ( sql , get_TrxName ( ) ) ; stmt . setInt ( 1 , M_Product_ID ) ; rs = stmt . executeQuery ( ) ; while ( rs . next ( ) ) { SeqNo += 1 ; component ( rs . getInt ( 2 ) ) ; } } catch ( SQLException e ) { log . log ( Level . SEVERE , e . getLocalizedMessage ( ) + sql , e ) ; throw new Exception ( "SQLException: " + e . getLocalizedMessage ( ) ) ; } finally { DB . close ( rs , stmt ) ; rs = null ; stmt = null ; } }
generate an implotion for this bom line
