<mvcsoft/> subtask

MVCSoft

MVCSoft is an EJB 2.0 Persistence Manager that can be plugged into multiple EJB containers (www.mvcsoft.com). This subtask generates the JAR-specific configuration file. For more explanation of how configuration files are used with MVCSoft's product, see the MVCSoft documentation.

Parameters

Attribute Description Required
connectionjndiname The JNDI name of the DataSource from which the MVCSoft runtime acquires a Connection. No, default is "java:DefaultDS".
loggingtype One of None, Log4J, Console. No, default is "None"
destdir Destination directory for output MVCSoft-specific deployment descriptor files. No, default is destdir parameter of ejbdoclet task
validateXml Validates the generated xml file according to the DTD file contained inside xdoclet.jar. No, default is false

Class level Tags

@mvcsoft:entity

Sets various configuration options that apply to the entity as a whole.

Parameter Usage
[table]: String The name of the table to which the entity is persisted.
[cache]: String Sets how entity data is synchronized with the database. Valid choices are CommitOptionA and CommitOptionBC. The default is CommitOptionBC.
[insert]: String Determines when a new entity is inserted into the database. Valid choices are AfterCreate, AfterPostCreate, and AtTransactionCompletion. The default is AtTransactionCompletion.
[delete]: String Determines when an entity is deleted from the database. Valid choices are AtRemove and AtTransactionCompletion. The default is AtTransactionCompletion.
[locking-strategy]: String Sets the locking strategy for concurrent entity access. Valid choices are None, Pessimistic, Counter, Timestamp, or FieldComparison. The default is FieldComparison.
[lock-col-name]: String Sets the database column name for the implementation of the locking strategies Counter and Timestamp.
[lock-col-sql-type]: String Sets the database column type for the implementation of the locking strategies Counter and Timestamp.

@mvcsoft:uuid-key

Configures the MVCSoft Persistence Manager to provide a "universally unique identifier" value (of type String or BigInteger) for a specified primary key field. The components of this UUID are specified by indicating the source of a value (e.g. counter, ip address, class hash code) and the number of bytes for that value. See the MVCSoft documentation for more information. For example:

@mvcsoft:uuid-key key-field="id" field-type="String" timestamp="4" ipaddress="4" counter="2"
Parameter Usage
[key-field]: String
The name of the primary key field that should be configured with a UUID value when the entity is created, or the special string "Unknown Key" for the case of an unknown primary key.
[field-type]: String The type of UUID created. Valid values are String and BigInteger.
[timestamp]: int The number of bytes from a timestamp that should be included in the UUID.
[ipaddress]: int The number of bytes from the IP address that should be included in the UUID.
[classhash]: int The number of bytes from a hash of the container class that should be included in the UUID.
[classstarttime]: int The number of bytes from the container start time that should be included in the UUID.
[counter]: int The number of bytes from a counter that should be included in the UUID.

@mvcsoft:high-low-key

Configures the MVCSoft Persistence Manager to automatically and efficiently provide a sequence value for a specified primary key field. (This strategy is also known as "sequence blocks.") This strategy requires a database table to hold the value for the next block of sequence numbers. See the MVCSoft documentation for more information. For example:

@mvcsoft:high-low-key key-field="id" sequence-name="TestSequence" non-transactional-pool-name="java:NonTransactional" chunk-size="10000" retry-count="3" table-name="sequences" sequence-name-column="name" sequence-name-sql-type="varchar(30)" value-column="usedincrements" value-sql-type="number(19)"
Parameter Usage
[key-field]: String
The name of the primary key field that should be configured with a sequence value when the entity is created, or the special string "Unknown Key" for the case of an unknown primary key.
[sequence-name]: String The name that identifies a particular sequence. (Sequences may be reused across entity bean types if desired.)
[non-transactional-pool-name]: String The JNDI name of a DataSource that will provide a Connection that does not participate in the current transaction.
[chunk-size]: int The number of sequences that are retrieved in a single database access. Setting this to a high value reduces database i/o (at the negligible cost of potentially "wasted" sequence numbers).
[retry-count]: int Sequence numbers are retrieved using optimistic concurrency. This value determines the number of retries in case of an optimistic rollback.
[table-name]: String The name of the database table in which sequence values are stored.
[sequence-name-column]: String The column name for the column that holds the "sequence name" information.
[sequence-name-sql-type]: String The sql type for the column that holds the "sequence name" information.
[value-column]: String The column name for the column that holds the last used sequence number.
[value-sql-type]: String The sql type for the column that holds the last used sequence number.

@mvcsoft:unknown-key

Configures the MVCSoft Persistence Manager for the case of the unknown primary key. For example:

@mvcsoft:unknown-key java-type="java.lang.String" col-name="key" jdbc-type="VARCHAR" sql-type="varchar(50)"

You must also specify a uuid-key configuration or a high-low-key configuration to provide a value for the unknown primary key at runtime.

Parameter Usage
[java-type]: String
The Java class that will be used to represent the unknown primary key at runtime. This should be compatible with the UUID or high-low strategy you choose for generating the value of this key.
[col-name]: String The column name of the key in the entity database table.
[jdbc-type]: String The JDBC type of the unknown key. This should be a constant from the java.sql.Types class.
[sql-type]: String The sql type for the columnof the key in the entity database table..

@mvcsoft:fault-group

Configures fault groups, which are named groups of fields that are loaded as a unit for an EJB-QL query or "on-demand." For example:

@mvcsoft:fault-group name="sample_fault_group" fields="id,date,product,value"

Parameter Usage
[name]: String
The name of the fault group.
[fields]: String A comma-separated list of fields in the entity that are members of the named fault group.

@mvcsoft:query

Configures finder and ejbSelect methods for: (1) the fields that should be "eagerly loaded" within the transaction; (2) whether or not the transaction data should be flushed before executing; and (3) the sort order of the returned results. For example:

@mvcsoft:query name="findAll " fault-group="test_fault_group" should-flush="true" sort-order="id,value desc"

Parameter Usage
[name]: String
The name of the finder or ejbSelect method.
[fault-group]: String
The name of the fault group that indicates which fields should be loaded when the query is executed.
[should-flush]: String The EJB 2.0 specification mandates that changes within a transaction be visible to queries issued within that transaction. The MVCSoft Persistence Manager meets this requirement by flushing all pending changes to the database before issuing the query. It may be that the results of a particular query will never depend on these changes, in which case you can set should-flush to false. The default is true.
[sort-order]: String A comma-separated list of fields in the entity by which to sort the query. Optionally, asc or desc may be specified after the field name to indicate the direction of the sort. There cannot be any spaces between fields on which to sort. In other words, sort-order="id, value desc" will not work, but sort-order="id,value desc" will.

Method level Tags

@mvcsoft:col-name

The column name for the field in the table where this bean will be persisted. For example:

@mvcsoft:col-name "product"
Parameter Usage
[type]: String Define the name of the column for the field.

@mvcsoft:sql-type

The SQL type for the column where this field will be persisted. Example:

@mvcsoft:sql-type "varchar(10)"
Parameter Usage
[type]: String Define the name of the sql type for the field.

@mvcsoft:jdbc-type

The JDBC type for the column where this field will be persisted. See the javadoc for "java.sql.Types" for a list of valid types.

@mvcsoft:jdbc-type "VARCHAR"
Parameter Usage
type: String The jdbc type of the field.

@mvcsoft:exclude-from-optimistic-lock

Indicates that the field should not be used in field-based comparisons for optimistic locking. This tag has no parameters.

@mvcsoft:relation

Configures the persistent storage of an EJB 2.0 relationship specified by the @ejb:relation tag. There are two basic mechanisms for persistent storage of relationships: a relationship table, which can be used for any relationship cardinality (and must be used with many-many relationships); and foreign keys in the entity table, which can be used for one-one, one-many, and many-one relationships. An example of configuring a relationship using foreign keys is:

@mvcsoft:relation map-style="foreign-key" role-with-key="ChildrenForParent" key-aliases="id=parentid, id2=parentid2,id3=parentid3" relationship-in-pk="true"

An example of configuring a relationship using a relationship table is:

@mvcsoft:relation map-style="table" table-name="TestRelationship" key-aliases="ParentHasChildren:id=parentid, id2=parentid2,id3=parentid3;ChildrenInParent:id=childid,id2=childid2,id3=childid3"

Parameter Usage
[map-style]: String Valid values are foreign-key or table.
[role-with-key]: String For foreign-key mapped relationships only. Indicates the "side" of the relationship where the foreign keys are located. The source entity of that role will have those keys in its table. (In a one-one relationship, either role can be chosen. In a one-many relationship, the entity in the "many" role, e.g. OrderInLineItem, must have the keys.)
[key-aliases]: String Specifies the names of the database columns that persistently store a relationship. These names are mapped to entity primary key fields by a simple comma-separated list in the format key=alias,key=alias. For a table-mapped relationship, both participants can have aliases, so the format is role1:key=alias,key=alias;role2:key=alias,key=alias.
[relationship-in-pk]: String For foreign-key mapped relationships only. Indicates that the foreign keys for the relationship are also components of the primary key for the entity.

@mvcsoft:wrap

Indicates that the method is a wrapper for a query. (Wrapper methods allow the bean developer to efficiently retrieve subsets of query results.) Example:

@mvcsoft:wrap query-name="findAll"
Parameter Usage
[query-name]: String Define the name of the associated finder or ejbSelect query.