Multi-level inheritance with discriminator

14 views
Skip to first unread message

Wesley Hampton

unread,
Aug 28, 2015, 4:44:02 PM8/28/15
to cf-orm-dev
Can anyone briefly outline the expected CF + Hibernate behavior when you have have three (or more) total levels of inheritance and are using a discriminator? I'm trying to understand what is going to get stored into the discriminator columns in the actual database.

If you've got a design of components like this (discrim value in parens):
-Animal (Expecting only 'M's and 'R's stored in this table)
-Mammal (M) (Expecting only 'D's and 'C's stored in this table)
-Dog (D)
-Cat (C)
-Reptile (R) (Expecting only 'G's and 'L's stored in this table)
-Gator (G)
-Lizard (L)
-Frog (F)


What I'm actually seeing in the Hibernate SQL logs when I do this:

var frog = EntityNew('Frog');
frog.setCroak('loud');
EntitySave(frog);

I get a 'F' in the discriminator column in the Animal table (was expecting a 'R' there) and it doesn't make an attempt to send a discriminator value at all to the Reptile table, which I have set to NOT NULL, so the insert fails into the Reptile table.

Fridays aren't supposed to be this hard!!

Thanks :)
Wes

Wesley Hampton

unread,
Aug 28, 2015, 4:46:28 PM8/28/15
to cf-orm-dev
Sorry, that Reptile table I'm expecting G's, L's or F's. I forgot to mention F's in the initial post.
Reply all
Reply to author
Forward
0 new messages