Sql

Description

Define a sql name and constraints/constraint-names for a field. Found in a field element.

Parameters

Attribute Description Required
name the name to use in an sql table. Yes
inline if true store this object in this classes table (not seperate). No (defaults to false)
prefix the name to use in front of the inline object. If inline='true'
constraint-name a constraint name for referential integrity (if composite field) or check constraint If this field is a DB object or constraint= is specified
constraint for simple-types (ie ="> 0" for integers). No
unique if this column should have (UNIQUE) constraint in the db. No

Parameters specified as nested elements

NONE

Examples

  
<field name="name" type="string" >
   <sql name="foo_name" unique="true" / >
</field >
  
<field name="currencty" type="org.Currency" >
   <sql name="currency" inline="true" prefix="curr" / >
</field >
Note: inline objects should only contain native types (no Collections or sub objects)
  
<field name="myBar" type="org.Bar" >
   <sql name="foo_bar_oid" constraint-name="foo_has_valid_bar" / >
</field >
  
<field name="accountBalance" type="double" required="true" >
   <sql name="foo_acc_bal" constraint=">= 0" 
              constraint-name="foo_acc_bal_ge_zero" / >
</field >

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