What is the difference between name, beanName and mappedName attributes for @EJB annotation?

What is the difference between name , beanName and mappedName for @EJB annotation in EJB3.0?
I found this on the web at the following link - http://www.tutorialspoint.com/ejb/ejb_annotations.htm

  • name - Used to specify the name that will be used to find the reference bean in the environment.
  • beanName - used to indicate the name of the reference bean.
  • mappedName - Used to indicate the JNDI name of the reference bean.

How is the name attribute and beanName different?

+5
source share
1 answer

@EJB declares an EJB link from your component to the target EJB. name is the link key in your component environment. There are several ways to specify the target EJB:

  • beanName (or <ejb-link> in XML) can be used to specify the target EJB if the EJB is in the same application as your component
  • mappedName is not a portable, vendor-specific string (even if it is part of the standard!) that somehow identifies the target.
  • In EJB 3.1, a lookup is a portable way to specify the target JNDI string.
  • Vendor-specific mechanisms, such as binding files.
  • If none of the other mechanisms are used, javadoc says that @EJB will target the EJB in the same application that implements the target type if there is only one.
+3
source

Source: https://habr.com/ru/post/1210026/


All Articles