Interface VariableRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<VariableEntity, Long>, org.springframework.data.jpa.repository.JpaRepository<VariableEntity, Long>, org.springframework.data.repository.ListCrudRepository<VariableEntity, Long>, org.springframework.data.repository.ListPagingAndSortingRepository<VariableEntity, Long>, org.springframework.data.repository.PagingAndSortingRepository<VariableEntity, Long>, org.springframework.data.repository.query.QueryByExampleExecutor<VariableEntity>, org.springframework.data.repository.Repository<VariableEntity, Long>

@Repository public interface VariableRepository extends org.springframework.data.jpa.repository.JpaRepository<VariableEntity, Long>
Repository for Variable entities.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    existsByNameAndScopeAndWorkflowId(String name, ai.nervemind.common.dto.VariableDTO.VariableScope scope, Long workflowId)
    Check if a variable name exists in a scope.
    findByNameAndScopeAndWorkflowId(String name, ai.nervemind.common.dto.VariableDTO.VariableScope scope, Long workflowId)
    Find by name, scope, and workflow ID.
    findByNameAndScopeAndWorkflowIdIsNull(String name, ai.nervemind.common.dto.VariableDTO.VariableScope scope)
    Find by name and scope (for global variables).
    findByScope(ai.nervemind.common.dto.VariableDTO.VariableScope scope)
    Find all global variables.
    findByScopeOrWorkflowId(ai.nervemind.common.dto.VariableDTO.VariableScope scope, Long workflowId)
    Find all variables for a workflow (both global and workflow-specific).
    findByWorkflowId(Long workflowId)
    Find all variables for a specific workflow.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByScope

      List<VariableEntity> findByScope(ai.nervemind.common.dto.VariableDTO.VariableScope scope)
      Find all global variables.
      Parameters:
      scope - the variable scope to search for
      Returns:
      list of variables with the specified scope
    • findByWorkflowId

      List<VariableEntity> findByWorkflowId(Long workflowId)
      Find all variables for a specific workflow.
      Parameters:
      workflowId - the workflow ID
      Returns:
      list of variables belonging to the workflow
    • findByNameAndScopeAndWorkflowIdIsNull

      Optional<VariableEntity> findByNameAndScopeAndWorkflowIdIsNull(String name, ai.nervemind.common.dto.VariableDTO.VariableScope scope)
      Find by name and scope (for global variables).
      Parameters:
      name - the variable name
      scope - the variable scope
      Returns:
      optional containing the variable if found
    • findByNameAndScopeAndWorkflowId

      Optional<VariableEntity> findByNameAndScopeAndWorkflowId(String name, ai.nervemind.common.dto.VariableDTO.VariableScope scope, Long workflowId)
      Find by name, scope, and workflow ID.
      Parameters:
      name - the variable name
      scope - the variable scope
      workflowId - the workflow ID
      Returns:
      optional containing the variable if found
    • findByScopeOrWorkflowId

      List<VariableEntity> findByScopeOrWorkflowId(ai.nervemind.common.dto.VariableDTO.VariableScope scope, Long workflowId)
      Find all variables for a workflow (both global and workflow-specific).
      Parameters:
      scope - the variable scope
      workflowId - the workflow ID
      Returns:
      list of variables matching the criteria
    • existsByNameAndScopeAndWorkflowId

      boolean existsByNameAndScopeAndWorkflowId(String name, ai.nervemind.common.dto.VariableDTO.VariableScope scope, Long workflowId)
      Check if a variable name exists in a scope.
      Parameters:
      name - the variable name to check
      scope - the variable scope
      workflowId - the workflow ID (null for global)
      Returns:
      true if a variable with the given name exists, false otherwise