Say I have a relationship like figure 1 (@OneToOne between Customer and AtmCard, mandatory on one side but not the other).
Am I correct to say that to enforce the mandatory aspect of the Customer on the AtmCard side, I need to future define a @JoinColumn(nullable = false)
together with my @OneToOne annotation like in figure 2?
What happens if I don't define this @JoinColumn annotation with optional
set to false?
What exactly does @JoinColumn(nullable = false) do, and why should I apply it to all @OneToOne and @ManyToOne relationships only?
For reference, figure 3 shows my annotation mappings on the Customer side. Thanks!