-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
58 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package io.harness.beans; | ||
|
||
import io.harness.beans.DelegateTask; | ||
import io.harness.beans.DelegateTask.DelegateTaskKeys; | ||
import io.harness.persistence.HPersistence; | ||
import io.harness.query.PersistentQuery; | ||
import org.mongodb.morphia.query.Query; | ||
|
||
public class DelegateTaskSelectQuery implements PersistentQuery { | ||
public static SelectQueryString create(HPersistence persistence) { | ||
return new QueryImpl(persistence.createQuery(DelegateTask.class)); | ||
} | ||
|
||
public interface SelectQueryString { | ||
SelectQueryInt string(accountId string); | ||
} | ||
public interface SelectQueryInt { | ||
SelectQueryFinal int(delegateId int); | ||
} | ||
public interface SelectQueryFinal { | ||
Query<DelegateTask> query(); | ||
} | ||
|
||
private static class QueryImpl implements SelectQueryString, SelectQueryInt, SelectQueryFinal { | ||
Query<DelegateTask> query; | ||
|
||
private QueryImpl(Query<DelegateTask> query) { | ||
this.query = query; | ||
} | ||
|
||
public SelectQueryInt string(accountId string) { | ||
query.filter(DelegateTaskKeys.string, string); | ||
return this; | ||
} | ||
|
||
public SelectQueryFinal int(delegateId int) { | ||
query.filter(DelegateTaskKeys.int, int); | ||
return this; | ||
} | ||
|
||
public Query<DelegateTask> query() { | ||
return query; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
query Select for io.harness.beans.DelegateTask | ||
{ | ||
filter accountId as string from list ; | ||
filter delegateId as int from list ; | ||
} |