Package org.jumpmind.symmetric.route
Class SubSelectDataRouter
java.lang.Object
org.jumpmind.symmetric.route.AbstractDataRouter
org.jumpmind.symmetric.route.SubSelectDataRouter
- All Implemented Interfaces:
IBuiltInExtensionPoint
,IExtensionPoint
,IDataRouter
This data router is invoked when the router_type is 'subselect'. The router_expression is always a SQL expression that is used to find the list of nodes a
row of data will be routed to. This router should never be used for high throughput tables because it makes a call back to the database for each row that is
routed.
The query that is used to select the nodes is as follows:
select c.node_id from $[sym.sync.table.prefix]_node c where c.node_group_id=:NODE_GROUP_ID and c.sync_enabled=1 and ...
The SQL expression designated in the router_expression is appended to the above SQL statement. Current and old column values can be passed into the sub
select expression. For example, say you had an EMPLOYEE table and a PASSWORD table. When the password changes you want to route the password to the
HOME_STORE that is stored on the EMPLOYEE table. The sub select expression might look like:
c.external_id in (select home_store from employee where employee_id in (:EMPLOYEE_ID, :OLD_EMPLOYEE_ID))
-
Field Summary
Fields inherited from class org.jumpmind.symmetric.route.AbstractDataRouter
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrouteToNodes
(SimpleRouterContext routingContext, DataMetaData dataMetaData, Set<Node> nodes, boolean initialLoad, boolean initialLoadSelectUsed, TriggerRouter triggerRouter) Methods inherited from class org.jumpmind.symmetric.route.AbstractDataRouter
addNodeId, completeBatch, contextCommitted, getDataAsObject, getDataAsString, getDataMap, getDataObjectMap, getNewDataAsObject, getNewDataAsString, getNullData, getOldDataAsObject, getOldDataAsString, getPkDataAsObject, getPkDataAsString, isConfigurable, isDmlOnly, testColumnNamesMatchValues, toExternalIds, toNodeIds
-
Constructor Details
-
SubSelectDataRouter
-
-
Method Details
-
routeToNodes
public Set<String> routeToNodes(SimpleRouterContext routingContext, DataMetaData dataMetaData, Set<Node> nodes, boolean initialLoad, boolean initialLoadSelectUsed, TriggerRouter triggerRouter) - Specified by:
routeToNodes
in interfaceIDataRouter
-