Inheritance I've added support for Inheritance in the Hibernate metadata module (all of them). I've supposed that TABLE_PER_CLASS means 1 table per mapped class and super classes not mapped. Superclasses of the RootClass are checked for persistable attributes. For now, inheritance has to be defined on every classes of the hierarchy (actually only if you choose InheritanceType.JOINED), and because of that I do not comply with the EJB3 edr specs. I'm wondering whether I shoud add a getInheritanceStrategy() in the mapping.PersistentClass or not: - that's the easiest and most clean solution I can think of - but it will prevent Hibernate-core to have 2 different strategies in the same hierarchy (this is the case today, is expected by the spec, and we've never been found of implemeting such feature). I would be +1 on that, but I want your opinion. so we now support: - @Transient - @Column (not primaryKey, not secondaryTable) - @JoinColumn (not referencedColumnName, not primaryKey, not secondaryTable) - @Basic - @Entity - @Table (not uniqueConstraints) - @AccessType - @Id - @CascadeType - @FetchType - @GeneratorType (NONE, IDENTITY) ie non configurable ones - @ManyToOne (not optional) - @OneToMany (Set and Collection, generics version or not) - @Version - @OneToOne (not in conjunction with explicit join column, not optional) - @Inheritance - @InheritanceType (has to be defined on every classes of the hierarchy for JOINED strategy, not very clear about the TABLE_PER_CLASS strategy) - @DiscriminatorColumn - @DiscriminatorType - @InheritanceJoinColumn Next Next steps: - parameterized generators - ManyToMany - SecondaryTable - composite ids and composite fk - fix some limitations compared to the spec - refactor a bit to make it more clean -- Emmanuel Bernard [EMAIL PROTECTED] http://www.hibernate.org |
- [Hibernate] EJB3: inheritance Emmanuel Bernard
- [Hibernate] EJB3 annotations Emmanuel Bernard
- Re: [Hibernate] EJB3 annotations Gavin King