CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Dec 2018
    Posts
    1

    Post Error doing a deleteorder method - java ee

    I need to do a deleteorder method, my idea is to compare all the books that the shop has with the books that are in the order, and then increase the quantity in the stock and remove the order.

    Code:
    public void deleteOrder(Customer customer, long idOrder){
        for (int i=0; i<=customer.getOrders().size(); i++){
            if(customer.getOrders().get(i).size()==idOrder){
                for(int j=0; j<=SessionMB.getBooks().size(); j++){ #here is the error  
    
    
    
    
    
    
    #### in sessionmb.java
    public List<Books> getBooks(){
        return listBooks.allBooks();
    
    #### in listbooks.java
    public List<Books> allBooks(){
        TypedQuery<Books> query=em.createQuery("SELECT m FROM books m", books.class);
        return query.getResultList();
    
    #### in other .java
    public void incStock(int quantity) {
        stock += quantity;
    
    }
    Last edited by Arjay; December 30th, 2018 at 01:54 PM. Reason: Fixed up closing code tag

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured