hibernate - discriminator column is not working with table per subclass -
hi all,
i using discriminator column in table per subclass inheritence mapping. entry of parent class
@entity @table(name = "employee105") @inheritance(strategy=inheritancetype.joined) @discriminatorcolumn(name="emp_type" , discriminatortype= discriminatortype.string)
and entries of subclass follows:
@entity @table(name="contractemployee105") @discriminatorvalue("p") @primarykeyjoincolumn(name="id") @entity @table(name="regularemployee105") @discriminatorvalue("t") @primarykeyjoincolumn(name="id")
i know code correct , tables being generated in insert query discriminator column not being created. using jars shown in image. kindly let me know issue. suspect issue jars or hibernate version. thanks
it's suspect problem hibernate version. bug hhh-6911 issue, , resolved in hibernate 4.2.9, 4.3.1. if version of hibernate earlier, might want upgrade. (looking @ list of jars, indeed appears case.)
as noted in stefan's answer, hibernate doesn't need discriminator in case, jpa spec says should allowed , persisted if specified.
Comments
Post a Comment