Hi Manny,
what you have is:
User: OneToMany to Account
Account: ManyToOne to User
You mustn't use OneToOne on the Account-side.
Here's an example:
I have a ManyToOne relationship between Item and Definition. I have annotated both ends of the relationship:
Code:
class Definition {
private List<Item> items;
@OneToMany(mappedBy="definition")
public List<Item> getItems() {
return items;
}
}
class Item {
private Definition definition;
@ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
@JoinColumn(name="DEFINITION_ID")
public Definition getDefinition() {
return definition;
}
}
In your case, it's the same with Item = Account and Definition = User.
hope this helps.