EJB Annotations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 20: Line 20:
<pre>
<pre>
@EJB(mappedName = "/somehting/something")
@EJB(mappedName = "/somehting/something")
private SimpleStateless bean;
private MyBusinessInterface myEjb;
</pre>
</pre>


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

Revision as of 13:50, 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 MyBusinessInterface myEjb;

@javax.annotation.Resource