Interface MTModelQuery

All Superinterfaces:
MTDateFilterQuery, MTMissingTranslationsQuery, MTPatternQuery, MTQuery, MTSortableQuery

  • Method Details

    • selectAll

      MTModelQuery selectAll()
      Selects all models in the workspace.
    • select

      MTModelQuery select(List<Long> ids)
      Selects model by their ID.
      Parameters:
      ids - The ID:s of the models to select.
    • selectByUUID

      MTModelQuery selectByUUID(List<String> uuids)
      Selects models by their UUID.
      Parameters:
      uuids - The UUID:s of the models to select.
    • select

      MTModelQuery select(MTList list)
      Selects models by executing a list.
      Parameters:
      list - The list to execute.
      Throws:
      IllegalArgumentException - If list.getResultType() != MTList.ResultType.MODEL.
    • selectSubset

      MTModelQuery selectSubset(List<Long> roots, boolean onlyOwning)
      Selects a subset of models by following breakdowns from a set of "root" models.
      Parameters:
      roots - the ID:s of the root models
      onlyOwning - If true, breakdowns are only followed for symbol that is marked as "owned" by models.
    • selectSubsetByUUID

      MTModelQuery selectSubsetByUUID(List<String> roots, boolean onlyOwning)
      Selects a subset of models by following breakdowns from a set of "root" models.
      Parameters:
      roots - the ID:s of the root models
      onlyOwning - If true, breakdowns are only followed for symbol that is marked as "owned" by models.
    • selectByNamedQuery

      MTModelQuery selectByNamedQuery(MTNamedQuery namedQuery)
      Selects from a named query. This way you can base queries on other named queries and filter them further.
      Parameters:
      namedQuery - The named query to base this query on.
    • withTypes

      MTModelQuery withTypes(ModelType... type)
      Exclude all models that does not have one of the given types.
      Parameters:
      type - The types to include
    • withCurrentRevisions

      MTModelQuery withCurrentRevisions()
    • withLockedRevisions

      MTModelQuery withLockedRevisions(boolean includeInitialRevisions)
      Retains only locked revisions of models. If the current revision in the workspace is locked the previous (locked) revision of the model is selected instead.
      Parameters:
      includeInitialRevisions - If true the initial revisions (rev 0) will still be included in the result even they are not locked.
    • withPattern

      MTModelQuery withPattern(String pattern, MTLanguage language, boolean exactMatch, boolean ignoreCase)
      Excludes results where the title does not contain pattern as a substring.
      Specified by:
      withPattern in interface MTPatternQuery
      Parameters:
      pattern - The pattern to search for.
      language - The language of the title to find the pattern in.
      exactMatch - Require the pattern to match the title exactly rather than containing the pattern.
      ignoreCase - Ignores case. This makes "exact match" check lowercase strings for equality and "contains match" check lowercase for contains.
    • withChangesSince

      MTModelQuery withChangesSince(Date date)
      Excludes models that have not been modified since a given date.
      Specified by:
      withChangesSince in interface MTDateFilterQuery
      Parameters:
      date - The date to compare against.
    • withApprovers

      MTModelQuery withApprovers(boolean includeNoApprovers, MTUserHeader... approvers)
      Retains only models with at least one of the given users set as approver of the model.
      Parameters:
      includeNoApprovers - If true then models with no approvers will be included in the result.
      approvers - The accepted approvers.
    • withReviewers

      MTModelQuery withReviewers(boolean includeNoReviewer, MTUserHeader... reviewers)
      Retains only models with at least one of the given users set as reviewer of the model.
      Parameters:
      includeNoReviewer - If true then models with no reviewers will be included in the result.
      reviewers - The accepted reviewers.
    • withMaintainers

      MTModelQuery withMaintainers(boolean includeNoMaintainers, MTUserHeader... maintainers)
      Retains only models with at least one of the given users set as maintainer of the model.
      Parameters:
      includeNoMaintainers - If true then models with no maintainers will be included in the result.
      maintainers - The accepted maintainers.
    • withSubscribers

      MTModelQuery withSubscribers(boolean includeNoSubscriber, MTSubscriber... subscribers)
      Retains only models with at least one of the given subscribers set as subscriber of the model.
      Parameters:
      includeNoSubscriber - If true then models with no subscribers will be included in the result.
      subscribers - The accepted subscribers.
    • withOwners

      MTModelQuery withOwners(MTUserHeader... owners)
      Retains only models with at least one of the given users set as owner of the model.
      Parameters:
      owners - The accepted owners.
    • withGroups

      MTModelQuery withGroups(MTGroupHeader... groups)
      Retains only models with at least one of the given groups set as group of the model.
      Parameters:
      groups - The accepted groups.
    • withCreators

      MTModelQuery withCreators(MTUserHeader... creators)
      Retains only models with at least one of the given users set as creator of the model.
      Parameters:
      creators - The accepted creators.
    • withLastModifiedBy

      MTModelQuery withLastModifiedBy(MTUserHeader... modifiers)
      Retains only models that was last modified by one of the given users
      Parameters:
      modifiers - The accepted modifiers.
    • withWorkflowStates

      MTModelQuery withWorkflowStates(WorkflowState... states)
      Retains only models with the given workflow states.
      Parameters:
      states - The accepted workflow states.
    • withAttributeValues

      MTModelQuery withAttributeValues(MTAttributeFilter filter)
      Retains only models with selected attribute values.
      Parameters:
      filter - The filter used.
    • withDocuments

      MTModelQuery withDocuments(Document.DocumentID... documents)
      Retains only models with at least one of the given documents connected to it.
      Parameters:
      documents - The documents
    • sort

      MTModelQuery sort(MTQuery.SortColumn sortColumn, boolean ascending, MTLanguage language, Locale locale)
      Sorts the selected models.
      Specified by:
      sort in interface MTSortableQuery
      Parameters:
      sortColumn - The column to sort by
      ascending - true for ascending order, false for descending
      language - The language to sort by
      locale - the locale to use when sorting