Hello!
I’ve extended User entity with new fields. All ok, except when I try to change to substituded user there is Exception:
IllegalStateException: Cannot get unfetched attribute [name] from detached object com.company.nl.entity.ExtUser-ea95eb71-2375-1caf-ead7-3c3fffd8bbbf [detached].
All other screens work ok
How to set right view to UserIndicator when user is changed?
Below full error log:
java.lang.IllegalStateException: Cannot get unfetched attribute [name] from detached object com.company.nl.entity.ExtUser-ea95eb71-2375-1caf-ead7-3c3fffd8bbbf [detached].
at org.eclipse.persistence.internal.queries.EntityFetchGroup.onUnfetchedAttribute(EntityFetchGroup.java:98)
at com.haulmont.cuba.core.sys.persistence.CubaEntityFetchGroup.onUnfetchedAttribute(CubaEntityFetchGroup.java:74)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.processUnfetchedAttribute(EntityManagerImpl.java:2846)
at com.haulmont.chile.core.model.impl.AbstractInstance._persistence_checkFetched(AbstractInstance.java)
at com.haulmont.cuba.security.entity.User._persistence_get_name(User.java)
at com.haulmont.cuba.security.entity.User.getName(User.java:130)
at com.haulmont.cuba.web.gui.components.mainwindow.WebUserIndicator$SubstitutedUserChangeListener.valueChange(WebUserIndicator.java:234)
at sun.reflect.GeneratedMethodAccessor411.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:200)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:163)
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1037)
at com.vaadin.ui.AbstractField.fireValueChange(AbstractField.java:1199)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:600)
at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:738)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:494)
at com.vaadin.ui.ComboBox.changeVariables(ComboBox.java:750)