public abstract class OverwritePolicy extends Object
Modifier and Type | Method and Description |
---|---|
static OverwritePolicy |
byAllAttributes()
Returns an
OverwritePolicy that deletes records that are
identical in all attributes with a record being imported. |
static OverwritePolicy |
byAttributes(List<String> attributes)
Returns an
OverwritePolicy that deletes records that are
identical in the specified attributes with a record being imported. |
static OverwritePolicy |
byAttributes(String firstAttribute,
String... otherAttributes)
Returns an
OverwritePolicy that deletes records that are
identical in the specified attributes with a record being imported. |
static OverwritePolicy |
byDateFrom(String attribute,
Calendar start)
Returns an
OverwritePolicy that deletes records with a date on or
after the given date in the specified column. |
static OverwritePolicy |
byDateFromTo(String attribute,
Calendar start,
Calendar end)
Returns an
OverwritePolicy that deletes records with a date
between or on the given dates in the specified column. |
static OverwritePolicy |
byDateTo(String attribute,
Calendar end)
Returns an
OverwritePolicy that deletes records with a date
before or on the given date in the specified column. |
static OverwritePolicy |
deleteAll()
Returns an
OverwritePolicy that deletes all data in the data set
before importing. |
static OverwritePolicy |
deleteNone()
Returns an
OverwritePolicy that makes no changes to the existing
data. |
List<String> |
getAttributeCodes()
Returns all attribute codes used in this policy.
|
abstract com.fasterxml.jackson.databind.JsonNode |
toJson()
Builds this policy's JSON representation.
|
public static OverwritePolicy deleteAll()
OverwritePolicy
that deletes all data in the data set
before importing. Only the newly imported records will be present in the
data set.public static OverwritePolicy deleteNone()
OverwritePolicy
that makes no changes to the existing
data. All previous records are kept and newly imported records appended
to the data set.public static OverwritePolicy byAllAttributes()
OverwritePolicy
that deletes records that are
identical in all attributes with a record being imported. As a result, no
two records can exist in the data set that have the entirely same
attribute values.
Empty attribute values in existing data are treated as matching anything.
Existing records that match an imported record on all non-empty
attributes are deleted.public static OverwritePolicy byAttributes(String firstAttribute, String... otherAttributes)
OverwritePolicy
that deletes records that are
identical in the specified attributes with a record being imported. As a
result, no two records can exist in the data set that have the same
values for all of those attributes at once. firstAttribute
- first attributeotherAttributes
- additional, optional attributespublic static OverwritePolicy byAttributes(List<String> attributes) throws NoColumnsException
OverwritePolicy
that deletes records that are
identical in the specified attributes with a record being imported. As a
result, no two records can exist in the data set that have the same
values for all of those attributes at once. attributes
- attributes to matchNoColumnsException
- if the list is emptypublic static OverwritePolicy byDateFrom(String attribute, Calendar start)
OverwritePolicy
that deletes records with a date on or
after the given date in the specified column.
Records with an empty date value in existing data are also deleted.attribute
- date attribute to comparestart
- first day (inclusive) from which to delete datapublic static OverwritePolicy byDateTo(String attribute, Calendar end)
OverwritePolicy
that deletes records with a date
before or on the given date in the specified column.
Records with an empty date value in existing data are also deleted.attribute
- date attribute to compareend
- last day (inclusive) up to which to delete datapublic static OverwritePolicy byDateFromTo(String attribute, Calendar start, Calendar end)
OverwritePolicy
that deletes records with a date
between or on the given dates in the specified column.
Records with an empty date value in existing data are also deleted.attribute
- date attribute to comparestart
- first day (inclusive) from which to delete dataend
- last day (inclusive) up to which to delete datapublic abstract com.fasterxml.jackson.databind.JsonNode toJson()
Copyright © 2014. All rights reserved.