How to disable softDeletion

Hi everyone,

I’m trying to disable softDeletion as I can’t add additional columns to support it. According to CUBA documentation (https://doc.cuba-platform.com/manual-6.6/datasource_decl_creation.html)

“collectionDatasource attributes: softDeletion – the false value disables the soft deletion mode when loading entities, i.e., deleted instances will also be loaded. Default value is true.”

I’ve defined softDeletion inside groupDatasource in as follows:

<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
    caption="msg://browseCaption"
    class="com.company.demo.web.student.StudentBrowse"
    focusComponent="studentsTable"
    lookupComponent="studentsTable"
    messagesPack="com.company.demo.web.student">
<dsContext>
    <groupDatasource id="studentsDs"
                     class="com.company.demo.entity.Student"
                     view="_local"
                     softDeletion="false">
        <query>
            <![CDATA[select e from demo$Student e]]>
        </query>
    </groupDatasource>
</dsContext>
</window>

However it does not seem to work, generated query, when loading browse screen, still includes DELETED_BY and DELETE_TS :

Query: ReadAllQuery(referenceClass=Student sql="SELECT * FROM (SELECT a.*, ROWNUM rnum FROM (SELECT ID AS a1, DELETE_TS AS a2, DELETED_BY AS a3, STUDENTID AS a4, STUDENTNAME AS a5, VERSION AS a6 FROM STUDENT WHERE (DELETE_TS IS NULL)) a WHERE ROWNUM <= ?) WHERE rnum > ?")

You should disable soft deletion for the Student entity on the mapping stage. Set its base class not to StandardEntity but to BaseUuidEntity or BaseLongIdEntity or similar (see https://doc.cuba-platform.com/manual-6.7/base_entity_classes.html) and make sure you don’t implement the SoftDelete interface.