@ejb Class Level Tag Usage

@ejb.bean (0..1)

The ejb.bean tag provides information about the EJB. It is the one compulsory tag for all EJBs, however not all parameters are applicable for all types of beans, and some parameters apply differently for different types of beans.

Applies to: Applicable for all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
nametext Provides the name of the bean that will be used in the ejb-jar.xml deployment descriptor. true
descriptiontext A description of the bean. Defaults to the first sentence of the class-level javadoc comment of the bean class. false
display-nametextThe display name of the bean.false
small-icontextThe small icon for the bean.false
large-icontextThe large icon for the bean.false
generatebool Set it to "false" if you want the class be excluded from list of EJBs. This is useful for abstract EJBs that other EJBs are to derive from. So you obviously do not want the abstract EJB be wrongly specified in deployment descriptors as a concrete EJB.

Default value(s):

true
false
jndi-nametextRemote Session and Entity beans. Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. false
local-jndi-nametextLocal Session and Entity beans, EJB 2.0 Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. It's the JNDI name for the local EJB. false
view-typetextSession and Entity beans, EJB 2.0+ Indicates what view-type(s) is(are) supported by the bean. The types "all", "remote-service-endpoint", "local-service-endpoint" and "service-endpoint" are only applicable to EJB2.1 session beans.
Valid options are:

local

remote

both

service-endpoint

local-service-endpoint

remote-service-endpoint

all

Default value(s):

"remote" for EJB 1.1 or "both" for EJB 2.0+
false
typetextSession and Entity beans Defines the bean's "type".
Valid options are:

CMP

BMP

Stateless

Stateful

Default value(s):

CMP (for javax.ejb.EntityBean)

Stateless (for javax.ejb.SessionBean)
true
transaction-typetextSession and Message-driven beans. Defines the bean's transaction type.
Valid options are:

Container

Bean

Default value(s):

Container
false
reentrantboolEntity beans Defines the entity bean's reentrancy.

Default value(s):

true
false
cmp-versiontextEntity beans, EJB 2.0 Defines the version of the spec the bean is for CMP.
Valid options are:

1.x

2.x

Default value(s):

1.x
false
schematextEntity beans, EJB 2.0 Defines the abstract schema name for the bean. false
primkey-fieldtextEntity beans. Defines the primary key field for the bean as per spec. false
use-soft-lockingboolEntity beans If true, then generate a public int version attribute in the auto-generated concrete class, to form a optimistic locking mechanism. The value of version attribute is incremented in ejbStore. Note: It's applicable to both CMP and BMP, but many containers have optimistic locking capabilities built-in, so you don't need to worry about it locking issues.

Default value(s):

false
false
message-selectortextMessage-driven beans Defines an optional message selector for MDB. false
acknowledge-modetextMessage-driven beans. Defines the acknowledge mode for MDB.
Valid options are:

Auto-acknowledge

Dups-ok-acknowledge

Default value(s):

Auto-acknowledge
false
destination-typetextMessage-driven beans. Defines the type of destination for MDB.
Valid options are:

javax.jms.Queue

javax.jms.Topic

Default value(s):

javax.jms.Queue
false
subscription-durabilitytextMessage-driven beans. Defines the durability of messages for MDB as per EJB 2.0 spec.
Valid options are:

Durable

NonDurable

Default value(s):

Durable
false
destination-jndi-nametextMessage-driven beans Defines the jndi name of the destination queue/topic. false
connection-factory-jndi-nametextMessage-driven beans Defines the jndi name of the JMS connection factory. false
remote-business-interfacetextSession and Entity beans Defines the remote business interface for the bean. If present, ejb.interface-method tags are not required, instead the remote interface will extend the business interface. The business interface must declare all methods as throwing RemoteException as per the business interface pattern. false
local-business-interfacetextSession and Entity beans Defines the local business interface for the bean. Similar to remote-business-interface, but the interface does not need to declare RemoteException in the throws clause. false
impl-class-nametextAll EJB Types. Provides the fully qualified classname of the bean's implementation class, to be used in the ejb-class element of the ejb-jar.xml deployment descriptor. Its value is only used when the implementation class is not being generated by a subtask (e.g. <session/>, <entitycmp/>, ...) as those subtasks have other ways to determine the classname. This parameter is mainly intended to be used where the bean class itself is generated, and additional code is to be added in a subclass. false
service-endpoint-business-interfacetextSession beans Defines the service-endpoint business interface for the bean. Similar to remote-business-interface. false

@ejb.dao (0..1)

Defines the data access object of an entity bean. If the <dao/> subtask is included, then DAO interfaces will be generated for any entity beans containing this tag, unless a generate="false" parameter is present.

Applies to: Entity bean

ParameterTypeApplicabilityDescriptionMandatory
classtext The fully qualified name of the DAO interface. If absent the interface name will be determined using the pattern and package parameters. false
patterntext Define the pattern (using {0} for the EJB name) to be used for constructing the unqualified (package specific) name of the DAO interface. false
packagetext Define the package the DAO interface is in (generated or not). Use <packageSubstitution/> to configure which package the interface should end up in. false
generatebool Indicate if the DAO interface should be generated.

Default value(s):

true
false
impl-classtext The fully qualified name of a class which implements the DAO interface. If present, then generated code for obtaining a DAO will just create a new instance of this class. false
impl-jnditext Indicates a JNDI environment reference which will contain a String that is the fully qualified name of a class implementing the DAO interface. If present, then generated code for obtaining a DAO will look up this reference, then create a new instance of the class whose name is found there. This allows the actual implementation class to be determined at runtime. false
create-methodstext Indicate if create methods should be automatically included in the DAO interface.

Default value(s):

true
false
finder-methodstext Indicate if finder methods should be automatically included in the DAO interface.

Default value(s):

true
false

@ejb.data-object (0..1)

Defines configuration attributes used for data object generation.

Applies to: Applicable only for Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
extendstext Declare which class the generated bulk data class should extend. The class must be java.io.Serializable. This is useful if you want to add some methods that should always be available in bulk data objects.

Default value(s):

java.lang.Object
false

@ejb.ejb-external-ref (0..*)

Defines an EJB reference to a bean which will be packaged in a different ejb jar file.

Applies to: Applicable to all types of EJBs.

ParameterTypeApplicabilityDescriptionMandatory
view-typetext The view type of the referenced bean.
Valid options are:

local

remote
true
linktext Defines an ejb-link to the referenced EJB. The value of the ejb-link element is the name of the target enterprise bean. (It is the name defined in the ejb-name element of the target enterprise bean.) The target enterprise bean can be in any ejb-jar file in the same J2EE application as the referencing application component. false
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer.

Default value(s):

ejb/[ejb-name], where [ejb-name] is the name of the referenced bean.
true
ejb-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer. Deprecated. Use ref-name instead.

Default value(s):

ejb/[ejb-name], where [ejb-name] is the name of the referenced bean.
false
typetextThe type of EJB being referenced.
Valid options are:

Entity

Session

Default value(s):

Entity
true
hometext The fully qualified class name of the home interface of the referenced bean. false
businesstext The fully qualified class name of the business interface (local or remote interface) of the referenced bean. true
remotetext (Deprecated). Synonym for 'business' parameter. Only works if the view-type is 'remote'. false

@ejb.ejb-ref (0..*)

Defines an EJB-reference to the bean with EJB-name [ejb-name]. ref-name is optional and if not specified then the reference name is [ejb-name] prefixed by "ejb/". Attention: you have to import the referred class (the ejbdoclet one) even your EJB does not need it.

ParameterTypeApplicabilityDescriptionMandatory
ejb-nametextThe name of the EJB being referenced.true
view-typetextThe view type that the reference uses.
Valid options are:

local

remote

Default value(s):

remote
true
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer.

Default value(s):

ejb/[ejb-name], where [ejb-name] is the name of the referenced bean.
false

@ejb.env-entry (0..*)

Defines an environment entry for an EJB.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
nametextThe name of the env-entry.true
descriptiontextOptional description of the env-entry.false
typetext The type of the env-entry, eg java.lang.String. Supported types outlined in the EJB spec.
Valid options are:

java.lang.Boolean

java.lang.Byte

java.lang.Character

java.lang.String

java.lang.Short

java.lang.Integer

java.lang.Long

java.lang.Float

java.lang.Double

Default value(s):

java.lang.String
false
valuetextThe value of the env-entry.false

@ejb.facade (0..1)

This tag is optional and allows generation of session facade EJB for entity bean. Facade EJB will provide all finder and creation methods to outside, and also all data setting methods for data and value objects. Finder methods will return collections of data or value objects instead of remote interfaces. Facade bean will connect to EJB using local (if generated) or remote interfaces. Resulting bean needs processing by XDoclet together with all EJB classes.

Applies to: Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
nametext Name of generated facade EJB.

Default value(s):

{0}Facade
false
descriptiontext A description of the bean. Defaults to the first sentence of the class-level javadoc comment of the bean class. false
display-nametextThe display name of the bean.false
small-icontextThe small icon for the bean.false
large-icontextThe large icon for the bean.false
jndi-nametextRemote Session and Entity beans Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. false
local-jndi-nametext Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. It's the JNDI name for the local EJB. false
view-typetext Indicates what view-type(s) is(are) supported by the bean.
Valid options are:

local

remote

both

Default value(s):

remote
false
typetext Defines the bean's "type".
Valid options are:

Stateless

Stateful

Default value(s):

Stateless
true
transaction-typetext Defines the bean's transaction type.
Valid options are:

Container

Bean

Default value(s):

Container
false

@ejb.finder (0..*)

Defines a finder method for the home interface. An entity bean may have zero or more ejb.finder tags.

Applies to: Applicable only to Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
view-typetext To restrict the home interface in which the finder will be defined.
Valid options are:

local

remote

both

Default value(s):

both
false
descriptiontextDescription of the finder.false
signaturetext Defines the signature of the method. E.g.. "java.util.Collection findAll()". The return type in the signature must be fully qualified. true
uncheckedboolEntity beans, EJB 2.0 Flags the finder as having unchecked permission. If present, role-name must be omitted.

Default value(s):

true
false
role-nametext A comma-separated list of roles that can invoke this finder method. false
querytextEntity beans, EJB 2.0 EJB-QL query for the finder. false
result-type-mappingtextEntity beans, EJB 2.0 Result type mapping (indicates the return type) for the finder method.
Valid options are:

none

Local

Remote

Default value(s):

none
false
transaction-typetext Indicates the transaction type attribute sets to the method. false
method-intftext Indicates the interface (Home or LocalHome) for which the finder permissions should be set. If the permissions should apply to both Home or LocalHome interfaces, this parameter should not be specified.
Valid options are:

Home

LocalHome

Default value(s):

Home
false

@ejb.home (0..1)

The @ejb.home tag provides information about an Entity or Session Bean's home interface. All parameters are applicable to both Entity and Session beans.

Applies to: Applicable to Entity and Session beans.

ParameterTypeApplicabilityDescriptionMandatory
extendstext Declare which interface the generated home interface should extend.

Default value(s):

javax.ejb.EJBHome
false
local-extendstextSession and Entity beans, EJB 2.0 Declare which interface the generated local home interface should extend.

Default value(s):

javax.ejb.EJBLocalHome
false
generatetext Which home interfaces should be generated.
Valid options are:

local

remote

Default value(s):

local,remote
false
remote-classtext The fully qualified name of the remote home interface. false
local-classtextSession and Entity beans, EJB 2.0 The fully qualified name of the local home interface. false
remote-patterntext The pattern to be used in determining the unqualified name of the remote home interface - only used if remote-class is not present. false
local-patterntextSession and Entity beans, EJB 2.0 The pattern to be used in determining the unqualified name of the local home interface - only used if local-class is not present. false
patterntext The pattern to be used in determining the unqualified name of either local or remote home interfaces. Used where -class and -pattern tags are absent for the bean. false
remote-packagetext The package the remote home interface should be in - only used where remote-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
local-packagetext The package the local home interface should be in - only used where local-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
packagetext The package the home interfaces to be placed in - only used where -class or -package is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false

@ejb.interface (0..1)

The @ejb.interface tag provides information about an Entity or Session Bean's component interfaces (remote and/or local and/or service-endpoint). It is not applicable to Message-driven beans. The view-type "service-endpoint" is restricted to EJB2.1 Session beans. All parameters are applicable to both Entity and Session beans.

Applies to: Applicable to both Entity and Session beans.

ParameterTypeApplicabilityDescriptionMandatory
extendstext Declare which interface the generated remote interface should extend.

Default value(s):

javax.ejb.EJBObject
false
local-extendstextSession and Entity beans, EJB 2.0 Declare which interface the generated local interface should extend.

Default value(s):

javax.ejb.EJBLocalObject
false
service-endpoint-extendstext Declare which interface the generated service-endpoint interface should extend. Default is "java.rmi.Remote".

Default value(s):

java.rmi.Remote
false
generatetext Which interfaces should be generated. Defaults to true.
Valid options are:

local

remote

service-endpoint

Default value(s):

local,remote
false
remote-classtext The fully qualified name of the remote interface. false
local-classtextSession and Entity beans, EJB 2.0 The fully qualified name of the local interface. false
service-endpoint-classtextSession beans, EJB 2.1 The fully qualified name of the service endpoint interface. false
remote-patterntext The pattern to be used in determining the unqualified name of the remote interface - only used if remote-class is not present. false
local-patterntextSession and Entity beans, EJB 2.0 The pattern to be used in determining the unqualified name of the local interface - only used if local-class is not present. false
service-endpoint-patterntextSession beans, EJB 2.1 The pattern to be used in determining the unqualified name of the service-endpoint interface - only used if service-endpoint-class is not present. false
patterntext The pattern to be used in determining the unqualified name of either local or remote interfaces. Used where -class and -pattern tags are absent for the bean. false
remote-packagetext The package the remote interface should be in - only used where remote-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
local-packagetextSession and Entity beans, EJB 2.0 The package the local interface should be in - only used where local-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
service-endpoint-packagetextSession beans, EJB 2.1 The package the service-endpoint interface should be in - only used where service-endpoint-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
packagetext The package for the interfaces to be placed in. Only used where -class and -package are not present. Use <packageSubstitution/> to configure which package the interface should end up in. false

@ejb.persistence (0..1)

The @ejb.persistence tag provides information about the persistence of a CMP Entity bean.

Applies to: CMP entity bean

ParameterTypeApplicabilityDescriptionMandatory
table-nametext Declare the table to which the CMP will be mapped. If table-name is not specified, the name of the class will be used, and it will be up to the container to create the tables. false
read-onlybool Configures a bean as read-only. Many app servers can optimise access to such beans (e.g. better caching, bypassing checks for changes, etc.) false

@ejb.pk (0..1)

Defines the primary key of an entity bean. If the <entitypk/> subtask is included, then primary key classes will be generated for all entity beans unless a generate="false" parameter is present, or the primary class is in the java.lang package.

Applies to: Entity beans

ParameterTypeApplicabilityDescriptionMandatory
classtext The fully qualified name of the primary key class. If absent the primary key class name will be determined using the pattern and package parameters. false
patterntext Define the pattern (using {0} for the EJB name) to be used for constructing the unqualified (package specific) name of the primary key class. false
packagetext Define the package the pk class is in (generated or not). Use <packageSubstitution/> to configure which package the PK class should end up in. false
generatebool Indicate if the primary key class should be generated. Defaults to true.

Default value(s):

true
false
extendstext Define which class the generated pk must extend. false
implementstext Define which interface the generated pk must implement. false
role-nametext A comma-separated list of roles that can execute findByPrimaryKey. false
uncheckedboolEntity beans, EJB 2.0 Flags the PK-finder as having unchecked permission. If present, role-name must be omitted.

Default value(s):

true
false
method-intftext Indicates the interface (Home or LocalHome) for which the findByPrimaryKey permissions should be set. Applies only if role-name or unchecked is specified. If the permissions should apply to both Home or LocalHome interfaces, this parameter should not be specified.
Valid options are:

Home

LocalHome

Default value(s):

Home
false

@ejb.remote-facade (0..1)

Generate remote facade class for entity beans. This class will provide convenient view on session bean and perform all the necessary lookups. Session Bean methods marked with @ejb.facade-method will be included and transparently proxied. Generated class name will follow pattern: {0}Remote

Applies to: Session beans.

@ejb.resource-env-ref (0..*)

Defines a resource environment reference with the name name to a resource of type type.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
nametextThe name of the resource.true
typetextThe type of the resource.true

@ejb.resource-ref (0..*)

Defines a resource reference with the name res-ref-name to a resource of type res-type, and the authentication is done by the one specified in res-auth.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
res-ref-nametextThe name of the environment entry used in the enterprise bean's code.true
res-typetextThe resource type.true
res-authtextThe resource authentication type.
Valid options are:

Container

Application

Default value(s):

Container
true
res-sharing-scopetextThe resource sharing scope
Valid options are:

Shareable

Unshareable

Default value(s):

Shareable
false
jndi-nametext The physical jndi-name of the resource. Note: it currently is used only in 1-2 of the app server modules, but those modules will also support this consolidated standard tag soon. false

@ejb.security-identity (0..1)

The security-identity element specifies whether the caller's security identity is to be used for the execution of the methods of the enterprise bean or whether a specific run-as identity is to be used. It contains an optional description and a specification of the security identity to be used.

Applies to: Session, Entity and Message Driven beans, EJB 2.0

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextThe description of the security identity.false
use-caller-identitybool The use-caller-identity element specifies that the caller's security identity be used as the security identity for the execution of the enterprise bean's methods.

Default value(s):

false
false
run-astext The run-as element specifies the run-as identity to be used for the execution of the methods of an enterprise bean. It contains the name of a security role. false

@ejb.security-role-ref (0..*)

Defines a security role reference with the name role-name to a security role link named role-link.

Applies to: Applicable to Entity and Session beans.

ParameterTypeApplicabilityDescriptionMandatory
role-nametextThe name of the role referencetrue
role-linktextThe name of the role link.true

@ejb.security-roles (0..1)

List additional security roles that are not yet listes by method level @ejb.permission role-name tags. This is useful in conjunction with the @ejb.security-role-ref tag.

ParameterTypeApplicabilityDescriptionMandatory
role-namestextComma separated list of rolestrue

@ejb.util (0..1)

This tag is optional, and lets you define whether or not a util class should be generated, and whether to use the logical component name (java:comp/env) or the physical JNDI name to do the lookup. If this tag is not specified, the util class will be generated using logical lookups (provided the <utilobject/> subtask is used)

Applies to: Applies to Entity Beans and Session Beans

ParameterTypeApplicabilityDescriptionMandatory
generatetext false or no will omit the generation of the util class. logical will generate a util class that uses the component name for lookup, and physical will generate a class that uses the JNDI name for lookups. Default is logical.
Valid options are:

false

no

logical

physical

Default value(s):

logical
true

@ejb.value-object (0..*)

Definition for ValueObjects that follow the TransferObject pattern from http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html. ValueObjects can 'link' to other objects (of a relation) in two ways: aggregation and composition. Aggregation means that the other object is loosely coupled, while in Composition, the other object is 'embedded'. Note that aggregation and composition are mutually exclusive. See also http://xdoclet.sourceforge.net/xdoclet/valueobjects.html for more info.

Applies to: entity beans

ParameterTypeApplicabilityDescriptionMandatory
nametext The name for this value object. The name will be used to form the generated class name. Using the default pattern, for example, if name is 'User', an 'UserValue' class will be generated. false
matchtext An identifier that can be used to select groups of attributes to be included in this value object. You can repeat this identifier in the method-level @ejb.value-object tag to add a property to a value object. You can use '*' as an special value, indicating that all entity properties will be included in this value object. false
extendstext The name of the class the generated value object class should extend, if any. false
implementstext A comma-separated list of interfaces the generated value object should implements, if any. Please note that XDoclet won't generate methods to implement these interfaces, so use this only if the interfaces doesn't contains any methods, or if the value object superclass (indicated in the 'extends' parameter) already implements all interface methods. false
abstractbool Set if this value object is intended to be an abstract object which other value objects extend. false
generatePKConstructorbool Set if this value object should have a single argument constructor that sets the PK only. It's useful when using aggregation and you want to create a relationship between a new object and an existing object with the form of obj.addSomeObjectRelation(new SomeObject(pk)); false

@ejb Method Level Tag Usage

@dao.call (0..1)

The method is a call to a data access object; the method will be included in the DAO interface, and the EJB's generated subclass will contain a call to the DAO's method.

Applies to: Entity beans

ParameterTypeApplicabilityDescriptionMandatory
nametext Optionally specify the method's name in the DAO (it need not be the same as the calling method in the EJB). If not specified, the default is the usual interface equivalent of the method's name (i.e. generally the same, but ejbFindByX becomes findByX etc.) false

@ejb.aggregate (0..1)

Mark a persistent field containing a reference to another entity bean as being aggregated in this bean. The data object will contain accessor methods for the aggregated entity's data object instead of a reference to the entity itself. The aggregated entity will also be removed when this entity is removed. For example, aggregates are useful for sending graphs of data to the client. This is only applicable to entity beans and has no parameters.

Applies to: Entity bean methods

@ejb.create-method (0..*)

The method is an ejbCreate method and will be included in the home interface. It is applicable to Session and Entity beans. In Stateless Session beans the ejbCreate will be created if it is not in the code.

Applies to: Applicable to session and entity beans. Method has to be called ejbCreate

ParameterTypeApplicabilityDescriptionMandatory
view-typetext Optionally specify which view-type the method will be exposed in.
Valid options are:

local

remote

Default value(s):

remote
false

@ejb.facade-method (0..1)

Marks session bean method for inclusion in remote facade.

Applies to: Interface methods of session bean.

ParameterTypeApplicabilityDescriptionMandatory
invalidatebool Mark this method as invalidating. Remote Facade will fire callbacks and zap caches. Use on methods which change ejb or create/remove entities. NOTE: setting this to true will have no effect for facade methods which cache their result.

Default value(s):

false
false
cachebool Setup result caching for this method result. No effect on void methods.

Default value(s):

false
false
immutablebool If value is immutable it will be never invalidated. No effect on void methods.

Default value(s):

false
false

@ejb.home-method (0..1)

Define this method as a home method (e.g. its name is "ejbHomefoo", and the corresponding home method should be defined in the home interface).

Applies to: Session and Entity beans, EJB 2.0

ParameterTypeApplicabilityDescriptionMandatory
view-typetext Optionally specify which view-type the method will be exposed in.
Valid options are:

local

remote

Default value(s):

local
false

@ejb.interface-method (0..1)

Declare in which interface (local/remote) this method must appear. If the view-type parameter is absent then the method will be added to whatever component interfaces are defined in @ejb.bean.

ParameterTypeApplicabilityDescriptionMandatory
view-typetext Optionally specify which view-type the method will be exposed in. The value "local" or "both" is only applicable to EJB 2.0 beans. The values "service-endpoint", "local-service-endpoint", "remote-service-endpoint", and "all" are only applicable to EJB 2.1 beans.
Valid options are:

local

remote

both

service-endpoint

remote-service-endpoint

local-service-endpoint

all

Default value(s):

remote
false

@ejb.permission (0..1)

Defines the transactional behaviour for this method. Applicable to methods with @ejb.create-method and @ejb.interface-method tags. When used on class level applies to all interface methods cumulatively.

Applies to: Session and Entity beans

ParameterTypeApplicabilityDescriptionMandatory
role-nametext Comma-separated list of roles allowed to call this method false
uncheckedboolEntity beans, EJB 2.0 Flags the method as having unchecked permission. If present, role-name must be omitted

Default value(s):

true
false

@ejb.persistence (0..1)

The @ejb.persistence tag provides information about the persistence of a CMP Entity bean's fields. Use this for methods with the following patterns: public abstract Foo getX(); public abstract boolean isX(); public abstract void setX(Foo newVal); This will create the CMP field "X" in the generated CMP layer of type "Foo", and concrete implementations of the getX/setX methods. For BMP, it will generate getX/setX methods that keep track of a dirty flag (so that ejbStore is only called if necessary). If the type is boolean it is ok to have the get method prefixed "is" instead of "get". If you don't define the setter method, no setter method is generated for the concrete BMP/CMP class (concrete CMP class is generated only if EJB 1.1 or EJB 2.0 but using CMP 1.x). This is useful for cases where for example nothing is set programmatically but via external sources such as a stored procedure. Note that some application servers require jdbc-type and sql-type to be applied together to work correctly; have a look at the respective subtask for your application server.

Applies to: EJB entity bean fields. On the persistent fields getter methods.

ParameterTypeApplicabilityDescriptionMandatory
column-nametext Declare the column-name to which the CMP field will be mapped. false
jdbc-typetext Declare the JDBC Type. Its value must be one of the fields of java.sql.Types (e.g. BIT, CHAR...). This jdbc type will be used by the CMP provider to determine which method to call on PreparedStatement and ResultSet for INSERT / UPDATE / SELECT queries.
Valid options are:

ARRAY

BIGINT

BINARY

BIT

BLOB

BOOLEAN

CHAR

CLOB

DATALINK

DATE

DECIMAL

DISTINCT

DOUBLE

FLOAT

INTEGER

JAVA_OBJECT

LONGVARBINARY

LONGVARCHAR

NULL

NUMERIC

OTHER

REAL

REF

SMALLINT

STRUCT

TIME

TIMESTAMP

TINYINT

VARBINARY

VARCHAR

Default value(s):

VARCHAR
false
sql-typetext Declare the actual type of the field in the database. This value will only be used when the CMP container creates your table (if possible). false
read-onlybool Indicates that a field is read-only. false

@ejb.persistent-field (0..1)

Deprecated. Use the ejb.persistence tag instead.

Applies to: Methods which follow patterns: public abstract Foo getX(); public abstract boolean isX(); public abstract void setX(Foo newVal);

@ejb.pk-field (0..1)

Use this for methods with the following pattern: public abstract Foo getX(). This will denote the persistent field "X" as a primary key field, which will be included in the generated primary key class. Must be used with the persistent-field tag. This tag is only valid for EntityBeans. It has no parameters.

Applies to: Methods with the following pattern: public abstract Foo getX(). Entity beans only.

@ejb.relation (0..1)

Defines a relationship between Entity beans.

Applies to: Entity beans, EJB 2.0 (CMP2.x)

ParameterTypeApplicabilityDescriptionMandatory
nametext Name of the relation. For bidirectional relationships, specify the same name on both sides. true
role-nametext Name of the relationship role. true
cascade-deletetext Indicates whether or not the app server should perform cascade deletes. If yes, specify cascade-delete="yes". false
target-ejbtext Name of the EJB on the other side of the relation. Should *only* occur if the relation is unidirectional. false
target-role-nametext Name of the relationship role on the other side of the relation. Should *only* occur if the relation is unidirectional. false
target-cascade-deletetext Indicates whether or not the app server should perform cascade deletes for the other side of the relation. If yes, specify cascade-delete="yes". Should *only* occur if the relation is unidirectional. false
target-multipletext If this EJB represents a many-side of the other side of the relation, specify target-multiple="yes". If not, just don't use this parameter, or specify "no". Should *only* occur if the relation is unidirectional. false

@ejb.select (0..*)

Defines a select method. This tag is placed on the ejbSelect methods.

Applies to: Entity beans, EJB 2.0

ParameterTypeApplicabilityDescriptionMandatory
querytextEJB-QL query for the select method.true
result-type-mappingtextResult type mapping for the select method.
Valid options are:

none

Local

Remote

Default value(s):

none
false

@ejb.transaction (0..1)

Defines the transactional behaviour for this method. Applicable to methods with @ejb.create-method and @ejb.interface-method tags. If used on class level applies to all interface methods unless overridden. Note: To set the transaction type for Message Driven Beans, use the class level tag for now.

Applies to: Entity & Session beans

ParameterTypeApplicabilityDescriptionMandatory
typetextDefine the type of transactional behaviour.
Valid options are:

NotSupported

Supports

Required

RequiresNew

Mandatory

Never

Default value(s):

Supports
true

@ejb.value-object (0..*)

For a description have a look at the class level @ejb.value-object description.

Applies to: Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
matchtext Repeat here the 'match' attribute declared in a class-level @ejb.value-object tag to link this property to the declared value object. false
composetext Tell XDoclet which should be the type of items contained in the multi valued property. This should be a fully qualified class name. false
compose-nametext Tell XDoclet how the accessor methods to this property in the value object should be called. The value of this parameter should be the method name, sans get or set. false
aggregatetext Tell XDoclet which should be the type of items contained in the multi valued property. This should be a fully qualified class name. false
aggregate-nametext Tell XDoclet how the accessor methods to this property in the value object should be called. The value of this parameter should be the method name, sans get or set. false
memberstextThe class of the local or remote interface of the associated or composed bean.false
members-nametextThe Bean Name of the associated or composed Bean.false
relationtext This tells XDoclet that this property can be updated outside of the scope of this value object, so the generated method should always retrieve the property value. For relations, this is a no brainer: always include the relation="external" parameter. false
typetext On a multi-valued property, indicates the type of the collection returned by the EJB property accessor. This should be set to 'java.util.Collection' or 'java.util.Set' in all multi-valued properties.
Valid options are:

java.util.Collection

java.util.Set
false

@ejb Field Level Tag Usage