Field

Description

Define a field across XML, SQL, and Java. Found inside of class elements.

Parameters

Attribute Description Required
name the name of the field (in Java). Yes
type primitive type (see list) or a fully qualified Java class name (if it should be stored it should be in a map-file which is generated along with this one.
collection currently ("vector", "array") types supported. No
len if a string field reqd if database field, and can also be used for generated validation. Only if a (database class or for validators) and a string
required boolean which defines this field to be required (NOT NULL in a db, != null in validator). No (defaults to false)

Parameters specified as nested elements

sql

provides the field name in the db and any constraints/constraint-names.

xml

provides the field name in xml.

view *(multiple)

defines any views this field belongs to.

validate *(multiple)

defines any validations needed on this field.

Examples

.. inside a class Foo
<field name="name" type="string" len="32"> 
   <sql name="foo_name" />
   <validate regex="[a-zA-Z .]*" />
   <view in="blotter" />
</field>

<field name="otherFoo" type="org.Foo" > 
   <sql name="foo_other_oid" constraint-name="foo_has_other_foo" />
   <view in="blotter" foreign-view="blotter" />
</field>

Copyright © 2000,2001,2002 Paul Bethe and Richie Bielak. All rights Reserved.