Changeset 3962

Show
Ignore:
Timestamp:
03/10/08 07:06:05 (16 months ago)
Author:
jwage
Message:

Added more documentation to schema files for inheritance usage.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/manual/docs/en/schema-files.txt

    r3923 r3962  
    444444+++ Inheritance 
    445445 
     446Simple inheritance. Read about more about [doc relations:inheritance:simple-inheritance :index :name]. Any columns or relations added to the children classes will be moved to the parent. 
     447 
    446448<code type="yaml"> 
    447449--- 
    448450Entity: 
    449   actAs: [Timestampable] 
    450   columns: 
    451     id: 
    452       type: integer(4) 
    453       primary: true 
    454       autoincrement: true 
    455     username: 
    456       type: string(255) 
    457     password: 
    458       type: string(255) 
     451  columns: 
     452    name: string(255) 
     453    username: string(255) 
     454    password: string(255) 
     455 
    459456User: 
    460457  inheritance: 
    461458    extends: Entity 
     459    type: simple 
     460 
    462461Group: 
    463462  inheritance: 
    464463    extends: Entity 
     464    type: simple 
     465</code> 
     466 
     467Class table inheritance. Read about more about [doc relations:inheritance:class-table-inheritance :index :name] 
     468 
     469<code type="yaml"> 
     470--- 
     471Entity: 
     472  columns: 
     473    name: string(255) 
     474 
     475User: 
     476  inheritance: 
     477    extends: Entity 
     478    type: class_table 
     479  columns: 
     480    username: string(255) 
     481    password: string(255) 
     482    age: integer(2) 
     483</code> 
     484 
     485Concrete inheritance. Read about more about [doc relations:inheritance:concrete-inheritance :index :name] 
     486 
     487<code type="yaml"> 
     488--- 
     489TextItem: 
     490  columns: 
     491    topic: string(255) 
     492 
     493Comment: 
     494  inheritance: 
     495    extends: TextItem 
     496    type: concrete 
     497  columns: 
     498    content: string(300) 
     499</code> 
     500 
     501Column aggregation inheritance. Read about more about [doc relations:inheritance:column-aggregation-inheritance :index :name]. Like simple inheritance, any columns or relationships added to the children will be automatically removed and moved to the parent. 
     502 
     503<code type="yaml"> 
     504--- 
     505Entity: 
     506  columns: 
     507    name: string(255) 
     508    type: string(255)         # Optional, will be automatically added when it is specified in the child class 
     509 
     510User: 
     511  inheritance: 
     512    extends: Entity 
     513    type: column_aggregation  # Optional, it is implied if a keyField or keyValue is present 
     514    keyField: type            # Optional, will default to 'type' and add it to the parent class if type is column aggregation 
     515    keyValue: User            # Optional, will default to the name of the child class if type is column aggregation 
     516  columns: 
     517    username: string(255) 
     518    password: string(255) 
     519 
     520Group: 
     521  inheritance: 
     522    extends: Entity 
     523    type: column_aggregation 
     524    keyField: type 
     525    keyValue: Group 
     526  columns: 
     527    description: string(255) 
    465528</code> 
    466529