Class WorkbasketQueryImpl

java.lang.Object
pro.taskana.workbasket.internal.WorkbasketQueryImpl
All Implemented Interfaces:
BaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>, WorkbasketQuery

public class WorkbasketQueryImpl extends Object implements WorkbasketQuery
WorkbasketQuery for generating dynamic SQL.
  • Method Details

    • idIn

      public WorkbasketQuery idIn(String... ids)
      Description copied from interface: WorkbasketQuery
      Add your ids to your query. The ids are compared to the ids of workbaskets with the IN operator.
      Specified by:
      idIn in interface WorkbasketQuery
      Parameters:
      ids - the id as Strings
      Returns:
      the query
    • keyIn

      public WorkbasketQuery keyIn(String... keys)
      Description copied from interface: WorkbasketQuery
      Add your keys to your query. The keys are compared case-insensitively to the keys of workbaskets with the IN operator.
      Specified by:
      keyIn in interface WorkbasketQuery
      Parameters:
      keys - the keys as Strings
      Returns:
      the query
    • keyLike

      public WorkbasketQuery keyLike(String... keys)
      Description copied from interface: WorkbasketQuery
      Add keys to your query. The keys are compared case-insensitively to the keys of workbaskets with the SQL LIKE operator. You may add a wildcard like '%' to search generically. If you specify multiple keys they are connected with an OR operator, this is, the query searches workbaskets whose keys are like key1 or like key2, etc.
      Specified by:
      keyLike in interface WorkbasketQuery
      Parameters:
      keys - the keys as Strings
      Returns:
      the query
    • nameIn

      public WorkbasketQuery nameIn(String... names)
      Description copied from interface: WorkbasketQuery
      Add your names to your query. The names are compared case-insensitively to the names of workbaskets
      Specified by:
      nameIn in interface WorkbasketQuery
      Parameters:
      names - the names as Strings
      Returns:
      the query
    • nameLike

      public WorkbasketQuery nameLike(String... names)
      Description copied from interface: WorkbasketQuery
      Add names to your query. The names are compared case-insensitively to the names of workbaskets with the SQL LIKE operator. You may add a wildcard like '%' to search generically. If you specify multiple names, they are connected with an OR operator, this is, the query searches workbaskets whose names are like name1 or like name2, etc.
      Specified by:
      nameLike in interface WorkbasketQuery
      Parameters:
      names - the names as Strings
      Returns:
      the query
    • keyOrNameLike

      public WorkbasketQuery keyOrNameLike(String... keysOrNames)
      Description copied from interface: WorkbasketQuery
      Add search strings to your query that are searched case-insensitively in the key and name fields of workbaskets. You may add a wildcard like '%' to search generically. If you specify multiple keys they are connected with an OR operator, this is, the query searches workbaskets whose keys are like string1 or whose names are like string1 or whose keys are like string2 or whose names are like string2, etc...
      Specified by:
      keyOrNameLike in interface WorkbasketQuery
      Parameters:
      keysOrNames - the search strings
      Returns:
      the query
    • domainIn

      public WorkbasketQuery domainIn(String... domains)
      Description copied from interface: WorkbasketQuery
      Add your domains to your query.
      Specified by:
      domainIn in interface WorkbasketQuery
      Parameters:
      domains - the domains as Strings
      Returns:
      the query
    • typeIn

      public WorkbasketQuery typeIn(WorkbasketType... types)
      Description copied from interface: WorkbasketQuery
      Add your types to your query.
      Specified by:
      typeIn in interface WorkbasketQuery
      Parameters:
      types - the types
      Returns:
      the query
    • createdWithin

      public WorkbasketQuery createdWithin(TimeInterval... intervals)
      Description copied from interface: WorkbasketQuery
      Add the time intervals within which the workbasket was created to your query. For each time interval, the database query will search for workbaskets whose created timestamp is after or at the interval's begin and before or at the interval's end. If more than one interval is specified, the query will connect them with the OR keyword. If either begin or end of an interval are null, these values will not be specified in the query.
      Specified by:
      createdWithin in interface WorkbasketQuery
      Parameters:
      intervals - - the TimeIntervals within which the workbasket was created
      Returns:
      the query
    • modifiedWithin

      public WorkbasketQuery modifiedWithin(TimeInterval... intervals)
      Description copied from interface: WorkbasketQuery
      Add the time intervals within which the workbasket was modified to your query. For each time interval, the database query will search for workbaskets whose created timestamp is after or at the interval's begin and before or at the interval's end. If more than one interval is specified, the query will connect them with the OR keyword. If either begin or end of an interval are null, these values will not be specified in the query.
      Specified by:
      modifiedWithin in interface WorkbasketQuery
      Parameters:
      intervals - - the TimeIntervals within which the workbasket was created
      Returns:
      the query
    • descriptionLike

      public WorkbasketQuery descriptionLike(String... descriptions)
      Description copied from interface: WorkbasketQuery
      Add your description to your query. It will be compared case-insensitively to the descriptions of workbaskets using the LIKE operator. You may use a wildcard like '%' to search generically. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      descriptionLike in interface WorkbasketQuery
      Parameters:
      descriptions - your description
      Returns:
      the query
    • ownerIn

      public WorkbasketQuery ownerIn(String... owners)
      Description copied from interface: WorkbasketQuery
      Add the owners to your query.
      Specified by:
      ownerIn in interface WorkbasketQuery
      Parameters:
      owners - the owners as String
      Returns:
      the query
    • ownerLike

      public WorkbasketQuery ownerLike(String... owners)
      Description copied from interface: WorkbasketQuery
      Add the owners for pattern matching to your query. It will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      ownerLike in interface WorkbasketQuery
      Parameters:
      owners - the owners as Strings
      Returns:
      the query
    • accessIdsHavePermissions

      public WorkbasketQuery accessIdsHavePermissions(List<WorkbasketPermission> permissions, String... accessIds) throws InvalidArgumentException, NotAuthorizedException
      Description copied from interface: WorkbasketQuery
      Setting up the permissions which should be granted on the result workbaskets and the users which should be checked. READ permission will always be checked by default.
      The AccessIds and the given permission will throw an Exception if they would be NULL.
      Specified by:
      accessIdsHavePermissions in interface WorkbasketQuery
      Parameters:
      permissions - which should be used for results.
      accessIds - Users which should be checked for given permissions on workbaskets.
      Returns:
      the current query object.
      Throws:
      InvalidArgumentException - if permissions OR the accessIds are NULL or empty.
      NotAuthorizedException - if the current user is not member of TaskanaRole.BUSINESS_ADMIN or TaskanaRole.ADMIN
    • callerHasPermissions

      public WorkbasketQuery callerHasPermissions(WorkbasketPermission... permissions)
      Description copied from interface: WorkbasketQuery
      Add condition to query if the caller (one of the accessIds of the caller) has the given permissions on the workbasket.
      Specified by:
      callerHasPermissions in interface WorkbasketQuery
      Parameters:
      permissions - the permissions for the query condition.
      Returns:
      the updated query.
    • orderByName

      public WorkbasketQuery orderByName(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by name.
      Specified by:
      orderByName in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByKey

      public WorkbasketQuery orderByKey(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by key.
      Specified by:
      orderByKey in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByDescription

      public WorkbasketQuery orderByDescription(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by description.
      Specified by:
      orderByDescription in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByOwner

      public WorkbasketQuery orderByOwner(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by owner.
      Specified by:
      orderByOwner in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByType

      public WorkbasketQuery orderByType(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by type.
      Specified by:
      orderByType in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByDomain

      public WorkbasketQuery orderByDomain(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by domain.
      Specified by:
      orderByDomain in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • domainLike

      public WorkbasketQuery domainLike(String... domains)
      Description copied from interface: WorkbasketQuery
      Add the domains for pattern matching to your query. It will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      domainLike in interface WorkbasketQuery
      Parameters:
      domains - the domains of workbaskets as Strings
      Returns:
      the query
    • orderByCustomAttribute

      public WorkbasketQuery orderByCustomAttribute(WorkbasketCustomField customField, BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      This method sorts the query result according to the value of a custom field.
      Specified by:
      orderByCustomAttribute in interface WorkbasketQuery
      Parameters:
      customField - identifies which custom attribute is affected.
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByOrgLevel1

      public WorkbasketQuery orderByOrgLevel1(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by organization level 1.
      Specified by:
      orderByOrgLevel1 in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByOrgLevel2

      public WorkbasketQuery orderByOrgLevel2(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by organization level 2.
      Specified by:
      orderByOrgLevel2 in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByOrgLevel3

      public WorkbasketQuery orderByOrgLevel3(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by organization level 3.
      Specified by:
      orderByOrgLevel3 in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • orderByOrgLevel4

      public WorkbasketQuery orderByOrgLevel4(BaseQuery.SortDirection sortDirection)
      Description copied from interface: WorkbasketQuery
      Sort the query result by organization level 4.
      Specified by:
      orderByOrgLevel4 in interface WorkbasketQuery
      Parameters:
      sortDirection - Determines whether the result is sorted in ascending or descending order. If sortDirection is null, the result is sorted in ascending order
      Returns:
      the query
    • customAttributeIn

      public WorkbasketQuery customAttributeIn(WorkbasketCustomField customField, String... searchArguments)
      Description copied from interface: WorkbasketQuery
      Add the values of custom attributes for exact matching to your query.
      Specified by:
      customAttributeIn in interface WorkbasketQuery
      Parameters:
      customField - identifies which custom attribute is affected.
      searchArguments - the customField values of the searched for tasks
      Returns:
      the query
    • customAttributeLike

      public WorkbasketQuery customAttributeLike(WorkbasketCustomField customField, String... searchArguments)
      Description copied from interface: WorkbasketQuery
      Add the values of custom attributes for pattern matching to your query. They will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      customAttributeLike in interface WorkbasketQuery
      Parameters:
      customField - identifies which custom attribute is affected.
      searchArguments - the customField values of the searched-for tasks
      Returns:
      the query
    • orgLevel1In

      public WorkbasketQuery orgLevel1In(String... orgLevels1)
      Description copied from interface: WorkbasketQuery
      Add the 1st organization level to your query.
      Specified by:
      orgLevel1In in interface WorkbasketQuery
      Parameters:
      orgLevels1 - the 1st organization level as String
      Returns:
      the query
    • orgLevel1Like

      public WorkbasketQuery orgLevel1Like(String... orgLevels1)
      Description copied from interface: WorkbasketQuery
      Add the 1st organization level for pattern matching to your query. It will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      orgLevel1Like in interface WorkbasketQuery
      Parameters:
      orgLevels1 - the 1st organization level as Strings
      Returns:
      the query
    • orgLevel2In

      public WorkbasketQuery orgLevel2In(String... orgLevels2)
      Description copied from interface: WorkbasketQuery
      Add the 2nd organization level to your query.
      Specified by:
      orgLevel2In in interface WorkbasketQuery
      Parameters:
      orgLevels2 - the 2nd organization level as String
      Returns:
      the query
    • orgLevel2Like

      public WorkbasketQuery orgLevel2Like(String... orgLevels2)
      Description copied from interface: WorkbasketQuery
      Add the 2nd organization level for pattern matching to your query. It will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      orgLevel2Like in interface WorkbasketQuery
      Parameters:
      orgLevels2 - the 2nd organization level as Strings
      Returns:
      the query
    • orgLevel3In

      public WorkbasketQuery orgLevel3In(String... orgLevels3)
      Description copied from interface: WorkbasketQuery
      Add the 3rd organization level to your query.
      Specified by:
      orgLevel3In in interface WorkbasketQuery
      Parameters:
      orgLevels3 - the 3rd organization level as String
      Returns:
      the query
    • orgLevel3Like

      public WorkbasketQuery orgLevel3Like(String... orgLevels3)
      Description copied from interface: WorkbasketQuery
      Add the 3rd organization level for pattern matching to your query. It will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      orgLevel3Like in interface WorkbasketQuery
      Parameters:
      orgLevels3 - the 3rd organization level as Strings
      Returns:
      the query
    • orgLevel4In

      public WorkbasketQuery orgLevel4In(String... orgLevels4)
      Description copied from interface: WorkbasketQuery
      Add the 4th organization level to your query.
      Specified by:
      orgLevel4In in interface WorkbasketQuery
      Parameters:
      orgLevels4 - the 4th organization level as String
      Returns:
      the query
    • orgLevel4Like

      public WorkbasketQuery orgLevel4Like(String... orgLevels4)
      Description copied from interface: WorkbasketQuery
      Add the 4th organization level for pattern matching to your query. It will be compared in SQL with the LIKE operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR keyword.
      Specified by:
      orgLevel4Like in interface WorkbasketQuery
      Parameters:
      orgLevels4 - the 4th organization level as Strings
      Returns:
      the query
    • markedForDeletion

      public WorkbasketQuery markedForDeletion(boolean markedForDeletion)
      Description copied from interface: WorkbasketQuery
      Add to your query if the Workbasket shall be marked for deletion.
      Specified by:
      markedForDeletion in interface WorkbasketQuery
      Parameters:
      markedForDeletion - a simple flag showing if the workbasket is marked for deletion
      Returns:
      the query
    • list

      public List<WorkbasketSummary> list()
      Specified by:
      list in interface BaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
    • list

      public List<WorkbasketSummary> list(int offset, int limit)
      Specified by:
      list in interface BaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
    • listValues

      public List<String> listValues(WorkbasketQueryColumnName columnName, BaseQuery.SortDirection sortDirection)
      Specified by:
      listValues in interface BaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
    • single

      public WorkbasketSummary single()
      Specified by:
      single in interface BaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
    • count

      public long count()
      Specified by:
      count in interface BaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
    • getAccessIds

      public String[] getAccessIds()
    • getPermissions

      public WorkbasketPermission[] getPermissions()
    • getNameIn

      public String[] getNameIn()
    • getNameLike

      public String[] getNameLike()
    • getKeyIn

      public String[] getKeyIn()
    • getKeyLike

      public String[] getKeyLike()
    • getKeyOrNameLike

      public String[] getKeyOrNameLike()
    • getType

      public WorkbasketType[] getType()
    • getCreatedIn

      public TimeInterval[] getCreatedIn()
    • getModifiedIn

      public TimeInterval[] getModifiedIn()
    • getDescriptionLike

      public String[] getDescriptionLike()
    • getOwnerIn

      public String[] getOwnerIn()
    • getDomainIn

      public String[] getDomainIn()
    • getDomainLike

      public String[] getDomainLike()
    • getCustom1In

      public String[] getCustom1In()
    • getCustom1Like

      public String[] getCustom1Like()
    • getCustom2In

      public String[] getCustom2In()
    • getCustom2Like

      public String[] getCustom2Like()
    • getCustom3In

      public String[] getCustom3In()
    • getCustom3Like

      public String[] getCustom3Like()
    • getCustom4In

      public String[] getCustom4In()
    • getCustom4Like

      public String[] getCustom4Like()
    • getCustom5In

      public String[] getCustom5In()
    • getCustom5Like

      public String[] getCustom5Like()
    • getCustom6In

      public String[] getCustom6In()
    • getCustom6Like

      public String[] getCustom6Like()
    • getCustom7In

      public String[] getCustom7In()
    • getCustom7Like

      public String[] getCustom7Like()
    • getCustom8In

      public String[] getCustom8In()
    • getCustom8Like

      public String[] getCustom8Like()
    • getOrgLevel1In

      public String[] getOrgLevel1In()
    • getOrgLevel1Like

      public String[] getOrgLevel1Like()
    • getOrgLevel2In

      public String[] getOrgLevel2In()
    • getOrgLevel2Like

      public String[] getOrgLevel2Like()
    • getOrgLevel3In

      public String[] getOrgLevel3In()
    • getOrgLevel3Like

      public String[] getOrgLevel3Like()
    • getOrgLevel4In

      public String[] getOrgLevel4In()
    • getOrgLevel4Like

      public String[] getOrgLevel4Like()
    • isMarkedForDeletion

      public Boolean isMarkedForDeletion()
    • getOwnerLike

      public String[] getOwnerLike()
    • getIdIn

      public String[] getIdIn()
    • getOrderBy

      public List<String> getOrderBy()
    • getOrderColumns

      public List<String> getOrderColumns()
    • getColumnName

      public WorkbasketQueryColumnName getColumnName()
    • isJoinWithAccessList

      public boolean isJoinWithAccessList()
    • isCheckReadPermission

      public boolean isCheckReadPermission()
    • setUsedToAugmentTasks

      public void setUsedToAugmentTasks(boolean usedToAugmentTasks)
    • lowercaseAccessIds

      public static void lowercaseAccessIds(String[] accessIdArray)
    • toString

      public String toString()
      Overrides:
      toString in class Object