|
|
|
The Model-Driven System Builder
|
|
JeeWiz Architect's Guide
|
|
|
|
Contents >
14. 'Business Object' Reference
|
|
|
14.22 Entity Object
| Superclass | attributeCollection |
| Description | Entities embody the notions of passivity and persistence.
An entity is a passive class; that is, its objects do not initiate interactions on their own.
An entity object may participate in many different use case realizations and usually outlives any single interaction.
The entity has 'attributes' as well as fields. The attributes are intended for persistent state, whereas fields are the usual working storage for the class.
Entities can participate in relationships - see the 'businessObjectMetaModel:relation' object.
The standard templates support a style of 'maintain'.
If this is present, maintenance pages for the entity - and the supporting data views and session objects - will be generated.
Entities support inheritance, with inherited keys.
The standard patterns map inherited entities to a single database table, which should be specified the same for each entity.
Keys can be inherited between entities but should not be overridden (same attribute name as a key on both super- and sub-entity)
|
Contained Lists |
| 1 |
|
| |
| 2 |
|
| |
| 3 |
|
| |
| 4 |
|
| |
| 5 |
|
| |
| 6 |
|
| |
| 7 |
|
| |
| 8 |
| Name | query |
| Type | query |
| Description | Select and finder methods.
|
| GenerateAllList | false |
|
| |
| 9 |
| Name | rolesAllowed |
| Type | String |
| Description | If no roles are specified all roles are allowed that are not explicitly prohibited,
otherwise only the specified roles are allowed.
|
| Unique | false |
|
| |
| 10 |
| Name | rolesBlocked |
| Type | String |
| Description | Members of these roles are blocked, whether they are granted permission elsewhere or not.
|
| Unique | false |
|
| |
| 11 |
| Name | rolesReadonly |
| Type | String |
| Description | If the principal is not in the roles-allowed or the roles-blocked, they may have
their access limited to read only by being included in a role here.
|
| Unique | false |
|
|
| Validation |
1.
An entity must have at least one attribute
2.
You cannot use primary key attributes and autokey attributes on the same entity
3.
There can only be one auto-key attribute on an entity
4.
There can only be one version-controller attribute on an entity
5.
An Entity must not be abstract
6.
An Entity must not be final
7.
An Entity must not be static
8.
Can not specify table-name as a SQL reserved word
9.
The 'extends' attribute on an entity must reference another entity
|
Inherited properties |
|
14.22.1 Property 'tableName'
|
| Description | The table-name is the name of a table on a database (or its equivalent if a different persistence technology is used.
The default is the name of the entity, with '_' characters preceding any upper-case characters in the body of the name.
For example, if name='customer', then the default table name will be CUSTOMER.
If name='customerAccount', then the default table name will be CUSTOMER_ACCOUNT.
|
| Type | String |
14.22.2 Property 'attributesToCreateFromRelation'
|
| Description | This ListMap is set up by the jar's initialiseComponent() method.
It contains a list of Strings, containing the names of foreign key attributes.
The pattern for the entity should create foreign-key objects under the entity using the listed names and the type on the related key.
|
| Type | ListMap |
| Default | new ListMap() |
| Hidden | true |
14.22.3 Property 'entityEndList'
|
| Description | This ArrayList is set up by the jar's initialiseComponent() method - it is therefore available to includeSpec.vm patterns and rendering.
It contains all the ends on this entity where the key map list is available
(i.e. where the end's 'entity' attribute names this list).
It allow patterns in the entity to process their ends.
It is called 'entityEndList' to distinguish it from the relation's endList.
|
| Type | ArrayList |
| Default | new ArrayList() |
| Hidden | true |
14.22.4 Property 'allEndList'
|
| Description | This ArrayList contains all End's that attach to this entity, whether or not they are navigable.
|
| Type | ArrayList |
| Default | new ArrayList() |
| Hidden | true |
14.22.5 Property 'entityRelList'
|
| Description | This ArrayList is set up by the jar's initialiseComponent() method - it is therefore available to includeSpec.vm patterns and rendering.
It contains all the ends on this entity whether the key map is available or not. This makes a difference
from entityEndList for one-to-one relationships as the foreign key access is from one end only, but we can
access the proxies' accessors and mutators from either end of the relationship.
It allow patterns in the entity to process their ends, and possibly add foreign keys to the value object.
It is called 'entityEndList' to distinguish it from the relation's endList.
|
| Type | ArrayList |
| Default | new ArrayList() |
| Hidden | true |
14.22.6 Property 'container'
|
| Description | This is passed up to the generated data-view and then to the crud page generation routine to determine
where in the menu hierachy the crud pages should be placed. It has no effect if generate-data-view,
generate-maintenance-session or generate-maintenance-pages are false.
|
| Type | String |
14.22.7 Property 'generateTableSchema'
|
| Description | Set this flag to 'true' to generate the table schema for this entity. To prevent the automatic generation, set it to false.
This also affects descriptor generation for app servers such as WebSphere. A similar field appears on relation to control the creation of link tables.
By default it is set to 'true'.
|
| Type | boolean |
| Default | true |
14.22.8 Property 'generateMaintenancePages'
|
| Description | Set this flag to 'true' to generate the maintenance pages for the data-view generated for this entity.
By default it is set to 'true'.
To prevent the automatic generation of maintenance pages for the data-view (which is unlikely), set it to false.
|
| Type | boolean |
| Default | true |
14.22.9 Property 'permissionGroup'
|
| Description | The permission group element specifes the default group membership required for access to methods on the entity.
|
| Type | String |
14.22.10 Property 'versionControl'
|
| Description | version-control switches on optimistic record locking, adding a version attribute to the entity and a column
to the table which is checked prior to an update at the persistence layer. If the version number
is different the update is aborted with a runtime exception. This is set globally in system.property
at the bizobject level.
|
| Type | boolean |
| Delegates | true |
14.22.11 Property 'entityTriggers'
|
| Description | Requests that onLoad() and onStore() methods be generated on the entity's implementation class.
These methods allow the programmer to implement
- specialised data manipulation after execution of the standard CMP retrieval (onLoad)
- specialised data manipulation before execution of the standard CMP update/create (onStore)
This field is only relevant when the alwaysGenerateTriggers flag is not set;
if alwaysGenerateTriggers is set (which is likely to be done as a global setting), the above methods will be generated.
|
| Type | boolean |
| Default | false |
14.22.12 Property 'dataviewTriggers'
|
| Description | Requests that onLoad(), onStore() and overrideDataRetrieval() methods be generated on the maintenance dataview's implementation class.
These methods allow the programmer to implement
- specialised data manipulation after execution of the standard SQL-based retrieval (onLoad)
- specialised data manipulation before execution of the standard SQL-based update/create (onStore)
- overriding of the SQL-based data retrieval mechanism (for example, to access external systems).
This field is only relevant when the alwaysGenerateTriggers flag is not set;
if alwaysGenerateTriggers is set (which is likely to be done as a global setting), the above methods will be generated.
|
| Type | boolean |
| Default | false |
14.22.13 Property 'lockOnRead'
|
| Description | Dataview uses "select for update", locking the row for the transaction.
Columnar locking (ie. select for update of ... ) is unavailable.
On an Entity, lock-on-read acts on the default dataview.
|
| Type | boolean |
| Default | false |
14.22.14 Property 'generateDataViewForEntity'
|
| Description | Set this to 'true' to generate the data view for this entity.
By default, data views are generated for entities based on a setting in the system.properties file.
If you want to disable this for a particular object, set the value to 'false'.
The default pattern copies all fields from the entity to the data-view.
|
| Type | boolean |
| Delegates | true |
14.22.15 Property 'convertEmptyStringsToNull'
|
| Description | This delegated property when set causes empty values, on input (e.g. on screens) into optional fields, to be converted to null.
This property is present on the attribute or data-view-field and their parents.
This property has no effect on required values.
By default, this property is set (in the Business Object Model's system.properties).
If this value is not set, there is no way to express 'no value' on input screens.
|
| Type | boolean |
| Delegates | true |
14.22.16 Property 'generateMaintenanceSession'
|
| Description | Set this flag to 'true' to generate the maintenance session bean for this data-view.
This is a delegated property, so it can be set in the jar/assembly, application or top-level configuration properties.
By default it is set to 'true'.
If you want to disable this for a particular object, set the value to 'false'.
The standard patterns will automatically generate methods on the session bean to
- search for the object
- view/update the object
- delete the object.
|
| Type | boolean |
| Default | true |
| Delegates | true |
14.22.17 Property 'screenPosition'
|
| Description | A numeric value indicating the position of this page or field within a group.
This affects the position of the item's display on the screen, relative to other members of the group.
The value is a string of 1-6 digits; the order is calculated numerically rather than alphabetically - so 25 is higher than 5.
Lower-valued positions appear first.
If this is not specified, then the order of controls within a group is determined by the order in the XML specification file.
The order within the specification can be set if the XML is being specified directly and this field need not be specified.
However, for specifications from UML design tools this may not be possible and it will be necessary to set this field to control screen order.
|
| Type | String |
| Delegates | true |
Copyright (c) 2001-2008 New Technology/enterprise Ltd.
| |