Unable to create OnetoOne association with User

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.

Could you check if the usual association using the primary key works for you?

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "USER_ID")
    protected User user;

A post was split to a new topic: Error trying to link the USER_ID column