EJB Annotations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 14: Line 14:
</pre>
</pre>


==mappedName()==
==mappedName==


The annotation has a "mappedName()" attribute. The specification designates it as vendor specific metadata. JBoss uses this metadata to specify the global JNDI name of the EJB. If mappedName() is specified, all other attributes (name, description, beanName, beanInterface, lookup) are ignored and this global JNDI name is used for binding.
The annotation has a "mappedName()" attribute. The specification designates it as vendor specific metadata. JBoss uses this metadata to specify the global JNDI name of the EJB. If mappedName() is specified, all other attributes (name, description, beanName, beanInterface, lookup) are ignored and this global JNDI name is used for binding.
<pre>
@EJB(mappedName = "/somehting/something")
private SimpleStateless bean;
</pre>


=@javax.annotation.Resource=
=@javax.annotation.Resource=

Revision as of 13:49, 24 March 2017

Internal

Overview

If an XML deployment descriptor containing the same semantics exists, the XML content overrides the annotation.

@javax.ejb.EJB

@EJB
private MyBusinessInterface myEjb;

mappedName

The annotation has a "mappedName()" attribute. The specification designates it as vendor specific metadata. JBoss uses this metadata to specify the global JNDI name of the EJB. If mappedName() is specified, all other attributes (name, description, beanName, beanInterface, lookup) are ignored and this global JNDI name is used for binding.

@EJB(mappedName = "/somehting/something")
private SimpleStateless bean;

@javax.annotation.Resource