[storm] subclassing and foreign keys with respect to properties from parent

James Henstridge james at jamesh.id.au
Wed Aug 13 03:00:38 BST 2008


On Wed, Aug 13, 2008 at 4:46 AM, Olaf Conradi <olaf at conradi.org> wrote:
> Hello,
>
> I am experimenting with subclassing (or inheritance), and I noticed
> the example in https://storm.canonical.com/Tutorial#References%20and%20subclassing.
>
> Why does table employee have a column called "name" in its create
> table statement?
>
> I would have expected that Employee.id is a foreign key to Person.id
> and that Employee.name gets mapped to Person.name through the foreign
> key.
>
> Or should this be done explicitly with a Reference and Proxy? And does
> this mean that Employee should not subclass Person anymore?

Storm does not use subclassing to create foreign key relationships.
What that part of the tutorial is doing is saying "the employee table
shares the same field definitions as the person table, plus these
extra ones".  There is no person record created when you add a record
to the employee table.

James.



More information about the storm mailing list