XDoclet Overview News and Status Download/Installation Using XDoclet Best Practices FAQ License Ant Task Reference <ejbdoclet .. /> <webdoclet .. /> <hibernatedoclet .. /> <mockdoclet .. /> <jdodoclet .. /> <jmxdoclet .. /> <doclet .. /> Tag Reference apache (@soap @struts) 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) macromedia (@jrun) mockobjects (@mock) mvcsoft (@mvcsoft) mx4j (@mx4j) objectweb (@jonas) oracle (@oc4j) orion (@orion) pramati (@pramati) sybase (@easerver) web (@web @jsp) webwork (@webwork) xdoclet (@xdoclet @doc) Feature Documentation Using Value Objects Advanced Maven Plug-in Merge Points Log4J Configuration IDE Integration Migration from EJBDoclet Ant 1.5 Troubleshooting Community Feedback Resources Tools Development Developer Guide Javadoc (API) Template Language (*.xdt) XJavaDoc Site Project Documentation Front Page Project Info Project Reports Development Process | ### Tag Reference for @castor mapping The castormapping subtask produces a mapping.xml file for use by castor. Class Level Tags @castor.class Method Level Tags @castor.field @castor.field-sql @castor.field-xml Field Level Tags ### Tag Usage, Class Level (@castor mapping) #### @castor.class (0..1) Defines the class and its attributes. For full coverage of the mapping options, please refer to the Castor mapping documentation.
Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
table | text |  | The name of the table in the database that the class is mapped to. | true
id | text |  | The fields that form the class's primary key. | true
access | text |  | Define the access to the class. Valid options are: read-only shared exclusive db-locked Default value(s): shared | true
depends | text |  | The name of the class this class depends on. | false
extends | text |  | Should be used only if this class extends another class for which mapping information is provided. It should not be used if the extended class is not used in the mapping file. | false
key-generator | text |  | The key-generator strategy to be used by Castor. | false
auto-complete | bool |  | If true, the class will be introspected to determine its field and the fields specified in the mapping file will be used to override the field found during the introspection. | false
ns-uri | text |  | The namespace URI to be used for the class. | false
ns-prefix | text |  | The namespace prefix to be used for the class. | false
### Tag Usage, Method Level (@castor mapping) #### @castor.field (0..1)
Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
type | text |  | The Java type of the field. It is used to access the field. Castor will use this information to cast the XML information (like string into integer). It is also used to define the signature of the accessors method. If a collection is specified, this is used to specify the type of the object inside the collection. If type is not specified it defaults to the return type of the method. | false
required | bool |  | Flag to indicate if the field is compulsory. | false
direct | bool |  | Flag to indicate if the field should be accessed directly rather than using getter / setter methods. | false
lazy | bool |  | Flag to indicate if the field loaded lazily. | false
transient | bool |  | Flag to indicate if the field should be ignored during marshalling - useful when used with the auto-complete option of @castor.class. | false
set-method | text |  | The method used to set the property value. | false
create-method | text |  | The factory method for instantiation of FieldHandler. | false
collection | text |  | Valid options are: array arraylist vector hashtable collection set map Default value(s): vector | false
#### @castor.field-sql (0..1)
Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | The column name the field is mapped to. | true
type | text |  | The SQL type of the field. | true
many-key | text |  | The many key of the field. | true
many-table | text |  | The many table of the field. | true
dirty | bool |  | Flag to indicate if the field is checked for dirty status or not. | false
#### @castor.field-xml (0..1)
Parameter | Type | Applicability | Description | Mandatory
--- | --- | --- | --- | ---
name | text |  | The name of the element or attribute. | true
type | text |  | XML Schema type (of the value of this field) that requires specific handling in the Castor Marshalling Framework (such as 'QName' for instance). | false
matches | text |  | Allows overriding the matches rules for the name of the element. It is a standard regular expression and will be used instead of the 'name' field. | false
QName-prefix | text |  | When using a QName value, you can provide a default prefix that is used when marshalling value of type QName. | false
reference | bool |  | Indicates if this field has to be treated as a reference by the unmarshaller. In order to work properly, you must specify the node type to 'attribute' for both the 'id' and the 'reference' fields. | false
node | text |  | Indicates if the name corresponds to an attribute, an element, or text content. By default, primitive types are assumed to be an attribute otherwise the node is assumed to be an element. Valid options are: element attribute text Default value(s): text | false
dirty | bool |  | Flag to indicate if the field is checked for dirty status or not. | false
### Tag Usage, Field Level (@castor mapping)