@ejbgen:local-method Annotation

This tag defines the methods for an entity or session bean's local (business) interface.

Scope

Method tag on an entity bean's CMP accessor methods, CMR accessor methods, and component methods; Method tag on a session bean's component methods.

Syntax

@ejbgen:local-method

[is-idempotent="True/False"]

[isolation-level="IsolationLevelType"]

[ordering-number="Number"]

[roles="RolesList"]

[transaction-attribute="TransactionOption"]

Attributes

is-idempotent

Optional. Specifies whether this method is idempotent. Valid values are True and False. An idempotent method does not alter the state of the system, that is, produces the same results on subsequent invocations if the same arguments are provided.

isolation-level

Optional. Specifies the transaction isolation level for this method. Valid values are TransactionSerializable, TransactionReadCommitted, TransactionReadUncommitted, and TransactionRepeatableRead. If you are using an Oracle database, you can also specify TransactionReadCommittedForUpdate or TransactionReadCommittedForUpdateNoWait. If not specified, the isolation level specified by an ejbgen:method-isolation-level-pattern Annotation might apply. Otherwise, the default isolation level of the underlying database is used. For more information, see EJBs and Transactions.

ordering-number

Optional. Specify a number to enforce in what order this method will be defined, relative to the other methods, in the auto-generated local interface. Valid values are 0...n. In order for this ordering to work, all local-method tags used in this EJB must have this attribute set with a distinct numeric value. If the ordering-number attribute is not used, the methods will be defined in alphabetical order. For more information on interface generation, see ejbgen:file-generation Annotation.

roles

Optional. Defines a comma-separated list of EJB-scoped security roles that are allowed to invoke this method. If not specified, the roles specified by an ejbgen:method-permission-pattern Annotation might apply. These EJB-scoped security roles must be defined using the @ejbgen:role-mapping Annotation. For more information, see Role-Based Security.

transaction-attribute

Optional. Specifies the transaction attribute for this local method. Valid values are NotSupported, Supports, Required, RequiresNew, Mandatory, and Never. If not specified, the default transaction of the session or entity bean will be used. For more information, see EJBs and Transactions.

Remarks

The following rules apply to this tag's use:

Related Topics

@ejbgen:file-generation Annotation

@ejbgen:remote-method Annotation

@ejbgen:local-home-method Annotation

How Do I: Define a Container-Managed Persistence (CMP) Field?

How Do I: Add a Component Method to an Entity or Session Bean?

How Do I: Add a Relation to an Entity Bean?