[hibernate-dev] "derived identifier" mapping

Steve Ebersole steve at hibernate.org
Thu Mar 27 01:26:28 EDT 2014


What's the rational for supporting the following?


@Entity
class Product {
    ...
}

@Entity
class Order {
    ...
}

@Entity
@IdClass(...)
class OrderLine {
    @Id
    private Order order;

    @Id
    private Product product;
}

Specifically, the declaration of the OrderLine primary key.  Why would
these not have to be `@Id @ManyToOne`?


More information about the hibernate-dev mailing list