question: private void createMissingValues ( ) { String sql = "SELECT ra.A_RegistrationAttribute_ID " + "FROM A_RegistrationAttribute ra" + " LEFT OUTER JOIN A_RegistrationProduct rp ON (rp.A_RegistrationAttribute_ID=ra.A_RegistrationAttribute_ID)" + " LEFT OUTER JOIN A_Registration r ON (r.M_Product_ID=rp.M_Product_ID) " + "WHERE r.A_Registration_ID=?" + " AND NOT EXISTS (SELECT A_RegistrationAttribute_ID FROM A_RegistrationValue v " + "WHERE ra.A_RegistrationAttribute_ID=v.A_RegistrationAttribute_ID AND r.A_Registration_ID=v.A_Registration_ID)" ; PreparedStatement pstmt = null ; try { pstmt = DB . prepareStatement ( sql , get_TrxName ( ) ) ; pstmt . setInt ( 1 , getA_Registration_ID ( ) ) ; ResultSet rs = pstmt . executeQuery ( ) ; while ( rs . next ( ) ) { MRegistrationValue v = new MRegistrationValue ( this , rs . getInt ( 1 ) , "?" ) ; v . saveEx ( ) ; } rs . close ( ) ; pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { log . log ( Level . SEVERE , null , e ) ; } try { if ( pstmt != null ) pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { pstmt = null ; } }
target:  Create Missing Attribute Values