question: public void updateIsDelivered ( ) throws SQLException { String query = "SELECT COUNT(*) FROM C_OrderLine WHERE C_Order_ID=? and QtyOrdered > QtyDelivered " ; PreparedStatement ps = DB . prepareStatement ( query , get_TrxName ( ) ) ; ps . setInt ( 1 , get_ID ( ) ) ; ResultSet rs = ps . executeQuery ( ) ; if ( rs . next ( ) ) { int delta = rs . getInt ( 1 ) ; if ( delta == 0 ) { setIsDelivered ( true ) ; } else { setIsDelivered ( false ) ; } } rs . close ( ) ; ps . close ( ) ; }
target:  Checks if the order is fully delivered and if it is the IsDelivered flag will be updated.