How to create screen brow with TreeTable with hierarchies entity

I have a entity with hierarchical parent same Counterparties category:
public class DmNhomDoiTuong extends StandardEntity {
private static final long serialVersionUID = -5186947233276866359L;

@Lookup(type = LookupType.DROPDOWN, actions = {"lookup", "clear"})
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
protected DmNhomDoiTuong parent;

@NotNull
@Column(name = "MA", nullable = false, unique = true, length = 9)
protected String ma;

@NotNull
@Column(name = "TEN", nullable = false)
protected String ten;

I create new browser screen with table type “TreeTable” and Hierarchical property: “parent”
Untitled
But on run application create a new entity re reopen browser screen has issue:
IllegalStateException: Cannot get unfetched attribute [parent] from detached object com.company.triaxerp.entity.catalogs.DmNhomDoiTuong-274d3032-db4e-965b-c945-025337d739f1 [detached].
How to fix it

Hi,

You need to create a view that contains the reference attribute.

Regards,
Gleb

I was created a view contains the parent reference attribute. Then error not found, but on Edit screen parent input field auto disenabled; so can not create new hierarchy entity of previous entity, can not chose attribute parent


Please show me the way do this. Thanks!

I remove old edit screen and re create new edit screen works is ok.
Thanks!