jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
693 stars 124 forks source link

DataGrid with KeyValueCollection fails with exception #3797

Closed Flaurite closed 4 weeks ago

Flaurite commented 1 month ago

Environment

Jmix version: 2.4.0-RC1 Caused by: https://github.com/jmix-framework/jmix/issues/3641

Bug Description

When the DataGrid specifies KeyValueCollection container, the view loading fails with exception.

Steps To Reproduce

  1. Download demo project: key-value-demo.zip

  2. Open Key value demo view

Current Behavior

Stacktrace:

java.lang.IllegalArgumentException: Property 'username' not found in sys_KeyValueEntity
    at io.jmix.core.metamodel.model.impl.MetaClassImpl.getProperty(MetaClassImpl.java:95)
    at io.jmix.core.FetchPlanBuilder.add(FetchPlanBuilder.java:110)
    at io.jmix.core.impl.FetchPlanRepositoryImpl.addAttributesToLocalFetchPlan(FetchPlanRepositoryImpl.java:279)
    at io.jmix.core.impl.FetchPlanRepositoryImpl.deployDefaultFetchPlan(FetchPlanRepositoryImpl.java:260)
    at io.jmix.core.impl.FetchPlanRepositoryImpl.retrieveFetchPlan(FetchPlanRepositoryImpl.java:421)
    at io.jmix.core.impl.FetchPlanRepositoryImpl.findFetchPlan(FetchPlanRepositoryImpl.java:215)
    at io.jmix.core.impl.FetchPlanRepositoryImpl.getFetchPlan(FetchPlanRepositoryImpl.java:190)
    at io.jmix.flowui.xml.layout.loader.component.AbstractGridLoader.loadData(AbstractGridLoader.java:136)
    at io.jmix.flowui.xml.layout.loader.component.AbstractGridLoader.loadComponent(AbstractGridLoader.java:110)
    at io.jmix.flowui.xml.layout.loader.container.AbstractContainerLoader.loadSubComponents(AbstractContainerLoader.java:37)
    at io.jmix.flowui.xml.layout.loader.container.AbstractContainerLoader.loadSubComponentsAndExpand(AbstractContainerLoader.java:74)
    at io.jmix.flowui.xml.layout.loader.ViewLoader.loadComponent(ViewLoader.java:75)
    at io.jmix.flowui.sys.ViewSupport.loadWindowFromXml(ViewSupport.java:450)
    at io.jmix.flowui.sys.ViewSupport.initView(ViewSupport.java:123)

Expected Behavior

A view is loaded and DataGrid displays data.

Flaurite commented 1 month ago

Probably relates to https://github.com/jmix-framework/jmix/issues/3641