Package pro.taskana.workbasket.internal
Class WorkbasketQueryImpl
java.lang.Object
pro.taskana.workbasket.internal.WorkbasketQueryImpl
- All Implemented Interfaces:
BaseQuery<WorkbasketSummary,,WorkbasketQueryColumnName> WorkbasketQuery
WorkbasketQuery for generating dynamic SQL.
-
Nested Class Summary
Nested classes/interfaces inherited from interface pro.taskana.common.api.BaseQuery
BaseQuery.SortDirection -
Method Summary
Modifier and TypeMethodDescriptionaccessIdsHavePermissions(List<WorkbasketPermission> permissions, String... accessIds) Setting up the permissions which should be granted on the result workbaskets and the users which should be checked.callerHasPermissions(WorkbasketPermission... permissions) Add condition to query if the caller (one of the accessIds of the caller) has the given permissions on the workbasket.longcount()createdWithin(TimeInterval... intervals) Add the time intervals within which the workbasket was created to your query.customAttributeIn(WorkbasketCustomField customField, String... searchArguments) Add the values of custom attributes for exact matching to your query.customAttributeLike(WorkbasketCustomField customField, String... searchArguments) Add the values of custom attributes for pattern matching to your query.descriptionLike(String... descriptions) Add your description to your query.Add your domains to your query.domainLike(String... domains) Add the domains for pattern matching to your query.String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]getIdIn()String[]getKeyIn()String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]String[]getType()Add your ids to your query.booleanbooleanAdd your keys to your query.Add keys to your query.keyOrNameLike(String... keysOrNames) Add search strings to your query that are searched case-insensitively in the key and name fields of workbaskets.list()list(int offset, int limit) listValues(WorkbasketQueryColumnName columnName, BaseQuery.SortDirection sortDirection) static voidlowercaseAccessIds(String[] accessIdArray) markedForDeletion(boolean markedForDeletion) Add to your query if the Workbasket shall be marked for deletion.modifiedWithin(TimeInterval... intervals) Add the time intervals within which the workbasket was modified to your query.Add your names to your query.Add names to your query.orderByCustomAttribute(WorkbasketCustomField customField, BaseQuery.SortDirection sortDirection) This method sorts the query result according to the value of a custom field.orderByDescription(BaseQuery.SortDirection sortDirection) Sort the query result by description.orderByDomain(BaseQuery.SortDirection sortDirection) Sort the query result by domain.orderByKey(BaseQuery.SortDirection sortDirection) Sort the query result by key.orderByName(BaseQuery.SortDirection sortDirection) Sort the query result by name.orderByOrgLevel1(BaseQuery.SortDirection sortDirection) Sort the query result by organization level 1.orderByOrgLevel2(BaseQuery.SortDirection sortDirection) Sort the query result by organization level 2.orderByOrgLevel3(BaseQuery.SortDirection sortDirection) Sort the query result by organization level 3.orderByOrgLevel4(BaseQuery.SortDirection sortDirection) Sort the query result by organization level 4.orderByOwner(BaseQuery.SortDirection sortDirection) Sort the query result by owner.orderByType(BaseQuery.SortDirection sortDirection) Sort the query result by type.orgLevel1In(String... orgLevels1) Add the 1st organization level to your query.orgLevel1Like(String... orgLevels1) Add the 1st organization level for pattern matching to your query.orgLevel2In(String... orgLevels2) Add the 2nd organization level to your query.orgLevel2Like(String... orgLevels2) Add the 2nd organization level for pattern matching to your query.orgLevel3In(String... orgLevels3) Add the 3rd organization level to your query.orgLevel3Like(String... orgLevels3) Add the 3rd organization level for pattern matching to your query.orgLevel4In(String... orgLevels4) Add the 4th organization level to your query.orgLevel4Like(String... orgLevels4) Add the 4th organization level for pattern matching to your query.Add the owners to your query.Add the owners for pattern matching to your query.voidsetUsedToAugmentTasks(boolean usedToAugmentTasks) single()toString()typeIn(WorkbasketType... types) Add your types to your query.
-
Method Details
-
idIn
Description copied from interface:WorkbasketQueryAdd your ids to your query. The ids are compared to the ids of workbaskets with the IN operator.- Specified by:
idInin interfaceWorkbasketQuery- Parameters:
ids- the id as Strings- Returns:
- the query
-
keyIn
Description copied from interface:WorkbasketQueryAdd your keys to your query. The keys are compared case-insensitively to the keys of workbaskets with the IN operator.- Specified by:
keyInin interfaceWorkbasketQuery- Parameters:
keys- the keys as Strings- Returns:
- the query
-
keyLike
Description copied from interface:WorkbasketQueryAdd 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:
keyLikein interfaceWorkbasketQuery- Parameters:
keys- the keys as Strings- Returns:
- the query
-
nameIn
Description copied from interface:WorkbasketQueryAdd your names to your query. The names are compared case-insensitively to the names of workbaskets- Specified by:
nameInin interfaceWorkbasketQuery- Parameters:
names- the names as Strings- Returns:
- the query
-
nameLike
Description copied from interface:WorkbasketQueryAdd 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:
nameLikein interfaceWorkbasketQuery- Parameters:
names- the names as Strings- Returns:
- the query
-
keyOrNameLike
Description copied from interface:WorkbasketQueryAdd 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:
keyOrNameLikein interfaceWorkbasketQuery- Parameters:
keysOrNames- the search strings- Returns:
- the query
-
domainIn
Description copied from interface:WorkbasketQueryAdd your domains to your query.- Specified by:
domainInin interfaceWorkbasketQuery- Parameters:
domains- the domains as Strings- Returns:
- the query
-
typeIn
Description copied from interface:WorkbasketQueryAdd your types to your query.- Specified by:
typeInin interfaceWorkbasketQuery- Parameters:
types- the types- Returns:
- the query
-
createdWithin
Description copied from interface:WorkbasketQueryAdd 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:
createdWithinin interfaceWorkbasketQuery- Parameters:
intervals- - the TimeIntervals within which the workbasket was created- Returns:
- the query
-
modifiedWithin
Description copied from interface:WorkbasketQueryAdd 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:
modifiedWithinin interfaceWorkbasketQuery- Parameters:
intervals- - the TimeIntervals within which the workbasket was created- Returns:
- the query
-
descriptionLike
Description copied from interface:WorkbasketQueryAdd 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:
descriptionLikein interfaceWorkbasketQuery- Parameters:
descriptions- your description- Returns:
- the query
-
ownerIn
Description copied from interface:WorkbasketQueryAdd the owners to your query.- Specified by:
ownerInin interfaceWorkbasketQuery- Parameters:
owners- the owners as String- Returns:
- the query
-
ownerLike
Description copied from interface:WorkbasketQueryAdd 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:
ownerLikein interfaceWorkbasketQuery- 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:WorkbasketQuerySetting 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:
accessIdsHavePermissionsin interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQueryAdd condition to query if the caller (one of the accessIds of the caller) has the given permissions on the workbasket.- Specified by:
callerHasPermissionsin interfaceWorkbasketQuery- Parameters:
permissions- the permissions for the query condition.- Returns:
- the updated query.
-
orderByName
Description copied from interface:WorkbasketQuerySort the query result by name.- Specified by:
orderByNamein interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by key.- Specified by:
orderByKeyin interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by description.- Specified by:
orderByDescriptionin interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by owner.- Specified by:
orderByOwnerin interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by type.- Specified by:
orderByTypein interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by domain.- Specified by:
orderByDomainin interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQueryAdd 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:
domainLikein interfaceWorkbasketQuery- Parameters:
domains- the domains of workbaskets as Strings- Returns:
- the query
-
orderByCustomAttribute
public WorkbasketQuery orderByCustomAttribute(WorkbasketCustomField customField, BaseQuery.SortDirection sortDirection) Description copied from interface:WorkbasketQueryThis method sorts the query result according to the value of a custom field.- Specified by:
orderByCustomAttributein interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by organization level 1.- Specified by:
orderByOrgLevel1in interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by organization level 2.- Specified by:
orderByOrgLevel2in interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by organization level 3.- Specified by:
orderByOrgLevel3in interfaceWorkbasketQuery- 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
Description copied from interface:WorkbasketQuerySort the query result by organization level 4.- Specified by:
orderByOrgLevel4in interfaceWorkbasketQuery- 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:WorkbasketQueryAdd the values of custom attributes for exact matching to your query.- Specified by:
customAttributeInin interfaceWorkbasketQuery- 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:WorkbasketQueryAdd 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:
customAttributeLikein interfaceWorkbasketQuery- Parameters:
customField- identifies which custom attribute is affected.searchArguments- the customField values of the searched-for tasks- Returns:
- the query
-
orgLevel1In
Description copied from interface:WorkbasketQueryAdd the 1st organization level to your query.- Specified by:
orgLevel1Inin interfaceWorkbasketQuery- Parameters:
orgLevels1- the 1st organization level as String- Returns:
- the query
-
orgLevel1Like
Description copied from interface:WorkbasketQueryAdd 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:
orgLevel1Likein interfaceWorkbasketQuery- Parameters:
orgLevels1- the 1st organization level as Strings- Returns:
- the query
-
orgLevel2In
Description copied from interface:WorkbasketQueryAdd the 2nd organization level to your query.- Specified by:
orgLevel2Inin interfaceWorkbasketQuery- Parameters:
orgLevels2- the 2nd organization level as String- Returns:
- the query
-
orgLevel2Like
Description copied from interface:WorkbasketQueryAdd 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:
orgLevel2Likein interfaceWorkbasketQuery- Parameters:
orgLevels2- the 2nd organization level as Strings- Returns:
- the query
-
orgLevel3In
Description copied from interface:WorkbasketQueryAdd the 3rd organization level to your query.- Specified by:
orgLevel3Inin interfaceWorkbasketQuery- Parameters:
orgLevels3- the 3rd organization level as String- Returns:
- the query
-
orgLevel3Like
Description copied from interface:WorkbasketQueryAdd 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:
orgLevel3Likein interfaceWorkbasketQuery- Parameters:
orgLevels3- the 3rd organization level as Strings- Returns:
- the query
-
orgLevel4In
Description copied from interface:WorkbasketQueryAdd the 4th organization level to your query.- Specified by:
orgLevel4Inin interfaceWorkbasketQuery- Parameters:
orgLevels4- the 4th organization level as String- Returns:
- the query
-
orgLevel4Like
Description copied from interface:WorkbasketQueryAdd 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:
orgLevel4Likein interfaceWorkbasketQuery- Parameters:
orgLevels4- the 4th organization level as Strings- Returns:
- the query
-
markedForDeletion
Description copied from interface:WorkbasketQueryAdd to your query if the Workbasket shall be marked for deletion.- Specified by:
markedForDeletionin interfaceWorkbasketQuery- Parameters:
markedForDeletion- a simple flag showing if the workbasket is marked for deletion- Returns:
- the query
-
list
- Specified by:
listin interfaceBaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
-
list
- Specified by:
listin interfaceBaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
-
listValues
public List<String> listValues(WorkbasketQueryColumnName columnName, BaseQuery.SortDirection sortDirection) - Specified by:
listValuesin interfaceBaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
-
single
- Specified by:
singlein interfaceBaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
-
count
public long count()- Specified by:
countin interfaceBaseQuery<WorkbasketSummary,WorkbasketQueryColumnName>
-
getAccessIds
-
getPermissions
-
getNameIn
-
getNameLike
-
getKeyIn
-
getKeyLike
-
getKeyOrNameLike
-
getType
-
getCreatedIn
-
getModifiedIn
-
getDescriptionLike
-
getOwnerIn
-
getDomainIn
-
getDomainLike
-
getCustom1In
-
getCustom1Like
-
getCustom2In
-
getCustom2Like
-
getCustom3In
-
getCustom3Like
-
getCustom4In
-
getCustom4Like
-
getCustom5In
-
getCustom5Like
-
getCustom6In
-
getCustom6Like
-
getCustom7In
-
getCustom7Like
-
getCustom8In
-
getCustom8Like
-
getOrgLevel1In
-
getOrgLevel1Like
-
getOrgLevel2In
-
getOrgLevel2Like
-
getOrgLevel3In
-
getOrgLevel3Like
-
getOrgLevel4In
-
getOrgLevel4Like
-
isMarkedForDeletion
-
getOwnerLike
-
getIdIn
-
getOrderBy
-
getOrderColumns
-
getColumnName
-
isJoinWithAccessList
public boolean isJoinWithAccessList() -
isCheckReadPermission
public boolean isCheckReadPermission() -
setUsedToAugmentTasks
public void setUsedToAugmentTasks(boolean usedToAugmentTasks) -
lowercaseAccessIds
-
toString
-