JeeWiz Home  
The Model-Driven System Builder

JeeWiz Architect's Guide
 
Contents  >   14.  'Business Object' Reference
 


14.22 Entity Object

SuperclassattributeCollection
DescriptionEntities 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
Name  typeParameter
Type  java:typeParameter
Inherited from  java:referenceType
 
2
Name  import
Type  String
Inherited from  java:referenceType
 
3
Name  field
Type  java:field
Inherited from  internalClass
 
4
Name  method
Type  java:method
Inherited from  internalClass
 
5
Name  implements
Type  String
Inherited from  java:jwclass
 
6
Name  constraint
Type  constraint
Inherited from  internalClass
 
7
Name  style
Type  String
Inherited from  internalClass
 
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
name from java:referenceType.name

description from java:interfaceMethod.description

template from java:interfaceMethod.template

text from java:method.text

jwpattern (base property)

typeDeclaration from java:referenceType.typeDeclaration

extends from java:referenceType.extends

headerComment from java:referenceType.headerComment

customerHeaderComment from java:referenceType.customerHeaderComment

package from baseViewRelation.package

generateLogLevel from constraint.generateLogLevel

access from businessMethod.access

annotation from java:interfaceMethod.annotation

abstract from java:method.abstract

static from java:method.static

serializable from java:jwclass.serializable

final from java:method.final

alwaysGenerateTriggers from internalClass.alwaysGenerateTriggers

constraintExceptionType from constraint.constraintExceptionType

uid from constraint.uid

group from businessMethod.group

userNameBase from businessMethod.userNameBase

generatePagesForBusinessMethods from businessObject.generatePagesForBusinessMethods

 14.22.1  Property 'tableName'
 14.22.2  Property 'attributesToCreateFromRelation'
 14.22.3  Property 'entityEndList'
 14.22.4  Property 'allEndList'
 14.22.5  Property 'entityRelList'
 14.22.6  Property 'container'
 14.22.7  Property 'generateTableSchema'
 14.22.8  Property 'generateMaintenancePages'
 14.22.9  Property 'permissionGroup'
 14.22.10  Property 'versionControl'
 14.22.11  Property 'entityTriggers'
 14.22.12  Property 'dataviewTriggers'
 14.22.13  Property 'lockOnRead'
 14.22.14  Property 'generateDataViewForEntity'
 14.22.15  Property 'convertEmptyStringsToNull'
 14.22.16  Property 'generateMaintenanceSession'
 14.22.17  Property 'screenPosition'

14.22.1  Property 'tableName'
DescriptionThe 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.
TypeString

14.22.2  Property 'attributesToCreateFromRelation'
DescriptionThis 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.
TypeListMap
Defaultnew ListMap()
Hiddentrue

14.22.3  Property 'entityEndList'
DescriptionThis 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.
TypeArrayList
Defaultnew ArrayList()
Hiddentrue

14.22.4  Property 'allEndList'
DescriptionThis ArrayList contains all End's that attach to this entity, whether or not they are navigable.
TypeArrayList
Defaultnew ArrayList()
Hiddentrue

14.22.5  Property 'entityRelList'
DescriptionThis 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.
TypeArrayList
Defaultnew ArrayList()
Hiddentrue

14.22.6  Property 'container'
DescriptionThis 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.
TypeString

14.22.7  Property 'generateTableSchema'
DescriptionSet 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'.
Typeboolean
Defaulttrue

14.22.8  Property 'generateMaintenancePages'
DescriptionSet 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.
Typeboolean
Defaulttrue

14.22.9  Property 'permissionGroup'
DescriptionThe permission group element specifes the default group membership required for access to methods on the entity.
TypeString

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.
Typeboolean
Delegatestrue

14.22.11  Property 'entityTriggers'
DescriptionRequests 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.
Typeboolean
Defaultfalse

14.22.12  Property 'dataviewTriggers'
DescriptionRequests 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.
Typeboolean
Defaultfalse

14.22.13  Property 'lockOnRead'
DescriptionDataview 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.
Typeboolean
Defaultfalse

14.22.14  Property 'generateDataViewForEntity'
DescriptionSet 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.
Typeboolean
Delegatestrue

14.22.15  Property 'convertEmptyStringsToNull'
DescriptionThis 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.
Typeboolean
Delegatestrue

14.22.16  Property 'generateMaintenanceSession'
DescriptionSet 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.
Typeboolean
Defaulttrue
Delegatestrue

14.22.17  Property 'screenPosition'
DescriptionA 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.
TypeString
Delegatestrue
 


Copyright (c) 2001-2008 New Technology/enterprise Ltd.