reset password
Author Message
jgreen
Posts: 23
Posted 11:59 Nov 03, 2009 |

Hi Professor Sun,

i am running into issues with discriminators - hibernate is giving me an error about not being able to create the set of assignments that are contained within the Section class because Assignment does not have a discriminator.  When I go to add a discriminator to Assignment, I get errors from the db side saying that there is no discriminator column.

So, I added a discriminator column, but that puts the sql-test-insert script out of date.  Should I be updating that script as well, or is this a sign that I should be taking another approach?

Thanks.

ashoush
Posts: 25
Posted 12:11 Nov 03, 2009 |

I think you can define a default value for the assignment_type field, so in case that the value is not defined while inserting, that default value will be used. Here is one way to do that:

 

   ALTER TABLE assignments
        ALTER assignment_type SET DEFAULT 'REGULAR' ;

 

 

jgreen
Posts: 23
Posted 12:33 Nov 03, 2009 |

Thank you!