Re: [hibernate-dev] Is unidirectional one-to-one referencing a non-primary key valid

2018-03-08 Thread Steve Ebersole
Well now you are asking 2 different questions I think: 1) Is this a conceptually valid mapping? Which is what you explicitly asked originally. I said that imo the mapping itself is conceptually valid. 2) Do we support this? Clearly not. More in line... On Thu, Mar 8, 2018, 4:38 PM Gail

Re: [hibernate-dev] Is unidirectional one-to-one referencing a non-primary key valid

2018-03-08 Thread Gail Badner
Hi Steve, I know that a bidirectional one-to-one association works properly with Product#productInfo on the "mappedBy" side, and ProductInfo#product on the owning side. With that mapping, ProductInfo#product is a ManyToOne that is a "logical" OneToOne. I agree that is the more natural way to map

Re: [hibernate-dev] Is unidirectional one-to-one referencing a non-primary key valid

2018-03-08 Thread Steve Ebersole
For sure our model can handle this mapping, although maybe only from the other side (that's generally the more natural mapping) - internally it's called a "logical many-to-one". Personally I'd say there is nothing wrong with the mapping per-se. On Wed, Mar 7, 2018 at 4:36 PM Gail Badner

[hibernate-dev] Is unidirectional one-to-one referencing a non-primary key valid

2018-03-07 Thread Gail Badner
Hi, This is an unusual mapping. My gut feeling is that it is not a valid mapping, but I don't see anything in the spec that would indicate it is invalid. Here is the mapping: @Entity public class Product { @Id @Column(name = "id") private int id; @OneToOne(cascade =