Unit 4 - Lesson 2 - Modeling associations Flashcards
Describe indices
Indices other than primary keys can be created on database tables.
Have a stereotype INDEX on the association Structs. Can be used as a key and an index to support database accesses via this key.
CREATE INDEX ACCOUNTTYPEINDEX ON BANKACCOUNT(ACFOUNTYTYPE).
No limit on number of indexes. Speed vs database size tradeoff.
Describe foreign keys
Create association between two entity classes.
* Drag the handler from the entity containing the foreign key (child) to the parent entity.
Select the attribute names in the properties tabs.
Describe Exit points
Call back function that is executed at a predefined, strategic point by the server.
4 types supported:
* Validation - perform validation before insert and modify operations.
* Pre Data Access - e.g. reinsert()
* Post Data Access - e.g. postinsert()
* On-fail - prefixed with onFail e.g. onFailinsert()
Implemented by a developer.
Parameter to the validation function is AUTOVALIDATE - standard details struct for the entity.
Describe Auditing
Supported by all stereotyped operations except NS NSMULTI BATCHINSERT BATCHMODIFY.
Provide information about the record modifications.
Operation:
* When an operation is called, infrastructure DAL automatically inserts row on the AUDITTRAIL table.
* If optimistic locking is on, data before and after the modification is written to the AUDITTRAIL table.
Describe Assignments
It is possible to use an assign between any two structs:
* Fields with the same name are matched.
* Reduces amount of code a developer needs to write.
* Can also assign at the list level.
Assign method allows developer to copy data from one struct to another without the need for modelling or much coding. Generated code will copy all details where the names of the fields match.
Describe Aggregations
Allows one type of class to be nested within another. Structs can aggregate structs. Structs can aggregate entities. One-to-one. One-to-many.
Rules for creating indeces
The association must be given a name - which will be given to the database index. The names of the attributes of the struct class must be a subset of the names of the attributes of the entity. The struct class must not aggregate any other classes. Index names must be unique within the entire model.
Direction not important. Never explicitly reference an index.
Rules for creating foreign keys
FK associations are only allowed on entity classes
Fields referenced by a foreign key will be set to unique.
If the foreign key references the primary key of another entity, a redundant unique clause will not be generated by the Curam Generator.
Foreign keys cannot be specified on subclass entities, but can be specified between entity and extension class.
Make sure you drag association in the right way, that is, from table containing foreign key to primary key.
Fas are for enforcing referential integrity.
What is written to AUDITTRAIL
Date and time of transaction.
User ID on transaction invocation.
Table name of modified table.
Program name - FID of the function.
Transaction type - online, batch, deferred.
Operation type - create/read/update/delete.
Key info.
Details of changed data - XML format and include names of the fields referenced by the details struct, field types, new version of data, old version if OL is enabled.
Describe explicit field assignment
Selecting General properties tab for the association and specifying the field names in the role. Match for fields of different names.
Adding ASSIGNABLE association between two classes and specifying comma-separated list in the Role boxes of the General tab in the Properties view.
Specify a shadow type for aggregation
Create the aggregation
Select the Aggregation
* Select Curam tab in properties
** Change Right Shadow Class to correct type
Use the same approach for explicit assignment