##### XDoclet

- Overview
- News and Status
- Download/Installation
- Using XDoclet
- Best Practices
- FAQ
- License

##### Ant Task Reference

- <doclet .. />
- <ejbdoclet .. />
- <hibernatedoclet .. />
- <jdodoclet .. />
- <jmxdoclet .. />
- <mockdoclet .. />
- <portletdoclet .. />
- <springdoclet .. />
- <webdoclet .. />
- <wseedoclet .. />

##### Tag Reference

- apache (@soap @struts @axis)
- bea (@weblogic)
- borland (@bes)
- caucho (@resin)
- ejb (@ejb @dao)
- exolab (@castor)
- hp (@hpas)
- hibernate (@hibernate)
- ibm (@websphere)
- java (@javabean)
- jboss (@jboss)
- jdo (@jdo)
- jmx (@jmx)
- jsf (@jsf)
- macromedia (@jrun)
- mockobjects (@mock)
- mvcsoft (@mvcsoft)
- mx4j (@mx4j)
- objectweb (@jonas)
- oracle (@oc4j)
- orion (@orion)
- portlet (@portlet)
- pramati (@pramati)
- spring (@spring)
- sun (@sunone)
- sybase (@easerver)
- tjdo (@tjdo)
- web (@web @jsp)
- webwork (@webwork)
- wsee (@wsee)
- xdoclet (@xdoclet @doc @msg)

##### Feature Documentation

- Using Value Objects

##### Advanced

- Maven Plug-in
- Merge Points
- IDE Integration
- Migration from EJBDoclet
- Ant 1.5 Troubleshooting

##### Community

- Feedback
- Resources
- Tools

##### Development

- Developer Guide
- Javadoc (API)
- Template Language (*.xdt)
- XJavaDoc Site

##### Search XDoclet

##### Project Documentation

- About XDoclet
- Project Info
- Project Reports
- Development Process

## @ejb Tag Reference

Ejb tags

Applies to: All EJB types on class and method level.

### @ejb Class Level Tags

@ejb.bean
@ejb.dao
@ejb.data-object
@ejb.ejb-external-ref
@ejb.ejb-ref
@ejb.env-entry
@ejb.facade
@ejb.finder
@ejb.home
@ejb.interface
@ejb.persistence
@ejb.pk
@ejb.remote-facade
@ejb.resource-env-ref
@ejb.resource-ref
@ejb.security-identity
@ejb.security-role-ref
@ejb.security-roles
@ejb.util
@ejb.value-object

### @ejb Method Level Tags

@dao.call
@ejb.aggregate
@ejb.create-method
@ejb.facade-method
@ejb.home-method
@ejb.interface-method
@ejb.permission
@ejb.persistence
@ejb.persistent-field
@ejb.pk-field
@ejb.relation
@ejb.select
@ejb.transaction
@ejb.value-object

### @ejb Field Level Tags

## @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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | Provides the name of the bean that will be used in the ejb-jar.xml deployment descriptor. | true
description | text |  | A description of the bean. Defaults to the first sentence of the class-level javadoc comment of the bean class. | false
display-name | text |  | The display name of the bean. | false
small-icon | text |  | The small icon for the bean. | false
large-icon | text |  | The large icon for the bean. | false
generate | bool |  | 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-name | text | Remote Session and Entity beans. | Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. | false
local-jndi-name | text | Local 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-type | text | Session 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
type | text | Session 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-type | text | Session and Message-driven beans. | Defines the bean's transaction type. Valid options are: Container Bean Default value(s): Container | false
reentrant | bool | Entity beans | Defines the entity bean's reentrancy. Default value(s): true | false
cmp-version | text | Entity 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
schema | text | Entity beans, EJB 2.0 | Defines the abstract schema name for the bean. | false
primkey-field | text | Entity beans. | Defines the primary key field for the bean as per spec. | false
use-soft-locking | bool | Entity 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-selector | text | Message-driven beans | Defines an optional message selector for MDB. | false
acknowledge-mode | text | Message-driven beans. | Defines the acknowledge mode for MDB. Valid options are: Auto-acknowledge Dups-ok-acknowledge Default value(s): Auto-acknowledge | false
destination-type | text | Message-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-durability | text | Message-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-name | text | Message-driven beans | Defines the jndi name of the destination queue/topic. | false
connection-factory-jndi-name | text | Message-driven beans | Defines the jndi name of the JMS connection factory. | false
remote-business-interface | text | Session 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-interface | text | Session 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-name | text | All 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-interface | text | Session 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
class | text |  | The fully qualified name of the DAO interface. If absent the interface name will be determined using the pattern and package parameters. | false
pattern | text |  | Define the pattern (using {0} for the EJB name) to be used for constructing the unqualified (package specific) name of the DAO interface. | false
package | text |  | Define the package the DAO interface is in (generated or not). Use <packageSubstitution/> to configure which package the interface should end up in. | false
generate | bool |  | Indicate if the DAO interface should be generated. Default value(s): true | false
impl-class | text |  | 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-jndi | text |  | 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-methods | text |  | Indicate if create methods should be automatically included in the DAO interface. Default value(s): true | false
finder-methods | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
extends | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
view-type | text |  | The view type of the referenced bean. Valid options are: local remote | true
link | text |  | 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-name | text |  | 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-name | text |  | 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
type | text |  | The type of EJB being referenced. Valid options are: Entity Session Default value(s): Entity | true
home | text |  | The fully qualified class name of the home interface of the referenced bean. | false
business | text |  | The fully qualified class name of the business interface (local or remote interface) of the referenced bean. | true
remote | text |  | (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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
ejb-name | text |  | The name of the EJB being referenced. | true
view-type | text |  | The view type that the reference uses. Valid options are: local remote Default value(s): remote | true
ref-name | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | The name of the env-entry. | true
description | text |  | Optional description of the env-entry. | false
type | text |  | 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
value | text |  | The 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | Name of generated facade EJB. Default value(s): {0}Facade | false
description | text |  | A description of the bean. Defaults to the first sentence of the class-level javadoc comment of the bean class. | false
display-name | text |  | The display name of the bean. | false
small-icon | text |  | The small icon for the bean. | false
large-icon | text |  | The large icon for the bean. | false
jndi-name | text | Remote Session and Entity beans | Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. | false
local-jndi-name | text |  | 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-type | text |  | Indicates what view-type(s) is(are) supported by the bean. Valid options are: local remote both Default value(s): remote | false
type | text |  | Defines the bean's "type". Valid options are: Stateless Stateful Default value(s): Stateless | true
transaction-type | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
view-type | text |  | To restrict the home interface in which the finder will be defined. Valid options are: local remote both Default value(s): both | false
description | text |  | Description of the finder. | false
signature | text |  | Defines the signature of the method. E.g.. "java.util.Collection findAll()". The return type in the signature must be fully qualified. | true
unchecked | bool | Entity beans, EJB 2.0 | Flags the finder as having unchecked permission. If present, role-name must be omitted. Default value(s): true | false
role-name | text |  | A comma-separated list of roles that can invoke this finder method. | false
query | text | Entity beans, EJB 2.0 | EJB-QL query for the finder. | false
result-type-mapping | text | Entity 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-type | text |  | Indicates the transaction type attribute sets to the method. | false
method-intf | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
extends | text |  | Declare which interface the generated home interface should extend. Default value(s): javax.ejb.EJBHome | false
local-extends | text | Session and Entity beans, EJB 2.0 | Declare which interface the generated local home interface should extend. Default value(s): javax.ejb.EJBLocalHome | false
generate | text |  | Which home interfaces should be generated. Valid options are: local remote Default value(s): local,remote | false
remote-class | text |  | The fully qualified name of the remote home interface. | false
local-class | text | Session and Entity beans, EJB 2.0 | The fully qualified name of the local home interface. | false
remote-pattern | text |  | 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-pattern | text | Session 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
pattern | text |  | 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-package | text |  | 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-package | text |  | 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
package | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
extends | text |  | Declare which interface the generated remote interface should extend. Default value(s): javax.ejb.EJBObject | false
local-extends | text | Session and Entity beans, EJB 2.0 | Declare which interface the generated local interface should extend. Default value(s): javax.ejb.EJBLocalObject | false
service-endpoint-extends | text |  | Declare which interface the generated service-endpoint interface should extend. Default is "java.rmi.Remote". Default value(s): java.rmi.Remote | false
generate | text |  | Which interfaces should be generated. Defaults to true. Valid options are: local remote service-endpoint Default value(s): local,remote | false
remote-class | text |  | The fully qualified name of the remote interface. | false
local-class | text | Session and Entity beans, EJB 2.0 | The fully qualified name of the local interface. | false
service-endpoint-class | text | Session beans, EJB 2.1 | The fully qualified name of the service endpoint interface. | false
remote-pattern | text |  | The pattern to be used in determining the unqualified name of the remote interface - only used if remote-class is not present. | false
local-pattern | text | Session 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-pattern | text | Session 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
pattern | text |  | 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-package | text |  | 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-package | text | Session 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-package | text | Session 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
package | text |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
table-name | text |  | 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-only | bool |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
class | text |  | 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
pattern | text |  | 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
package | text |  | 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
generate | bool |  | Indicate if the primary key class should be generated. Defaults to true. Default value(s): true | false
extends | text |  | Define which class the generated pk must extend. | false
implements | text |  | Define which interface the generated pk must implement. | false
role-name | text |  | A comma-separated list of roles that can execute findByPrimaryKey. | false
unchecked | bool | Entity 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-intf | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | The name of the resource. | true
type | text |  | The 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
res-ref-name | text |  | The name of the environment entry used in the enterprise bean's code. | true
res-type | text |  | The resource type. | true
res-auth | text |  | The resource authentication type. Valid options are: Container Application Default value(s): Container | true
res-sharing-scope | text |  | The resource sharing scope Valid options are: Shareable Unshareable Default value(s): Shareable | false
jndi-name | text |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
description | text |  | The description of the security identity. | false
use-caller-identity | bool |  | 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-as | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
role-name | text |  | The name of the role reference | true
role-link | text |  | The 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
role-names | text |  | Comma separated list of roles | true

### @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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
generate | text |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | 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
match | text |  | 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
extends | text |  | The name of the class the generated value object class should extend, if any. | false
implements | text |  | 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
abstract | bool |  | Set if this value object is intended to be an abstract object which other value objects extend. | false
generatePKConstructor | bool |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
view-type | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
invalidate | bool |  | 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
cache | bool |  | Setup result caching for this method result. No effect on void methods. Default value(s): false | false
immutable | bool |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
view-type | text |  | 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
view-type | text |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
role-name | text |  | Comma-separated list of roles allowed to call this method | false
unchecked | bool | Entity 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
column-name | text |  | Declare the column-name to which the CMP field will be mapped. | false
jdbc-type | text |  | 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-type | text |  | 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-only | bool |  | 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)

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | Name of the relation. For bidirectional relationships, specify the same name on both sides. | true
role-name | text |  | Name of the relationship role. | true
cascade-delete | text |  | Indicates whether or not the app server should perform cascade deletes. If yes, specify cascade-delete="yes". | false
target-ejb | text |  | Name of the EJB on the other side of the relation. Should *only* occur if the relation is unidirectional. | false
target-role-name | text |  | Name of the relationship role on the other side of the relation. Should *only* occur if the relation is unidirectional. | false
target-cascade-delete | text |  | 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-multiple | text |  | 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
query | text |  | EJB-QL query for the select method. | true
result-type-mapping | text |  | Result 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

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
type | text |  | Define 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.

Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
match | text |  | Repeat here the 'match' attribute declared in a class-level @ejb.value-object tag to link this property to the declared value object. | false
compose | text |  | 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-name | text |  | 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
aggregate | text |  | 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-name | text |  | 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
members | text |  | The class of the local or remote interface of the associated or composed bean. | false
members-name | text |  | The Bean Name of the associated or composed Bean. | false
relation | text |  | 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
type | text |  | 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