Interface IPromptConnectionDao


  • public interface IPromptConnectionDao
    Data access object for creating, updating, and deleting PromptConnectionEntity entities.
    Since:
    8.5.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • createOrUpdate

        PromptConnectionEntity createOrUpdate​(PromptConnectionEntity entity)
        Creates the given prompt connection if it does not exist, or updates it if it does.
        Parameters:
        entity - The prompt connection entity to create or update.
        Returns:
        The created or updated prompt connection entity.
      • delete

        void delete​(PromptConnectionEntity existing)
        Deletes the given prompt connection.
        Parameters:
        existing - The prompt connection to delete.
      • deleteAllByScope

        @CanIgnoreReturnValue
        long deleteAllByScope​(String scopeKind,
                              long scopeId)
        Deletes all prompt connections that belong to the specified scope. This also deletes all connections from dependent scopes. E.g. deleting all tenant-scoped connections also deletes all project-scoped connections.

        Note: Normally you would want to call queryDao.deleteAllByScope() first to delete all prompt queries of the scope, before deleting the connections.

        Parameters:
        scopeKind - The kind of the scope whose prompt connections are to be deleted.
        scopeId - The ID of the scope whose prompt connections are to be.
        Returns:
        The number of deleted prompt connections.
      • findUniqueName

        String findUniqueName​(String scopeKind,
                              long scopeId,
                              String candidateName,
                              PromptConnectionEntity exclude)
        Finds a new unique name for a (new) given prompt connection. The returned name is unique amongst all prompt queries of the given scope. The returned name is based on the given candidate name. If no connection with the candidate name exists, the candidate name is returned.
        Parameters:
        scopeKind - The kind of the scope for which to check name uniqueness.
        scopeId - The ID of the scope for which to check name uniqueness.
        candidateName - A candidate name to make unique.
        exclude - Optional. When given, the name of this prompt connection is excluded from the uniqueness check.
        Returns:
        A unique name based on the candidate name.
      • getAllByScope

        List<PromptConnectionEntity> getAllByScope​(String scopeKind,
                                                   long scopeId)
        Gets all prompt connections that belong to the specified scope.
        Parameters:
        scopeKind - The kind of the scope for which to retrieve the prompt connections.
        scopeId - The ID of the scope for which to retrieve the prompt connections.
        Returns:
        A list of all prompt connections associated with the specified scope.
      • getAllByScopeIncludeChildren

        List<PromptConnectionEntity> getAllByScopeIncludeChildren​(String scopeKind,
                                                                  long scopeId)
        Gets all prompt connections that belong to the specified scope, or a child scope of that scope.
        Parameters:
        scopeKind - The kind of the scope for which to retrieve the prompt connections.
        scopeId - The ID of the scope for which to retrieve the prompt connections.
        Returns:
        A list of all prompt connections associated with the specified scope and its child scopes.
      • getAllByScopeIncludeParents

        List<PromptConnectionEntity> getAllByScopeIncludeParents​(String scopeKind,
                                                                 long scopeId)
        Gets all prompt connections that belong to the specified scope, or a parent scope of that scope.
        Parameters:
        scopeKind - The kind of the scope for which to retrieve the prompt connections.
        scopeId - The ID of the scope for which to retrieve the prompt connections.
        Returns:
        A list of all prompt connections associated with the specified scope and its parent scopes.
      • getAllByType

        List<PromptConnectionEntity> getAllByType​(String type)
        Finds all prompt connections of a given type from all scopes.
        Parameters:
        type - The type of prompt connections to retrieve.
        Returns:
        A list of all prompt connections of the specified type.
      • getAllByType

        List<PromptConnectionEntity> getAllByType​(String type,
                                                  String scopeKind,
                                                  long scopeId)
        Finds all prompt connections of a given type assigned to the specified scope.
        Parameters:
        type - The type of prompt connections to retrieve.
        scopeKind - The kind of the scope for which to retrieve the prompt connections.
        scopeId - The ID of the scope for which to retrieve the prompt connections.
        Returns:
        A list of prompt connections of the specified type for the given scope.
      • getAllByTypeIncludeChildren

        List<PromptConnectionEntity> getAllByTypeIncludeChildren​(String type,
                                                                 String scopeKind,
                                                                 long scopeId)
        Finds all prompt connections of a given type assigned to the specified scope or a child of that scope.
        Parameters:
        type - The type of prompt connections to retrieve.
        scopeKind - The kind of the scope for which to retrieve the prompt connections.
        scopeId - The ID of the scope for which to retrieve the prompt connections.
        Returns:
        A list of prompt connections of the specified type for the given scope.
      • getAllByTypeIncludeParents

        List<PromptConnectionEntity> getAllByTypeIncludeParents​(String type,
                                                                String scopeKind,
                                                                long scopeId)
        Finds all prompt connections of a given type assigned to the specified scope or a parent of that scope.
        Parameters:
        type - The type of prompt connections to retrieve.
        scopeKind - The kind of the scope for which to retrieve the prompt connections.
        scopeId - The ID of the scope for which to retrieve the prompt connections.
        Returns:
        A list of prompt connections of the specified type for the given scope.
      • getByName

        PromptConnectionEntity getByName​(String scopeKind,
                                         long scopeId,
                                         String name)
        Gets a prompt connection with a given name that belongs to the specified scope.
        Parameters:
        scopeKind - The kind of the scope for which to retrieve the prompt connection.
        scopeId - The ID of the scope for which to retrieve the prompt
        name - The name of the prompt connection to retrieve.
        Returns:
        The prompt connection entity with the specified name, or null if not found.
      • getByQuery

        PromptConnectionEntity getByQuery​(String scopeKind,
                                          long scopeId,
                                          UUID query)
        Gets the prompt connection that was configured for the given query.
        Parameters:
        scopeKind - The kind of the scope for which to retrieve the prompt connection.
        scopeId - The ID of the scope for which to retrieve the prompt connection.
        query - The UUID of the prompt query.
        Returns:
        The prompt connection entity configured for the query with the given UUID, or null if not found.
      • getByUuid

        PromptConnectionEntity getByUuid​(String scopeKind,
                                         long scopeId,
                                         UUID connection)
        Gets a prompt connection by its UUID with the specified scope.
        Parameters:
        scopeKind - The kind of the scope for which to retrieve the prompt connection.
        scopeId - The ID of the scope for which to retrieve the prompt connection.
        connection - The UUID of the prompt connection to retrieve.
        Returns:
        The prompt connection entity with the specified scope, or null if not found.
      • getType

        String getType​(String scopeKind,
                       long scopeId,
                       UUID connection)
        Gets the type of a prompt connection.
        Parameters:
        scopeKind - The kind of the scope for which to retrieve the prompt connection type.
        scopeId - The ID of the scope for which to retrieve the prompt connection type.
        connection - The UUID of the prompt connection for which to retrieve the type.
        Returns:
        The type of the prompt connection, or null if not found.