Tag Usage, Class Level (@jboss)

@jboss.persistence (0..1)

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

Parameter Type Applicability Description Mandatory
datasource text The jndi-name used to lookup the datasource. false
datasource-mapping text The name of the type mapping that will be used for this datasource. false
create-table bool Should the persistence manager attempt to create tables if they are not present? false
remove-table bool Should the persistence manager attempt to remove tables during shutdown? false
read-only bool Is the entity read-only? false
post-table-create text Send an arbitrary SQL command to the DB after creating the table. The SQL is only send to the DB if create-table is true and the table was freshly created. false
read-time-out int Specifies the amount of time that a read-only entity is considered valid (milliseconds). false
row-locking bool Should select statements the SELECT ... FOR UPDATE syntax? false
pk-constraint bool Should a primary key constraint be added when creating tables? false
list-cache-max int Specifies the number of simultaneous queries that can be tracked by the cache for an entity. false
fetch-size int Specifies the number of entities to read in one round-trip to the underlying datastore. false
table-name text Specifies the name of the table this entity should be persisted to. false

@jboss.cmp-field (0..1)

Will define a < cmp-field > element for a field of a cmp-field of ejb-jar.xml. This is used for dependant objects fields mapping, see @jboss.not-persisted-field. Example:

Parameter Type Applicability Description Mandatory
field-name text The name of the field true
column-name text The name of the column. true

@jboss.container-configuration (0..1)

The name of the container configuration to use for the bean. Applicable to all types of EJBs.

Parameter Type Applicability Description Mandatory
name text Defines the container configuration for the bean. true

@jboss.declared-sql (0..*)

Configures a custom query (defined by @ejb.finder) by defining explicitly declared sql fragments to be added to the SQL generated by JBossCMP engine (Requires JBoss 3+).

Parameter Type Applicability Description Mandatory
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
description text Description of this custom query. false
distinct bool If true JBossCMP will add the DISTINCT keyword to the generated select clause. The default is to use DISTINCT if method returns a java.util.Set. false
ejb-name text The ejb-name of the entity that will be selected. Required if ejbSelect method. false
field-name text field-name can only be present if 'ejb-name' is The name of the cmp-field that will be selected from the specified entity. Default is to select the entire entity. false
alias text The alias that will be used for the main select table. Default is ejb-name. false
from text Declares additional SQL to append to the generated from clause. Example: & lt;from & gt;, FullAddressEJB as a & lt;/from & gt; false
where text Declares the where clause for the query. Example: & lt;where & gt;TITLE={0} OR ARTIST={0} OR TYPE={0} OR NOTES={0} & lt;/where & gt; false
order text Declares the order clause for the query. Example: & lt;order & gt;TITLE & lt;/order & gt; false
other text Declares the other sql that is appended to the end of a query. Example: & lt;other & gt;LIMIT 100 OFFSET 200 & lt;/other & gt; false
strategy text Specifies the strategy used to read-ahead data in queries.
Valid options are:

none

on-load

on-find
false
page-size int Specifies the number of entities that will be read in a single read-ahead load query. false
eager-load-group text Contains the name of the load group that will eager loaded for this entity. false

@jboss.destination-jndi-name (0..1)

Defines JNDI name of the Queue/Topic used my the MDB.

Parameter Type Applicability Description Mandatory
name text The name of the destination. true

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

Sets the JNDI name of a referenced bean. There must be an @ejb.ejb-ref tag too which points to the referenced bean.

Parameter Type Applicability Description Mandatory
ref-name text Define the name of the bean reference. true
jndi-name text true

@jboss.unknown-pk (0..1)

Supplies information about the unkown primary key. At least the class should be supplied, with optional column name, JDBC and SQL types.

Parameter Type Applicability Description Mandatory
class text The unknown PK class true
readonly bool Hint to treat the PK as read-only false
read-time-out int The read timeout value for the PK field false
column-name text The name of the PK column in the DB table false
jdbc-type text This is the JDBC type that is used when setting parameters in a JDBC PreparedStatement or loading data from a JDBC ResultSet for this cmp-field. The valid types are defined in java.sql.Types. Must be specified together with sql-type.
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 This is the SQL type that is used in create table statements for this field. Valid sql-types are only limited by your database vendor. Must be specified together with jdbc-type. false
auto-increment bool Set if the field is autoincremented by the database. false

@jboss.entity-command (0..1)

Supplies information about an entity-command used to create the entity bean.

Parameter Type Applicability Description Mandatory
name text The command name. true
class text The command class. false

@jboss.entity-command-attribute (0..*)

Supplies in formation about an entity-command used to create the entity bean.

Parameter Type Applicability Description Mandatory
name text The attribute name. true
value text The attribute value. true

@jboss.finder-query (0..*)

Assign custom query to finder named "findFoo". An @ejb.finder tag for the named finder must also be present

Parameter Type Applicability Description Mandatory
name text The name of the finder. true
query text The query for the finder. See JAWS documentation for finder query syntax. true
order text The order for the finder results. false
read-ahead bool Indicate if the query should have read-ahead. false

@jboss.query (0..*)

Configures a custom query (defined by @ejb.finder) for the JBossCMP engine (Requires JBoss 3+).

Parameter Type Applicability Description Mandatory
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
description text Description of this custom query. false
query text JBossQL query which overrides the EJB-QL specified in the EJB deployment descriptor. JBossQL is a superset of EJB-QL. false
dynamic bool Dynamic JBossQL query. The JBossQL is passed to the query and compiled on the fly. false
strategy text Specifies the strategy used to read-ahead data in queries.
Valid options are:

none

on-load

on-find
false
page-size int Specifies the number of entities that will be read in a single read-ahead load query. false
eager-load-group text Contains the name of the load group that will eager loaded for this entity. false

@jboss.read-ahead (0..1)

Specifies the read ahead strategy for this Entity bean. Applicable to Entity beans using JBossCMP persistence engine.

Parameter Type Applicability Description Mandatory
strategy text Specifies the strategy used to read-ahead data in queries.
Valid options are:

none

on-load

on-find
true
page-size int Specifies the number of entities that will be read in a single read-ahead load query. false
eager-load-group text Contains the name of the load group that will eager loaded for this entity. false

@jboss.read-only (0..1)

Mark bean as read-only. This will avoid ejbStore calls.

Parameter Type Applicability Description Mandatory
read-only bool Declare the bean as read only. true

@jboss.resource-manager (0..*)

Parameter Type Applicability Description Mandatory
res-man-name text Define the name of the resource manager. true
res-man-jndi-name text Define the jndi name of the resource manager. true

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

The resource-env-ref element gives a mapping between the "code name" of a env resource (res-ref-name, provided by the Bean Developer) and its deployed JNDI name.

Parameter Type Applicability Description Mandatory
resource-env-ref-name text The resource-env-ref-name element gives the "code name" of a resource. It is provided by the Bean Developer. true
jndi-name text The jndi name to which the reference should link. true

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

The resource-ref element gives a mapping between the "code name" of a resource (res-ref-name, provided by the Bean Developer) and its "xml name" (resource-name, provided by the Application Assembler). If no resource-ref is provided, jboss will assume that "xml-name" = "code name".

Parameter Type Applicability Description Mandatory
res-ref-name text The res-ref-name element gives the "code name" of a resource. It is provided by the Bean Developer. See resource-managers for the actual configuration of the resource. true
resource-name text The resource-name element gives the "xml name" of the resource. It is provided by the Application Assembler. See resource-managers for the actual configuration of the resource. false
jndi-name text The jndi name to which the reference should link. false
res-url text The res-url element is the "runtime jndi name" as a url of the resource. It is provided by the Deployer. false

@jboss.security-proxy (0..1)

The security-proxy gives the class name of the security proxy implementation. This may be an instance of org.jboss.security.SecurityProxy, or an just an object that implements methods in the home or remote interface of an EJB without implementating any common interface.

Parameter Type Applicability Description Mandatory
name text Defines the security-proxy for the bean. true

@jboss.method-attributes (0..*)

Allows for the specification of non-standard attributes for the named method(s). For JBoss 3.0 this tag can only appear once, for 3.2 and later there can be multiple occurrences.

Parameter Type Applicability Description Mandatory
pattern text A complete method name or a pattern consisting of an initial match followed by '*'. true
read-only bool Flags method(s) as read only. The named method(s) will never trigger a store. false

@jboss.clustered (0..1)

Marks the EJB as clustered in jboss.xml deployment descriptor

Parameter Type Applicability Description Mandatory
cluster bool Used to turn on/off clustering. false

@jboss.cluster-config (0..1)

Sets JBoss clustering configuration, overriding the default container on a per-EJB basis. The defaults mentioned here are not actual XDoclet behavior but rather JBoss defaults cited here for convenience.

Parameter Type Applicability Description Mandatory
partition-name text Sets the name of the JBoss Cluster Partition in which this EJB is to be deployed. false
home-policy text Sets the algorithm used for home load balancing policy, i.e. < code > & lt;home-load-balance-policy & gt; < /code > in jboss.xml. More in JBoss clustering docs... false
bean-policy text Sets the algorithm used for bean load balancing policy, i.e. < code > & lt;bean-load-balance-policy & gt; < /code > in jboss.xml. More in JBoss clustering docs... false
state-manager text Only relevant for Stateful SessionBeans Sets the JNDI name used for looking up the clustered session state manager. i.e. < code > & lt;session-state-manager-jndi-name & gt; < /code > in jboss.xml. More in JBoss clustering docs... false

@jboss.cache-invalidation (0..1)

Tells the container to emit cache invalidation messages when these entities are changed. NOTE! You must ensure the entity is deployed in a container configured or in validation. (i.e. has org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor configured in its interceptor stack.)

Parameter Type Applicability Description Mandatory
value text Defines the behaviour of the invalidator: true enables it for commit options A and D, True forces invalidation on all commit options. false

@jboss.cache-invalidation-config (0..1)

Configure the behaviour of jboss cache invalidation. NOTE! The defaults mentioned are not manifested in the output, they are JBoss's behaviour cited here for convenience.

Parameter Type Applicability Description Mandatory
invalidation-manager-name text The JMX ObjectName of the InvalidationManager to use. false
invalidation-group-name text The name of an invalidationgroup to which this entity belongs. false

@jboss.service (0..*)

Configures the generation of -service.xml files for JBoss

Parameter Type Applicability Description Mandatory
servicefile text The prefix that will be prepended to th e generated -service.xml file name. For example, if servicefile="test", the generated file will be called test-service.xml. Please note that you must include at least one @jboss.service servicefile="xxx" in your MBean, or generation will fail. false
classpath text A directory to use as codebase for this service classpath. This parameter may be used in conjunction with the 'archives' parameter to form the service classpath. false
archives text Individual filenames that should be used to construct the service classpath. This parameter should nevercome alone in a '@jboss.service' tag, but should always come together with the 'classpath' attribute. false

Tag Usage, Method Level (@jboss)

@jboss.relation (0..*)

Used to customize the relationships via jbosscmp-jdbc.xml for JBoss 3.0. NOTE: If you replace jboss.relation with jboss.target-relation, you can modify the blind side of a unidirectional relationship (someone fix this wording)

Parameter Type Applicability Description Mandatory
fk-constraint bool Flag to indicate if a foreign key constraint should be placed on the relation column. false
related-pk-field text Name of the pk field of the 1- end of the relationship that this foreign key constraint applies to. Required for support of complex primary keys in the 1- end of the relation. (Corresponds to field-name in jbosscmp-jdbc.xml) true
fk-column text Name of the column that should be used for foreign key mapping. (Corresponds to column-name in jbosscmp-jdbc.xml) true

@jboss.method-attributes (0..1)

Allows for the specification of non-standard attributes for the method. Can only be used with JBoss 3.2 and later, for 3.0 use the class-level tag.

Parameter Type Applicability Description Mandatory
read-only bool Flags the method as read only. Such a method will never trigger a store. false

@jboss.target-relation (0..*)

Used to customize the relationships via jbosscmp-jdbc.xml for JBoss 3.0. This tag should be used to modify the blind side of the relation in an unidirectional relationship. Aside from this, it's exactly the same as @jboss.relation.

Parameter Type Applicability Description Mandatory
fk-constraint bool Flag to indicate if a foreign key constraint should be placed on the relation column. false
related-pk-field text Name of the pk field of the 1- end of the relationship that this foreign key constraint applies to. Required for support of complex primary keys in the 1- end of the relation. (Corresponds to field-name in jbosscmp-jdbc.xml) true
fk-column text Name of the column that should be used for foreign key mapping. (Corr esponds to column-name in jbosscmp-jdbc.xml) true

@jboss.relation-read-ahead (0..*)

Used to customize the read-ahead component of relationships via jbosscmp-jdbc.xml for JBoss 3.0. NOTE: If you replace jboss.relation-read-ahead with jboss.target-relation-read-ahead, you can modify the blind side of a unidirectional relationship.

Parameter Type Applicability Description Mandatory
strategy text Specifies the strategy used to read-ahead data in queries.
Valid options are:

none

on-load

on-find
true
page-size int Specifies the number of entities that will be read in a single read-ahead load query. false
eager-load-group text Contains the name of the load group that will eager loaded for this entity. false

@jboss.persistence (0..1)

The @jboss.persistence tag provides information about the persistence of a CMP field.

Parameter Type Applicability Description Mandatory
read-only bool Is the field read-only? false
read-time-out int Specifies the amount of time that a read-only field is considered valid (milliseconds). false
not-null bool Should null values be allowed? false
auto-increment bool Should the field be auto-incremented by the database? false
dbin dex bool Should a DB-index be created for this field? false

@jboss.column-name (0..1)

Declares the column name to which the CMP field will be mapped.

Parameter Type Applicability Description Mandatory
name text The column name. true

@jboss.jdbc-type (0..1)

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.

Parameter Type Applicability Description Mandatory
type text A valid JDBC type.
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
true

@jboss.relation-table (0..1)

Tells the JBoss persistence manager to use a relation table for managing entity relationships.

Parameter Type Applicability Description Mandatory
table-name text The name of the relation tab le. false
datasource text The datasource to place the relation table in. false
datasource-mapping text The name of the type mapping that will be used for this datasource. false
create-table bool Should the persistence manager attempt to create tables if they are not present? false
remove-table bool Should the persistence manager attempt to remove tables during shutdown? false
row-locking bool Should select statements the SELECT ... FOR UPDATE syntax? false
pk-constraint bool Should a primary key constraint be added when creating tables? false

@jboss.sql-type (0..1)

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).

Parameter Type Applicability Description Mandatory
type text The database-specific SQL type. true

@jboss.relation-mapping (0..1)

Use jboss.relation-mapping="relation-table" to force the use of a relation table mapping in a relationship even when the relation is not M-N.

Parameter Type Applicability Description Mandatory
style text relation-table to be of any use
Valid options are:

relation-table
false