Package de.dlr.proseo.model
Class ProductQuery
java.lang.Object
de.dlr.proseo.model.PersistentObject
de.dlr.proseo.model.ProductQuery
A ProductQuery models the need of a JobStep to use a Product of a certain ProductClass for a specific time period.
The time period can be defined by conditions, and a Product is said to satisfy a ProductQuery, if it matches the given
conditions. A JobStep can be executed as soon as all its ProductQuerys are satisfied.
- Author:
- Dr. Thomas Bassler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest equality of persistent objects based on their unique ID.static ProductQueryfromSimpleSelectionRule(SimpleSelectionRule selectionRule, JobStep jobStep, Map<String, String> productColumnMapping, String facilityQuerySql, String facilityQuerySqlSubselect) Create a product query from a simple selection rule for a given job stepGets the additional filtering conditionsGets the selection rule that generated this product queryCheck whether this product query is satisfiedGets the job step issuing the queryGets the JPQL query conditionDeprecated.Gets the requested product classGet the products satisfying this queryGets the SQL query conditioninthashCode()Check whether this product query is satisfied (convenience alias for getIsSatisfied())voidsetFilterConditions(Map<String, Parameter> filterConditions) Sets the additional filtering conditionsvoidsetGeneratingRule(SimpleSelectionRule generatingRule) Sets the selection rule that generated this product queryvoidsetInDownload(Boolean inDownload) voidsetIsSatisfied(Boolean isSatisfied) Indicate that this product query is satisfiedvoidsetJobStep(JobStep jobStep) Sets the job step issuing the queryvoidsetJpqlQueryCondition(String jpqlQueryCondition) Sets the JPQL query conditionvoidsetMinimumCoverage(Short minimumCoverage) Deprecated.voidsetRequestedProductClass(ProductClass requestedProductClass) Sets the requested product classvoidsetSatisfyingProducts(Set<Product> satisfyingProducts) Set the products satisfying this queryvoidsetSqlQueryCondition(String sqlQueryCondition) Sets the SQL query conditionbooleantestFilterConditions(Product product) Test whether the given product satisfies the filter conditions of this querytoString()Methods inherited from class de.dlr.proseo.model.PersistentObject
getId, getVersion, incrementVersion, setId
-
Constructor Details
-
ProductQuery
public ProductQuery()
-
-
Method Details
-
fromSimpleSelectionRule
public static ProductQuery fromSimpleSelectionRule(SimpleSelectionRule selectionRule, JobStep jobStep, Map<String, String> productColumnMapping, String facilityQuerySql, String facilityQuerySqlSubselect) Create a product query from a simple selection rule for a given job step- Parameters:
selectionRule- the selection rule to create the product query fromjobStep- the job step to generate the product query forproductColumnMapping- a mapping from attribute names of the Product class to the corresponding SQL column namesfacilityQuerySql- an SQL selection string to add to the selection rule SQL queryfacilityQuerySqlSubselect- an SQL selection string to add to sub-SELECTs in selection policy SQL query conditions- Returns:
- a product query object
-
getJobStep
Gets the job step issuing the query- Returns:
- the jobStep
-
setJobStep
Sets the job step issuing the query- Parameters:
jobStep- the jobStep to set
-
getGeneratingRule
Gets the selection rule that generated this product query- Returns:
- the generatingRule
-
setGeneratingRule
Sets the selection rule that generated this product query- Parameters:
generatingRule- the generatingRule to set
-
getRequestedProductClass
Gets the requested product class- Returns:
- the requestedProductClass
-
setRequestedProductClass
Sets the requested product class- Parameters:
requestedProductClass- the requestedProductClass to set
-
getJpqlQueryCondition
Gets the JPQL query condition- Returns:
- the jpqlQueryCondition
-
setJpqlQueryCondition
Sets the JPQL query condition- Parameters:
jpqlQueryCondition- the jpqlQueryCondition to set
-
getSqlQueryCondition
Gets the SQL query condition- Returns:
- the sqlQueryCondition
-
setSqlQueryCondition
Sets the SQL query condition- Parameters:
sqlQueryCondition- the sqlQueryCondition to set
-
getFilterConditions
Gets the additional filtering conditions- Returns:
- the filter conditions
-
setFilterConditions
Sets the additional filtering conditions- Parameters:
filterConditions- the filter conditions to set
-
getMinimumCoverage
Deprecated.Gets the minimum percentage of coverage of the desired validity period Deprecated, use getGeneratingRule().getMinimumCoverage() instead- Returns:
- the minimumCoverage
-
setMinimumCoverage
Deprecated.Sets the minimum percentage of coverage of the desired validity period Deprecated, use getGeneratingRule().setMinimumCoverage() instead- Parameters:
minimumCoverage- the minimumCoverage to set
-
getIsSatisfied
Check whether this product query is satisfied- Returns:
- the isSatisfied
-
isSatisfied
Check whether this product query is satisfied (convenience alias for getIsSatisfied())- Returns:
- the isSatisfied
-
getInDownload
- Returns:
- the inDownload
-
setInDownload
- Parameters:
inDownload- the inDownload to set
-
setIsSatisfied
Indicate that this product query is satisfied- Parameters:
isSatisfied- the isSatisfied to set
-
getSatisfyingProducts
Get the products satisfying this query- Returns:
- the satisfyingProducts
-
setSatisfyingProducts
Set the products satisfying this query- Parameters:
satisfyingProducts- the satisfyingProducts to set
-
testFilterConditions
Test whether the given product satisfies the filter conditions of this query- Parameters:
product- the product to test- Returns:
- true, if all filter conditions are met, false otherwise
-
hashCode
public int hashCode()- Overrides:
hashCodein classPersistentObject
-
equals
Description copied from class:PersistentObjectTest equality of persistent objects based on their unique ID.- Overrides:
equalsin classPersistentObject- Parameters:
obj- the object to compare this object to- Returns:
- true, if obj is a persistent object and has the same ID, false otherwise
- See Also:
-
toString
-