<entity>

The <entity> element defines the structure of one data entity and will result in a table in the database, and several Java classes. Example usage of the <entity> element:

<entity name="unique_name">
    <description>This is my first entity.</description>
    <field name="name" type="string"/>
     <field name="investigation" type="string"/>
    <unique fields="name,investigation"/>
</entity>

Required attributes

  • name="name": globally unique name for this entity (within this blueprint).

Optional attributes

  • label="Nice screen name": an user-friendly alias to show as form header (default: copied from name).
  • extends="other_entity": you can use inheritance to make your entity inherit the fields of its 'superclass' using extends.
  • abstract="true": you define what programmers call 'interfaces'. This are abstract objects that you can use as 'contract' for other entities to 'implement'..
  • implements="abstract_entity": you can use inheritance to make your entity inherit the fields of its 'interface' using implements and refering to 'abstract' entities. The implemented fields are copied to this entity.
  • decorator="package.class": you can add custom code to change the way entities are added, updated and removed. See the section on how to write a MappingDecorator? plugin.

Child elements

The <entity> element can contain

  • Zero or one <description> to describe this entity; a description can contain xhtml.
  • zero or more <field> that detail entity structure.
  • Zero or more <unique> indicating unique constraints on field(s).
Last modified by mswertz, 08/22/10 23:30:55 (2 weeks ago)