Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-15987

RHT2522665: AD183: the snippet in the "find()" section is wrong

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • AD183 - EAP 7.0-en-3-20220331
    • AD183
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • en-US (English)

      Please fill in the following information:


      URL: https://rol.redhat.com/rol/app/courses/ad183-7.0/pages/ch04s03
      Reporter RHNID: wasim-rhls
      Section Title:            Persisting Data                                                            

      Issue description

      the snippet in the "find()" section is wrong

      @Stateless
      public class CustomerServices {
      ....
      public void getCustomer(Customer customer) {
      ...
      Customer customer;
      try{
      customer = entityManager.find(Customer.class,custId);
      if (customer != null)

      { System.out.print(customer.getCustName()); }

      else }
      System.out.print("Not Found");
      }
      }catch(Exception exception)

      { // code to handle PersistenceException }

      }
      }

      the input param on the method should be "Long custId"

      public void getCustomer(Long custId) {

      Steps to reproduce:

       

      Workaround:

       

      Expected result:

              gls-curriculum-ocp-adv@redhat.com PTL - AppDev Team
              wraja@redhat.com Wasim Raja
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: