I am trying to add one-to-one bidirectional relationship on non-primary key unique key field. full code is available at https://github.com/gaurangparmar/jpa OrderHeader.java
OrderMeta.java
orderId in both tables are unique and Primary/Main entity is OrderHeader and OrderMeta is having foreign key orderId referencing to OrderHeader. Full logs are attached from test case run. I believe it is trying to fetch related entity data by primary key and ignoring specified joincolumn.
I understand one-to-one relation better have primary key as foreign key but it is really dumb key for business and ETL uses this dumb keys. we really needed this to work. |