| /** |
| * Example for persistence with the "inheritance per class" strategy |
| * |
| * The "Inheritance per class" strategy causes subclasses to share the database tables |
| * of their parent classes. In order to be able to tell the types of the entries apart, a |
| * discriminator has to be used. |
| * |
| * Thus, a single table is created that has the columns of all entities that share it (causing |
| * a tradeoff between database size and access speed). |
| * |
| * "inheritance per class" needs to be declared in the topmost entity that should share the |
| * common table. The setting is then inherited by children. |
| * |
| * The example below shows the declaration of custom values; inheritance per class |
| * declarations have been added to sub-entities in order to override default values. This would |
| * not have been necessary. |
| */ |
| package org.eclipse.osbp.entitydsl.samples.sample06.dtos { |
| |
| /* Imports the required artifacts */ |
| import org.eclipse.osbp.entitydsl.samples.sample06.*; |
| import org.eclipse.osbp.entitydsl.samples.sample06.dtos.*; |
| import org.eclipse.osbp.entitydsl.samples.sample06.dtos.mapper.*; |
| |
| |
| autoDto VehicleDto wraps Vehicle { |
| inherit var id; |
| inherit var name; |
| } |
| |
| autoDto BikeDto extends VehicleDto wraps Bike { |
| inherit var bikedescription; |
| inherit var price; |
| } |
| |
| autoDto BoatDto extends VehicleDto wraps Boat { |
| inherit var boatdescription; |
| inherit var price; |
| } |
| |
| } |