Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
DeprecatingEntities
DeprecatingEntities

Note
titleNaming entities and their fields

Here are some conventions, or say patterns, which are common for defining an Entity and its Fields.

  • Entity name must be in UpperCamelCase.
  • If entity name is abbreviation like Unit Od Measure (UOM) then treat it as one word and name is like Uom.
  • The Field name must be in lowerCamelCase and name should be self descriptive enough to show the purpose of the field.
  • If relation tag specify the relationship between two entities then the fk-name should contains the words from both entities separated by ("_") underscore.
  • If a entity relation with another entity defines more than one time then it should be differentiated by title attribute while defining a relation like "Form" or "To".
  • In the same if both fields in the <key-map> tag are same then no need to specify rel-field-name.
  • In case of view entities the name will consist of names of all its member entities.
  • The <view-link> should be define for proper view in the webtools.

Apart from the above you can also refer to entitymodel.xsd for understanding the tags.

Anchor
DeprecatingEntities
DeprecatingEntities

Warning
titleDeprecating entities

Whenever we deprecate an entity in OFBiz there are certain things that MUST be done or all committers should reject the patch:

  1. rename the entity to deprecate by adding an "Old" prefix to it, then specify a table-name attribute on the entity so it still points to the same table in the database
  2. create a new entity the replaces the old one, and comment on that fact
  3. implement a service to move data from the old/deprecated entity to the new one

...