In my Entity OAUser.java, I defined this:
@OneToOne
@JoinColumn(name="roleID",referencedColumnName="id")
private OARole role;
In my Entity OARole.java, there are only two field:
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private
String roleName;
When TOPLink generate tables, the type of column roldID in table OAUser is varchar(255), and the foreign key generation failed, why?
Toplink execute "ALTER TABLE OAUSER ADD CONSTRAINT FK_OAUSER_roleID FOREIGN KEY (roleID) REFERENCES OAROLE (id)" and encounter an error, because the roleID column in OAUSER is varchar type and the id in OAROLE is number type.
SCJP,SCWCD1.3,SCWCD1.4,SCJD,SCBCD5,SCEA5