public class SqlDuplicateFilter
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraint(java.util.Set<java.lang.String> columns) |
void |
addConstraint(java.lang.String column) |
void |
addConstraint(java.lang.String table,
java.lang.String column)
create a match definition
|
java.lang.String |
getFilterName() |
boolean |
isRunLookupIfFieldHasNull()
Returns the RunLookupIfFieldHasNull for the object
|
static SqlDuplicateFilter |
register(java.lang.String table,
SqlDataManager dm)
Registers a new duplicate filter with a callback priority of
Integer.MIN_VALUE for the lookup handler |
static SqlDuplicateFilter |
register(java.lang.String table,
SqlDataManager dm,
int onWritePriority)
Registers a new duplicate filter with a specified callback priority for the lookup (so an order to run them can be established)
|
boolean |
run(DataNode node)
apply the filter to the data nodes.
|
(package private) void |
runFilter(DataNode node,
java.util.List<java.lang.String> pks,
java.sql.Connection con) |
void |
setFilterName(java.lang.String filterName)
Sets the name for this filter.
|
void |
setRunLookupIfFieldHasNull(boolean runLookupIfFieldHasNull)
Sets the RunLookupIfFieldHasNull for the object
|
@NotNull public static SqlDuplicateFilter register(@NotNull java.lang.String table, @NotNull SqlDataManager dm)
Integer.MIN_VALUE for the lookup handlertable - The table with which to register the duplicate filterdm - The data manager@NotNull public static SqlDuplicateFilter register(@NotNull java.lang.String table, @NotNull SqlDataManager dm, int onWritePriority)
table - The table with which to register the duplicate filterdm - The data manageronWritePriority - The priority (lower is higher priority) for the registered callback (done at the DataManagerEventSource.EventFireTime#onWrite time)@InternalOnly public boolean isRunLookupIfFieldHasNull()
public void setRunLookupIfFieldHasNull(boolean runLookupIfFieldHasNull)
runLookupIfFieldHasNull - The new value for RunLookupIfFieldHasNullpublic void setFilterName(@NotNull java.lang.String filterName)
filterName - The name to use for this filter (for debugging purposes)@InternalOnly public java.lang.String getFilterName()
public void addConstraint(@NotNull java.lang.String column)
column - must be formatted as "table.column", for example if the table name is "products" and the column is price it would be "products.price"public void addConstraint(@NotNull java.util.Set<java.lang.String> columns)
columns - each String must be formatted as "table.column", for example if the table name is "products" and the column is price it would be "products.price"public void addConstraint(@Nullable java.lang.String table, @Nullable java.lang.String column)
table - The table for which to add a constraintcolumn - The name of the column to which the constraint applies@InternalOnly public boolean run(@NotNull DataNode node)
node - The node to apply the filter on