2 Replies Latest reply on Nov 18, 2002 10:55 PM by eric138

    ejbSelect and findBy method

    eric138

      Hello,


      Would you please to tell me when should use ejbSelect and findBy in EJB ?


      Best regards,
      Eric

        • 1. Re: ejbSelect and findBy method

          ejbFindBy returns primary key(s) of the
          entity bean. It is the implementation of findBy
          in the home interface and can be used by clients
          to obtain bean proxies. The container turns the
          primary keys into remote/local interface implementations.

          e.g.

          MyRemote bean = home.findByNickName("eric138");

          ejbSelect can return any type of bean
          (not necessarily the same entity where it is defined)
          or cmp-field. The entity uses it internally.

          e.g.

          Collection emails = bean.getEmails(Date date);

          // Get the user's e-mails for a date
          public Collection getEmails(Date date)
          {
          return ejbSelectEmails(date);
          }

          Regards,
          Adrian

          • 2. Re: ejbSelect and findBy method
            eric138

            Thanks.