I have 3 levels of classes a) @MappedSuperclass public abstract class CmpntObject implements Comparable, Serializable { @Column(name = "enabled") private Boolean enabled = Boolean.TRUE; }
b)@Entity @Table(name = "asmnt_item", schema = "public") @DiscriminatorColumn(name = "question_type_enum", discriminatorType = DiscriminatorType.STRING) public abstract class Item extends CmpntObject implements Comparable { @Column(name = "valid") private Boolean valid = Boolean.TRUE; other columns.. }
c) @Entity @DiscriminatorValue(value = "1") public class SpecificItem extends AbstractItem { }
and when i do the following:
SpecificItem specificItem = new SpecificItem (); specificItem.setEnabled(false); specificItem.setValid(false); session.saveOrUpdate(specificItem);
it persists the valid field (1 level up in the hierarchy) correctly in the database, but does not persist the enabled field (2 levels up in the hierarchy).
Is it a Hibernate issue, wherein it would not persist fields more than 1 level up the hierarchy?
|