I have an object mapped to One-To-One according to the following code:
@Entity @Table(name = "my_entity") public class MyEntity { ... @OneToOne @JoinColumn(name = "site_id") private Site site; ... }
I was just told that I should start storing MyEntity records with a value for 'site_id' that might not exist in the site table. I still need to save the value for "site_id", however it will not match the essence of the site.
The only thing I can think of is to create a 2nd Entity type mapped to the same table that does not display a one-to-one / join in the site table.
Is there a way to do this without creating a second mapped object for the same table?
thanks paul.
hibernate one-to-one
pstanton
source share