/
ConfigurationServiceSqlMap.java
179 lines (140 loc) · 11.7 KB
/
ConfigurationServiceSqlMap.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jumpmind.symmetric.service.impl;
import java.util.Map;
import org.jumpmind.db.platform.IDatabasePlatform;
public class ConfigurationServiceSqlMap extends AbstractSqlMap {
public ConfigurationServiceSqlMap(IDatabasePlatform platform,
Map<String, String> replacementTokens) {
super(platform, replacementTokens);
// @formatter:off
putSql("updateNodeChannelLastExtractTime", "update $(node_channel_ctl) set last_extract_time=? where channel_id=? and node_id=?");
putSql("selectDataEventActionsByIdSql",
" select data_event_action from $(node_group_link) where "
+ " source_node_group_id = ? and target_node_group_id = ? ");
putSql("groupsLinksSql", ""
+ "select source_node_group_id, target_node_group_id, data_event_action, sync_config_enabled, is_reversible, last_update_time, last_update_by, create_time from "
+ " $(node_group_link) order by source_node_group_id ");
putSql("updateNodeGroupSql",
" update $(node_group) set description=?, last_update_time=?, last_update_by=? where "
+ " node_group_id=? ");
putSql("insertNodeGroupSql",
"insert into $(node_group) "
+ " (description, node_group_id, last_update_time, last_update_by, create_time) values(?,?,?,?,?) ");
putSql("updateNodeGroupLinkSql", ""
+ "update $(node_group_link) set data_event_action=?, sync_config_enabled=?, is_reversible=?, last_update_time=?, last_update_by=? where "
+ " source_node_group_id=? and target_node_group_id=? ");
putSql("insertNodeGroupLinkSql",
"insert into $(node_group_link) "
+ " (data_event_action, source_node_group_id, target_node_group_id, sync_config_enabled, is_reversible, last_update_time, last_update_by, create_time) values(?,?,?,?,?,?,?,?)");
putSql("selectNodeGroupsSql", ""
+ "select node_group_id, description, last_update_time, last_update_by, create_time from $(node_group) order by node_group_id ");
putSql("groupsLinksForSql",
"select source_node_group_id, target_node_group_id, data_event_action, sync_config_enabled, last_update_time, last_update_by, create_time from "
+ " $(node_group_link) where source_node_group_id = ? ");
putSql("countGroupLinksForSql","select count(*) from $(node_group_link) where source_node_group_id = ? and target_node_group_id = ?");
putSql("isChannelInUseSql", "select count(*) from $(trigger) where channel_id = ? ");
putSql("selectChannelsSql",
"select c.channel_id, c.processing_order, c.max_batch_size, c.enabled, " +
" c.max_batch_to_send, c.max_data_to_route, c.use_old_data_to_route, " +
" c.use_row_data_to_route, c.use_pk_data_to_route, c.contains_big_lob, " +
" c.batch_algorithm, c.extract_period_millis, c.data_loader_type, " +
" c.last_update_time, c.last_update_by, c.create_time, c.reload_flag, c.file_sync_flag, " +
" c.queue, c.max_network_kbps, c.data_event_action " +
" from $(channel) c order by c.processing_order asc, c.channel_id ");
putSql("selectChannelsWhereChannelIdLikeSql",
"select c.channel_id, c.processing_order, c.max_batch_size, c.enabled, " +
" c.max_batch_to_send, c.max_data_to_route, c.use_old_data_to_route, " +
" c.use_row_data_to_route, c.use_pk_data_to_route, c.contains_big_lob, " +
" c.batch_algorithm, c.extract_period_millis, c.data_loader_type, " +
" c.last_update_time, c.last_update_by, c.create_time, c.reload_flag, c.file_sync_flag, " +
" c.queue, c.max_network_kbps, c.data_event_action " +
" from $(channel) c where channel_id like ? order by c.processing_order asc, c.channel_id");
putSql("selectNodeChannelsSql",
"select c.channel_id, c.processing_order, "
+ " c.max_batch_size, c.enabled, c.max_batch_to_send, c.max_data_to_route, c.use_old_data_to_route, "
+ " c.use_row_data_to_route, c.use_pk_data_to_route, c.contains_big_lob, c.batch_algorithm, "
+ " c.extract_period_millis, c.data_loader_type, "
+ " last_update_time, last_update_by, create_time, c.reload_flag, c.file_sync_flag, c.queue, "
+ " c.max_network_kbps, c.data_event_action "
+ " from $(channel) c "
+ " order by c.processing_order asc, c.channel_id ");
putSql("selectNodeChannelControlSql",
" select channel_id, last_extract_time, suspend_enabled, ignore_enabled "
+ " from $(node_channel_ctl) where node_id = ? "
+ " order by channel_id ");
putSql("insertChannelSql",
"insert into $(channel) (channel_id, processing_order, max_batch_size, "
+ " max_batch_to_send, max_data_to_route, use_old_data_to_route, use_row_data_to_route, "
+ " use_pk_data_to_route, contains_big_lob, enabled, batch_algorithm, description, "
+ " extract_period_millis, data_loader_type, last_update_time, last_update_by, "
+ " create_time, reload_flag, file_sync_flag, queue, max_network_kbps, data_event_action) "
+ " values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
putSql("updateChannelSql",
"update $(channel) set processing_order=?, max_batch_size=?, "
+ " max_batch_to_send=?, max_data_to_route=?, use_old_data_to_route=?, use_row_data_to_route=?, "
+ " use_pk_data_to_route=?, contains_big_lob=?, enabled=?, batch_algorithm=?, extract_period_millis=?, "
+ " data_loader_type=?, last_update_time=?, last_update_by=?, reload_flag=?, file_sync_flag=?, queue=?, "
+ " max_network_kbps = ?, data_event_action=? "
+ " where channel_id=? ");
putSql("deleteNodeGroupLinkSql",
"delete from $(node_group_link) where source_node_group_id=? and target_node_group_id=? ");
putSql("deleteAllNodeGroupLinksSql", "delete from $(node_group_link)");
putSql("deleteNodeGroupSql", "delete from $(node_group) where node_group_id=? ");
putSql("deleteChannelSql", "delete from $(channel) where channel_id=? ");
putSql("deleteNodeChannelSql", "delete from $(node_channel_ctl) where channel_id=? ");
putSql("selectNodeGroupChannelWindowSql",
"select node_group_id, channel_id, start_time, end_time, enabled "
+ " from $(node_group_channel_wnd) where node_group_id=? and channel_id=? ");
putSql("insertNodeChannelControlSql", ""
+ "insert into $(node_channel_ctl) (node_id, channel_id, "
+ " suspend_enabled, ignore_enabled,last_extract_time) values (?, ?, ?, ?, ?) ");
putSql("updateNodeChannelControlSql",
"update $(node_channel_ctl) set "
+ " suspend_enabled=?, ignore_enabled=?, last_extract_time=? where node_id=? and channel_id=? ");
putSql("getRegistrationRedirectSql",
"select registrant_external_id, registration_node_id from $(registration_redirect)");
putSql("selectMaxChannelLastUpdateTime" ,"select max(last_update_time) from $(channel) where last_update_time is not null" );
putSql("selectMaxNodeGroupLastUpdateTime" ,"select max(last_update_time) from $(node_group) where last_update_time is not null" );
putSql("selectMaxNodeGroupLinkLastUpdateTime" ,"select max(last_update_time) from $(node_group_link) where last_update_time is not null" );
putSql("updateConflictChannelSql", "update $(conflict) set target_channel_id=? where target_channel_id=?");
putSql("updateConflictGroupsSql",
"update $(conflict) set source_node_group_id=?, target_node_group_id=? where source_node_group_id=? and target_node_group_id=?");
putSql("updateConflictSourceGroupSql", "update $(conflict) set source_node_group_id=? where source_node_group_id=?");
putSql("updateConflictTargetGroupSql", "update $(conflict) set target_node_group_id=? where target_node_group_id=?");
putSql("updateFileTriggerChannelSql", "update $(file_trigger) set channel_id=? where channel_id=?");
putSql("updateFileTriggerReloadChannelSql", "update $(file_trigger) set reload_channel_id=? where reload_channel_id=?");
putSql("updateLoadFilterGroupsSql",
"update $(load_filter) set source_node_group_id=?, target_node_group_id=? where source_node_group_id=? and target_node_group_id=?");
putSql("updateLoadFilterSourceGroupSql", "update $(load_filter) set source_node_group_id=? where source_node_group_id=?");
putSql("updateLoadFilterTargetGroupSql", "update $(load_filter) set target_node_group_id=? where target_node_group_id=?");
putSql("updateRouterGroupsSql",
"update $(router) set source_node_group_id=?, target_node_group_id=? where source_node_group_id=? and target_node_group_id=?");
putSql("updateRouterSourceGroupSql", "update $(router) set source_node_group_id=? where source_node_group_id=?");
putSql("updateRouterTargetGroupSql", "update $(router) set target_node_group_id=? where target_node_group_id=?");
putSql("updateTransformGroupsSql",
"update $(transform_table) set source_node_group_id=?, target_node_group_id=? where source_node_group_id=? and target_node_group_id=?");
putSql("updateTransformSourceGroupSql", "update $(transform_table) set source_node_group_id=? where source_node_group_id=?");
putSql("updateTransformTargetGroupSql", "update $(transform_table) set target_node_group_id=? where target_node_group_id=?");
putSql("updateTriggerChannelSql", "update $(trigger) set channel_id=? where channel_id=?");
putSql("updateTriggerReloadChannelSql", "update $(trigger) set reload_channel_id=? where reload_channel_id=?");
}
}