I'm working on a codebase where unidirectional JPA/Hibernate @OneToOne
mapping is used on entities where actual database relationship cardinality between the entities is many-to-one.
However, it seems the code is working fine and it looks like there are no functional issues resulting from the use of unidirectional @OneToOne
where unidirectional @ManyToOne
should be used.
I would like to address this in the codebase but would need an integration test to demonstrate the problem.
Is there any testable case in which hibernate will fail when using unidirectional @OneToOne
mapping where logically @ManyToOne
should be used?