1. PrimaryKeyJoinColumn: http://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#identifiers-derived
{code:java} @OneToOne @PrimaryKeyJoinColumn // bug here?: no FOREIGN KEY in table sql. private Person person;
@OneToOne // will generate a FOREIGN KEY in table sql. private Person person2; {code}
2. PrimaryKeyJoinColumn not support the referencedColumnName attr?
3. the referencedColumnName att will add a UNIQUE KEY named "UK_xxx" to the target table even @ManyToOne
{code:java} @JoinColumn(referencedColumnName = "attrB") @ManyToOne(targetEntity = ClassB.class) private Long attrA; {code}
4. referencedColumnName can not work with FetchType.LAZY? |
|