I have two entities: Credential and Account. Credential entity should have unique e-mail, unique nickname and password, all strings. Account must have one single and unique Credential and other non important attributes. I thought about using e-mail as PK on Credential and on Account. Is this a good approach? I tried to implement that but as you can see here I didn't solve my problem at all. What would be a good coding practice to do this?
Unique OneToOne would be considered a good option? How I should use JPA notations to do so? I know this question can be opinion-based, but I don't even have the options to choose from. I would like to know what basic rules I should follow to implement this concept.