Where to test JPQL queries

Back in Cuba platform I used the JMX console and got a persistence object and i was able to load and test JPQL queries from within the admin screen. How can I do the same with JMIX?
thank you.

You can do even better in your project.

Create a simple screen with SourceCodeEditor component:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://jmix.io/schema/ui/window"
    <layout expand="codeField" spacing="true">
        <sourceCodeEditor id="codeField" width="100%"/>
        <comboBox id="entityComboBox" caption="Entity"/>
        <button id="testBtn" caption="Test"/>

Add code completion and data loading to it:

public class QueryTestScreen extends Screen {

    private SourceCodeEditor codeField;
    private JpqlUiSuggestionProvider jpqlUiSuggestionProvider;
    private DataManager dataManager;
    private ComboBox<Class<?>> entityComboBox;
    private MetadataTools metadataTools;

    public void onInit(InitEvent event) {
        codeField.setSuggester((source, text, cursorPosition) -> {
            if (codeField.getValue() == null) {
                return Collections.emptyList();
            return jpqlUiSuggestionProvider.getSuggestions(
                    cursorPosition - 1,

        Map<String, Class<?>> entities = new TreeMap<>();
        for (MetaClass metaClass : metadataTools.getAllJpaEntityMetaClasses()) {
            entities.put(metaClass.getName(), metaClass.getJavaClass());

    public void onTestBtnClick(Button.ClickEvent event) {
        if (codeField.getValue() != null) {
            List<?> list;
            if (entityComboBox.getValue() != null) {
                list = dataManager.load(entityComboBox.getValue()).query(codeField.getValue()).list();
            } else {
                list = dataManager.loadValues(codeField.getValue()).list();
            System.out.println("Query results: " + list);

Moreover, you can add a user selection field and test query execution for different roles, by wrapping dataManager.load() with System Authentication.