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”
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