Hibernate @ManyToOne optional=true fetches parent in a separate select with FetchType.LAZY
问题 Hibernate optional @ManyToOne relationship still fetches the Parent in a separate select optional=true and fetch=FetchType.Lazy Child @ManyToOne //may not exist @JoinColumns({ @JoinColumn(name="parent_key1", insertable=false, updatable=false), @JoinColumn(name="parent_key2", insertable=false, updatable=false) }) Parent parent Note, that I can have a value for parent_key1 , parent_key2 columns existing in Child table but a corresponding Parent need not exist with this key, that's why the