WorkingWithConventions

The RDB DAS makes use of a concept referred to as ConventionOverConfiguration. This concept reflects the notion that configuration can be avoided by following convention and that this is generally a good thing.

The DAS offers several conventions to reduce the need for configuration and we are considering the addition of more. The following is the current set.

Primary Key

The DAS must know the primary key of a table in order to generate a correct INSERT, UPDATE or DELETE statement. The primary key definition can be provided in the configuration. However, if the tables follow the convention that the primary key is named "ID" then no configuration to define the key is necessary. In the absence of configuration to the contrary, the DAS will assume that a DataObject property named "ID" represents the key column in the underlying database table.

Foreign Key Relationships

Similar to the way primary keys are handled, the DAS will assume that a property named "xxx_ID" represents a foreign key column in the underling database and further, that this foreign key references table "xxx". If the application developer has the luxury of defining the database tables then the explicit definition of relationships via a config file is unnecessary if this convention can be followed.

TBD - What is the default name of the relationship?

Name Mappings

In the absence of configuration to the contrary, the DAS will use a simple implicit mapping from Table/Column names to DataObject Type/Property names. An example of this convention is provided in ConventionOverConfiguration.

Optimistic Concurrency Control

This section is TBD. As of the current M2 release candidate, the absence of OCC configuration means that no collision detection will be performed. We are considering having the default behavior be to overqualify the update statement with all modified columns.

Partial Update

Unless otherwise specified, the RDB DAS will default to a scheme where INSERT/UPDATE/DELETE statements are generated based on the change summary (ChangeSummaryProcessing) associated with the modified datagraph. The DAS will not generate an UPDATE statement that updates all table columns. Instead, the DAS will update only those columns that were actually modified in the graph.

  • No labels