Package com.onenetwork.platform.workflow
Class FetchParam
java.lang.Object
com.onenetwork.platform.workflow.FetchParam
public class FetchParam
extends java.lang.Object
Used to specify what levels of a Model should be fetched when calling
WorkflowService.populateCurrentFromDatabase(ActionBasedWorkflowContext, FetchParam...)
.-
Constructor Summary
Constructors Modifier Constructor Description protected
FetchParam(java.lang.Class<? extends Model> modelLevelClass, FetchType fetchType)
-
Method Summary
Modifier and Type Method Description static FetchParam
all(java.lang.Class<? extends Model> modelLevelClass)
A new FetchParam which indicates all records in the database should be fetched for the given level, regardless of what was passed to the workflow.static FetchParam[]
allChildren(java.lang.Class<? extends Model> jaxbClass)
A convenience method to construct FetchParams for all child ModelLevelType excluding the top one.boolean
equals(java.lang.Object obj)
FetchType
getFetchType()
java.lang.Class<? extends Model>
getLevel()
int
hashCode()
static FetchParam
inputOnly(java.lang.Class<? extends Model> modelLevelClass)
A new FetchParam which indicates only records passed in to the current workflow should be fetched for the given level.
-
Constructor Details
-
Method Details
-
inputOnly
A new FetchParam which indicates only records passed in to the current workflow should be fetched for the given level. For example, model Order has a child level OrderLineItem. Let's say Order O1 exists in the database, with child OrderLineItems OL1 and OL2. Now someone executes a workflow, passing in ONLY O1 and OL1. Specifying FetchParam.inputOnly(OrderLine.class) would fetch the current state of OL1 from the DB, but would NOT fetch any records for OL2.- Parameters:
level
- Model Level type- Returns:
- indicates only records passed in to the current workflow should be fetched for the given level
-
all
A new FetchParam which indicates all records in the database should be fetched for the given level, regardless of what was passed to the workflow. For example, model Order has a child level OrderLineItem. Let's say Order O1 exists in the database, with child OrderLineItems OL1 and OL2. Now someone executes a workflow, passing in ONLY O1 and OL1. Specifying FetchParam.all(OrderLine.class) would fetch the current state of OL1 and OL2 from the DB, even though OL2 wasn't passed as input.- Parameters:
level
- Model Level type- Returns:
- indicates all child records in the database should be fetched for the given level
-
allChildren
A convenience method to construct FetchParams for all child ModelLevelType excluding the top one. This is done so that people wont repeat the same code everywhere. If this Model has only one level it would return an empty list.- Parameters:
level
- Model type
-
getLevel
-
getFetchType
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-