Issue Type: Bug Bug
Affects Versions: 4.1.8
Assignee: Unassigned
Components: annotations
Created: 21/Sep/12 8:19 AM
Description:

When an entity (such as Customer) has a @OneToMany relationship with a specific entity subclass of an entity where the owning relationship field is defined, Hibernate does not find the appropriate property on the superclass.

@Entity
public class Customer {
  @OneToMany(mappedBy = "customer")
  private Set<SpecialOrder> specialOrders;

  @OneToMany(mappedBy = "customer")
  private Set<RegularOrder> regularOrders;
}

@Entity
public abstract class AbstractOrder {
  @ManyToOne
  private Customer customer;
}

@Entity
public class SpecialOrder extends AbstractOrder {
  private Date shippingDate;
}

@Entity
public class RegularOrder extends AbstractOrder {
  private Integer storeNumber;
}

This or a similar bug was reported before but was closed as WONTFIX without explanation. We encountered this bug after refactoring our code to support differing metadata on different order types, and this seems like a clear case of the sort of field that should be placed on the supertype (though unfortunately the 2.0 spec doesn't address the issue at all).

see <ANN-390>

Environment: 4.2.0 snapshot for 2012-09-19
Project: Hibernate ORM
Labels: hibernate jpa2
Priority: Blocker Blocker
Reporter: Christopher Smith
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira