Class RestrictionModel
java.lang.Object
net.sf.jailer.restrictionmodel.RestrictionModel
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestrictionModel(DataModel dataModel, ExecutionContext executionContext) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRestriction(Association association, String condition, String location, boolean removePreviousRestriction, Map<String, String> parameters) Adds a restriction to a association.voidaddRestriction(Association association, String condition, String location, Map<String, String> parameters) Adds a restriction to a association.voidaddRestrictionDefinition(URL extractionModelURL, Map<String, String> parameters) Adds restrictions defined in a restriction-file.voidAdds restrictions defined in a restriction-file.getRestriction(Association association) Gets the restriction (in SQL) for an association.booleanIs the restriction-model transposed?toString()Stringifies the restriction model.voidTransposes the restriction-model.
-
Field Details
-
IGNORE
"ignore the association" - restriction.
-
-
Constructor Details
-
RestrictionModel
Constructor.- Parameters:
dataModel- the data-modelexecutionContext- the execution context
-
-
Method Details
-
transpose
public void transpose()Transposes the restriction-model. -
isTransposed
public boolean isTransposed()Is the restriction-model transposed?- Returns:
trueif the restriction-model is transposed
-
getRestriction
Gets the restriction (in SQL) for an association.- Parameters:
association- the association- Returns:
- the restriction.
nullif association is not restricted.IGNOREif association must be ignored.
-
addRestrictionDefinition
public void addRestrictionDefinition(URL extractionModelURL, Map<String, String> parameters) throws ExceptionAdds restrictions defined in a restriction-file.- Parameters:
extractionModelURL- URL of the restriction-file to readparameters- apply this parameter-value mapping to all restriction conditions- Throws:
Exception
-
addRestrictionDefinition
public void addRestrictionDefinition(CsvFile csvFile, String fileName, Map<String, String> parameters) throws ExceptionAdds restrictions defined in a restriction-file.- Parameters:
csvFile- the CSV file containing the restriction definitionsfileName- name of the restriction file (for tracking)parameters- apply this parameter-value mapping to all restriction conditions- Throws:
Exception
-
addRestriction
public void addRestriction(Association association, String condition, String location, Map<String, String> parameters) Adds a restriction to a association.- Parameters:
association- the associationcondition- the restriction-conditionlocation- location in CSV-fileparameters- apply this parameter-value mapping to all restriction conditions
-
addRestriction
public void addRestriction(Association association, String condition, String location, boolean removePreviousRestriction, Map<String, String> parameters) Adds a restriction to a association.- Parameters:
association- the associationcondition- the restriction-conditionlocation- location in CSV-fileremovePreviousRestriction- iftrue, remove any restriction on the association before adding the new oneparameters- apply this parameter-value mapping to all restriction conditions
-
toString
-