11.12 Entity Object
| Used on |
|
| 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.
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, which are realised as methods on the class.
|
Contained Lists |
| 1 |
| Name | attribute |
| Type | attribute
|
| Description | The list of fields and attributes for this internal class.
|
| Indexed property | name |
|
| |
| 2 |
| Name | method |
| Type | method
|
| Description | The list of methods and business-methods for this internal class.
|
| Indexed property | name |
|
| |
| 3 |
| Name | field |
| Type | field
|
| Description | The list of fields and attributes for this internal class.
|
| Indexed property | name |
|
| |
| 4 |
| Name | relation |
| Type | relation
|
| GenerateAllList | false |
|
| |
| 5 |
| Name | entity |
| Type | entity
|
| Description | This list defines the master/subsidiary relationship between entities.
For example, 'Order' would have 'OrderLine' on its subordinate entity List (as long as your application does follow the normal grouping for these entities!).
Multiple levels of subsidiary entity nesting are allowed.
For example, a 'Customer' entity can have 'Order' entities as subsidiaries, which in turn can have 'OrderLine's.
|
| GenerateAllList | false |
|
|
Inherited properties |
|
11.12.1 Property 'dataSource'
|
| Description | The dataSource can be defined for a master entity. It is not necessary if there is only one dataSource; if there is more than one dataSource , it is required.
There is no need to specify the dataSource for subsidiary entities; if they are specified, they must agree with the dataSource on their master entities.
|
| Type | String |
11.12.2 Property 'description'
|
| Description | Optional description.
Use this to
- document the meaning of a particular item
- specify functionality at the design stage for implementation later.
|
| Type | String |
11.12.3 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 |
11.12.4 Property 'extends'
|
| Description | Specifies the class or interface that this class or interface extends from. This field is optional.
The value of 'extends' can be
- an external class - in which case it must have a '.' in it
- a reference to a class or interface in another model, in 'model:object' form
- or the name of a class or interface in this model, without either a '.' or ':'.
References to simple classes must be fully-qualified if the referenced class is not in the same package as the current class.
Business objects (entities, sessions, etc.) in the businessObject model normally reference each other by name only
and there is then a restriction that business object names of a certain type must be unique
(e.g. you can't have two entities named 'E').
The 'extends' type is added to the 'implements' list in C# and the appended to the class name with ':'
(e.g. "class C : ExtendedClass,ImplementedInterface {}" ).
In Java systems, the 'extends' keyword is used.
|
| Type | String |
11.12.5 Property 'name'
|
| Description | Specifies name of the interface or class.
This should be a valid Java identifier name and will be used as-is as the interface or class name.
|
| Type | String |
| Required | true |
11.12.6 Property 'persistenceStyle'
|
| Description | These are various styles of using persistence. Future versions may add additional options, e.g. 'standing data'.
|
| Type | String |
| Choices |
| inMemoryAndPersistentStore (default) |
| inPersistentStoreOnly |
| inMemoryOnly |
| custom |
|
| Default | inMemoryAndPersistentStore |
11.12.7 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 |
11.12.8 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 |
|