-
Notifications
You must be signed in to change notification settings - Fork 8
RelationshipOneToOne
iraichi edited this page Apr 24, 2015
·
24 revisions
Please refer to here for general informatios about models.
If you want to define a "has one" reference between models you have to use a Reference type field.
Example of Reference in HelloKitto
Model HAIR:
ModelName: Hair
...
Fields:
Hair_Id: String(32) not null primary key
IsVisible: False
DefaultValue: %COMPACT_GUID%
.....
Model GIRL:
ModelName: Girl
Fields:
HairColor: Reference(Hair)
PhysicalName: FK_GIRL_HAIR
Fields:
HairId:
PhysicalName: HAIR_ID
...
Please note that:
- HairColor is the logical field name
- the subnode PhysicalName (in this case FK_GIRL_HAIR) is the name of the reference that Kitto will use as ALIAS to build join in Sql command text.
- the subnode Fields contains the field HairId that make up the key to the model Hair.
The subnode Fields must contain all fields that make up the key to the other model. These fields only need names, as their data types and other properties are taken from the corresponding fields in the referenced model's primary key.
Here is a more complex example with a multi-field key from a real application:
BirthCountry: Reference(Country)
PhysicalName: FK_EMPLOYEE_BIRTH_COUNTRY
Fields:
BirthCountryclass:
PhysicalName: BIRTH_COUNTRYCLASS
BirthCountryid:
PhysicalName: BIRTH_COUNTRYID
- Kitto at a glance
- Getting started
- Setup
-
Basic concepts
- Basic Materials
- Controllers
- Panel-Based
- [List] (List)
- [Form] (Form)
- [GridPanel] (GridPanel)
- [ChartPanel] (ChartPanel)
- [Tool Controllers] (Tool)
- [Login] (Login)
- [Logout] (Logout)
- [ChangePassword] (ChangePassword)
- Features
- Examples
- Developer's guide
- Library reference
- Frequently Asked Questions
- Kitto tips & tricks and how-tos
- Other information
- Kitto Enterprise