Mixing table per subclass and per hierarchy in hibernate

Posted by Xelluloid on Stack Overflow See other posts from Stack Overflow or by Xelluloid
Published on 2010-05-17T06:55:51Z Indexed on 2010/05/17 7:00 UTC
Read the original article Hit count: 285

Filed under:
|
|

In my database there are two three tables. The first one, table ABSTRACT, holds three columns

id, type, someText

This table contains all abstract information for the abstract class abstract. Now the two tables CONCRETEONE and CONCRETETWO contain all information for the concrete classes concreteOne and concreteTwo. Now I know I could use the table per subclass strategy from hibernate to create a mapping with inheritance. But as I have a column that marks the type of the concrete implementation could it be possible to create some mixed behaviour like a table per subclass strategy with an discriminator?

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about inheritance