Class AvailableEntityService

java.lang.Object
io.jmix.aitools.dataload.introspection.AvailableEntityService

@Component("aitls_AvailableEntityService") public class AvailableEntityService extends Object
Provides the subset of introspected domain-model entities that is currently available to the user.

Availability is resolved through an AvailableEntityFilter. By default, the filter checks read access for entities and view access for their attributes using Jmix security constraints. Applications may replace that behavior by registering a custom AvailableEntityFilter bean.

This service is intended for LLM-facing metadata discovery. It hides entities and attributes that are not available to the current user before they are exposed through tool calls.

  • Field Details

  • Constructor Details

    • AvailableEntityService

      public AvailableEntityService()
  • Method Details

    • getEntitySummaries

      public List<EntitySummary> getEntitySummaries()
      Returns compact summaries for all entities available to the current user.

      The result is filtered through the active AvailableEntityFilter and sorted by entity name.

      Returns:
      immutable list of available entity summaries, or an empty list if no entities are available
    • findEntityDescriptorsByNames

      public List<EntityDescriptor> findEntityDescriptorsByNames(@Nullable Collection<String> entityNames)
      Returns detailed descriptors for the requested entity names that are both known to the introspector and available to the current user.

      Unknown entity names are ignored. If all requested entities are unknown or filtered out by the active AvailableEntityFilter, the method returns an empty list.

      Parameters:
      entityNames - entity names to resolve
      Returns:
      immutable list of available entity descriptors for the requested names
    • getAvailableEntityDescriptors

      protected List<EntityDescriptor> getAvailableEntityDescriptors()
    • hideSystemLevelAttributes

      protected List<EntityDescriptor> hideSystemLevelAttributes(List<EntityDescriptor> entityDescriptors)
      Drops SystemLevel-annotated attributes from the exposed descriptors when jmix.aitools.dataload.exclude-system-level-attributes is enabled. The attributes are only hidden from discovery: they remain in the introspected index, so a generated query may still reference them.
      Parameters:
      entityDescriptors - descriptors to narrow
      Returns:
      descriptors without their system-level attributes, or the same list when hiding is disabled
    • hideSystemLevelAttributes

      protected EntityDescriptor hideSystemLevelAttributes(EntityDescriptor entityDescriptor)
    • isSystemLevel

      protected boolean isSystemLevel(MetaClass metaClass, String propertyName)
    • toEntitySummary

      protected EntitySummary toEntitySummary(EntityDescriptor entityDescriptor)