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
|
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
|
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
|
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: <from>, FullAddressEJB as a</from>
|
false
|
where
|
text
|
|
Declares the where clause for the query.
Example: <where>TITLE={0} OR ARTIST={0} OR TYPE={0} OR NOTES={0}</where>
|
false
|
order
|
text
|
|
Declares the order clause for the query.
Example: <order>TITLE</order>
|
false
|
other
|
text
|
|
Declares the other sql that is appended to the end of a query.
Example: <other>LIMIT 100 OFFSET 200</other>
|
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
|
Defines JNDI name of the Queue/Topic used my the MDB.
Parameter
|
Type
|
Applicability
|
Description
|
Mandatory
|
name
|
text
|
|
The name of the destination.
|
true
|
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
|
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
|
|
The JDBC type for the PK column. Should be specified together with sql-type
|
false
|
sql-type
|
text
|
|
The SQL type for the PK column. Should be specified together with jdbc-type
|
false
|
auto-increment
|
bool
|
|
Set if the PK field is autoincremented by the database
|
false
|
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
|
Supplies information 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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
Marks the EJB as clustered in jboss.xml deployment descriptor
Parameter
|
Type
|
Applicability
|
Description
|
Mandatory
|
cluster
|
bool
|
|
Used to turn on/off clustering.
|
false
|
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><home-load-balance-policy></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><bean-load-balance-policy></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><session-state-manager-jndi-name></code> in jboss.xml.
More in JBoss clustering docs...
|
false
|
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
|
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
|
Configures the generation of -service.xml files for JBoss
Parameter
|
Type
|
Applicability
|
Description
|
Mandatory
|
servicefile
|
text
|
|
The prefix that will be prepended to the 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
|
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
|
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
|
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. (Corresponds to
column-name in jbosscmp-jdbc.xml)
|
true
|
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
|
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
|
dbindex
|
bool
|
|
Should a DB-index be created for this field?
|
false
|
Declares the column name to which the CMP field will be mapped.
Parameter
|
Type
|
Applicability
|
Description
|
Mandatory
|
name
|
text
|
|
The column name.
|
true
|
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
|
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 table.
|
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
|
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
|
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
|