Здравствуйте, есть сущность TestEntity
@JmixEntity
@Table(name = "JY_TEST_ENTITY")
@Entity(name = "jy_TestEntity")
open class TestEntity {
@JmixGeneratedValue
@Column(name = "ID", nullable = false)
@Id
var id: UUID? = null
@Column(name = "COMMENT")
var comment: String? = null
@DeletedBy
@Column(name = "DELETED_BY")
var deletedBy: String? = null
@DeletedDate
@Column(name = "DELETED_DATE")
@Temporal(TemporalType.TIMESTAMP)
var deletedDate: Date? = null
@CreatedBy
@Column(name = "CREATED_BY")
var createdBy: String? = null
@CreatedDate
@Column(name = "CREATED_DATE")
@Temporal(TemporalType.TIMESTAMP)
var createdDate: Date? = null
@LastModifiedBy
@Column(name = "LAST_MODIFIED_BY")
var lastModifiedBy: String? = null
@LastModifiedDate
@Column(name = "LAST_MODIFIED_DATE")
@Temporal(TemporalType.TIMESTAMP)
var lastModifiedDate: Date? = null
@Column(name = "VERSION", nullable = false)
@Version
var version: Int? = null
}
с экраном
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://jmix.io/schema/ui/window"
xmlns:c="http://jmix.io/schema/ui/jpql-condition"
caption="msg://testEntityBrowse.caption"
focusComponent="testEntitiesTable">
<data readOnly="true">
<collection id="testEntitiesDc"
class="com.company.jmixtest.entity.TestEntity">
<fetchPlan extends="_base"/>
<loader id="testEntitiesDl">
<query>
<![CDATA[select e from jy_TestEntity e where e.createdBy = :current_user_username]]>
</query>
</loader>
</collection>
</data>
<facets>
<dataLoadCoordinator auto="true"/>
<screenSettings id="settingsFacet" auto="true"/>
</facets>
<actions>
<action id="lookupSelectAction"
caption="msg:///actions.Select"
icon="LOOKUP_OK"
primary="true"
shortcut="${COMMIT_SHORTCUT}"/>
<action id="lookupCancelAction"
caption="msg:///actions.Cancel"
icon="LOOKUP_CANCEL"/>
</actions>
<dialogMode height="600"
width="800"/>
<layout expand="testEntitiesTable" spacing="true">
<filter id="filter"
dataLoader="testEntitiesDl">
<properties include=".*"/>
</filter>
<groupTable id="testEntitiesTable"
width="100%"
dataContainer="testEntitiesDc">
<actions>
<action id="create" type="create"/>
<action id="edit" type="edit"/>
<action id="remove" type="remove"/>
</actions>
<columns>
<column id="comment"/>
</columns>
<simplePagination/>
<buttonsPanel id="buttonsPanel"
alwaysVisible="true">
<button id="createBtn" action="testEntitiesTable.create"/>
<button id="editBtn" action="testEntitiesTable.edit"/>
<button id="removeBtn" action="testEntitiesTable.remove"/>
</buttonsPanel>
</groupTable>
<hbox id="lookupActions" spacing="true" visible="false">
<button action="lookupSelectAction"/>
<button action="lookupCancelAction"/>
</hbox>
</layout>
</window>
В данный экран добавлен dataLoadCoordinator
с auto="true"
. Если в loader
добавить условие:
where e.createdBy = :current_user_username
то dataLoadCoordinator
не срабатывает при открытии экрана (в логах нет информации о загрузке сущностей из базы).
Если у фильтра нажать “Обновить” . то сущности успешно загружаются.
Если убрать условие where e.createdBy = :current_user_username
, то сущности так-же успешно загружаются при открытии экран.