Test case pushed: https://github.com/hibernate/hibernate-orm/commit/4d461cc44ebe0f017c6a79471e8e8f77c48450fc
Strong Liu, I might need a bit of help after all.
In ProductDetails, change
@ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.ALL}) @JoinColumns({ @JoinColumn(name = "id_product", referencedColumnName = "id_product", nullable = false), @JoinColumn(name = "id_product_version", referencedColumnName = "id_product_version", nullable = false) }) private Product product;
to
@ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.ALL}) @JoinColumn(name = "id_product_version", referencedColumnName = "id_product_version", nullable = false) private Product product;
, the "id_product_version" logical name is bound for the product table first, then product_details (as it should be).
The FkSecondPass correctly has both Columns if the @JoinColumns is left in place. So, I believe that's bound correctly.
I'm having trouble understanding if the problem is in:
Test case pushed: https://github.com/hibernate/hibernate-orm/commit/4d461cc44ebe0f017c6a79471e8e8f77c48450fc
Strong Liu, I might need a bit of help after all.
In ProductDetails, change
to
, the "id_product_version" logical name is bound for the product table first, then product_details (as it should be).
The FkSecondPass correctly has both Columns if the @JoinColumns is left in place. So, I believe that's bound correctly.
I'm having trouble understanding if the problem is in: