Discriminator usage [One inherited hierarchy tree is mapped to a table, use this tag]

xiaoxiao2021-03-06  21

For example, object Person is a base class, OldPerson and YoungPerson are subclasses to inherit Person. They are mapped to T T_Person, to DIS, define Discriminator-Value: Person -> P OldPerson -> O YoungPerson -> Y When T_Person generates data of the Person object, the value of the DIS is "P" "; Oldperson corresponds to the DIS value of" O "; YoungPerson is" Y ". This will know which object is belonging to a row of data of the T_Person table.

example:

转载请注明原文地址:https://www.9cbs.com/read-43284.html

New Post(0)