Show/Hide Toolbars

TMS Aurelius Documentation

Navigation: Mapping > Inheritange Strategies

Single Table Strategy

Scroll Prev Top Next More

With this strategy, all classes in the class hierarchy are mapped to a single table in relational database

 

SingleTableStrategy

The concrete class of the object is indicated by the values in a special column in the table named discriminator column. This column is specified by the programmer and its content is used to identify the real class of the object. The discriminator column must be of string or integer type.

 

The advantage of this strategy is that the database is simple, and performance is optimized, since queries don't need to have too many joins or unions.

 

One disadvantage is that all columns belonging to child classes must be declared as not required, since they must be null if the row in the table corresponds to a super class.