I created a frontend module using cuba platform and an account entity, however when the page is loaded none of the names or photos are presented in the table. If you look into network it shows that get query returns only entity name, empty instance name and id. How to fix this? I have no experience in java or backend
package com.company.exercise.entity;
import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.StandardEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Table(name = "EXERCISE_CONTACTS")
@Entity(name = "exercise_Contacts")
@NamePattern("%s|value")
public class Contacts extends StandardEntity {
private static final long serialVersionUID = 5180754450963558385L;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "ACCOUNT_ID")
@NotNull
private Account account;
@Column(name = "CONTACT_TYPE", nullable = false)
@NotNull
private String contactType;
@Column(name = "VALUE_", nullable = false)
@NotNull
private String value;
public void setContactType(ContactType contactType) {
this.contactType = contactType == null ? null : contactType.getId();
}
public ContactType getContactType() {
return contactType == null ? null : ContactType.fromId(contactType);
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Account getAccount() {
return account;
}
public void setAccount(Account account) {
this.account = account;
}
}
Most probably this user doesn't have attribute permissions for the entity assigned. All attributes are inaccessible by default and should be explicitly permitted via a runtime or design-time role, even if "read" operation for this entity is already permitted.
Example code for design-time role:
Also the role assigned to the user should have "REST" scope, in order to be taken into account by REST API client.
https://doc.cuba-platform.com/manual-7.2/roles.html