smithery.ai

Jmix Soft Deletion

Work with soft-deleted entities in Jmix applications.

Installation

$ npx skills add https://smithery.ai

Summary

  • Work with soft-deleted entities in Jmix applications.
  • Use this skill when implementing features that need to show or hide soft-deleted records.
  • Use this skill when bypassing soft deletion filtering to include deleted entities in queries.
  • Use this skill when working with @DeletedDate and @DeletedBy annotations.
  • Use this skill when implementing "show deleted" toggles in list views.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,352 B
  • docs SUMMARY.md 408 B

History

  1. First recorded snapshot · 1 installs

SKILL.md

Jmix Soft Deletion

When to use this skill

  • When implementing a toggle to show/hide soft-deleted entities in a view
  • When writing queries that need to include soft-deleted records
  • When using LoadContext hints to control soft deletion filtering
  • When working with entities that have @DeletedDate and @DeletedBy annotations
  • When implementing restore functionality for soft-deleted entities

Instructions

Entity Setup

Entities with soft delete support have these annotations:

@DeletedBy
@Column(name = "DELETED_BY")
private String deletedBy;

@DeletedDate
@Column(name = "DELETED_DATE")
private OffsetDateTime deletedDate;

Including Soft-Deleted Entities in Queries

Use PersistenceHints.SOFT_DELETION with a LoadContext or loadDelegate:

import io.jmix.data.PersistenceHints;  // IMPORTANT: NOT io.jmix.core

@Install(to = "entityDl", target = Target.DATA_LOADER)
private List<Entity> loadDelegate(LoadContext<Entity> loadContext) {
    boolean showDeleted = Boolean.TRUE.equals(showDeletedCheckbox.getValue());
    loadContext.setHint(PersistenceHints.SOFT_DELETION, !showDeleted);
    return dataManager.loadList(loadContext);
}
  • SOFT_DELETION = true (default): Filters out deleted entities
  • SOFT_DELETION = false: Includes deleted entities

Important Considerations

  1. Caching: Remove cacheable="true" from XML loaders when dynamically toggling soft deletion, as cached results may ignore hint changes.
  1. Reload on toggle: When the user toggles the show/hide deleted checkbox, call loader.load() to refresh the data:
@Subscribe("showDeletedCheckbox")
public void onShowDeletedCheckboxChange(AbstractField.ComponentValueChangeEvent<JmixCheckbox, Boolean> event) {
    entityDl.load();
}
  1. Visual distinction: Combine with vaadin-grid-styling skill to visually distinguish deleted entities (e.g., faded/gray appearance).