I have an entity called Contact
that I’d like to create a OneToOne
assocation to the CUBA User
entity. Unfortunately this is not working and I’m getting this error:
class com.yieldmo.ymcuba.entity.Contact
uses a non-entity class com.haulmont.cuba.security.entity.User
as target entity in the relationship attribute [field user]
Here is an relevant part of the Contact
entity
@NamePattern("%s|name")
@Table(name = "contact")
@Entity(name = "ymcuba$Contact")
public class Contact extends BaseUniqueIdEntity {
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name="email", referencedColumnName = "LOGIN_LC")
protected User user;
I feel like I’m missing something simple but can’t tell what I"m doing wrong.