org.jumpmind.symmetric.db.informix.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of symmetric-ds Show documentation
Show all versions of symmetric-ds Show documentation
SymmetricDS is an open source database synchronization solution. It is platform-independent,
web-enabled, and database-agnostic. SymmetricDS was first built to replicate changes between 'retail store'
databases and ad centralized 'corporate' database.
The newest version!
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" default-lazy-init="true"> <bean id="informixDialect" class="org.jumpmind.symmetric.db.informix.InformixDbDialect" scope="prototype"> <property name="tablePrefix" value="$[sym.sync.table.prefix]" /> <property name="parameterService" ref="parameterService" /> <property name="defaultSchema" value="$[sym.db.default.schema]" /> <property name="streamingResultsFetchSize" value="$[sym.db.jdbc.streaming.results.fetch.size]" /> <property name="sqlTemplate"> <bean class="org.jumpmind.symmetric.db.SqlTemplate"> <property name="functionInstalledSql"> <value> <![CDATA[select count(*) from sysprocedures where procname = '$(functionName)' and owner = (select trim(user) from sysmaster:sysdual)]]> </value> </property> <property name="functionTemplatesToInstall"> <map> <entry key="triggers_disabled"> <value> <![CDATA[ create function $(defaultSchema)$(functionName)() returning boolean; define global symmetric_triggers_disabled boolean default 'f'; return symmetric_triggers_disabled; end function; ]]> </value> </entry> <entry key="triggers_set_disabled"> <value> <![CDATA[ create function $(defaultSchema)$(functionName)(is_disabled boolean) returning boolean; define global symmetric_triggers_disabled boolean default 'f'; let symmetric_triggers_disabled = is_disabled; return symmetric_triggers_disabled; end function; ]]> </value> </entry> <entry key="node_disabled"> <value> <![CDATA[ create function $(defaultSchema)$(functionName)() returning varchar(50); define global symmetric_node_disabled varchar(50) default null; return symmetric_node_disabled; end function; ]]> </value> </entry> <entry key="node_set_disabled"> <value> <![CDATA[ create function $(defaultSchema)$(functionName)(node_id varchar(50)) returning integer; define global symmetric_node_disabled varchar(50) default null; let symmetric_node_disabled = node_id; return 1; end function; ]]> </value> </entry> </map> </property> <property name="stringColumnTemplate"> <value> <![CDATA[rtrim(case when $(tableAlias).$(columnName) is null then '' else '"' || replace(replace($(tableAlias).$(columnName), '\', '\\'), '"', '\"') || '"' end) ||','|| ]]> </value> </property> <property name="clobColumnTemplate"> <value> <![CDATA['' ||','|| ]]> </value> </property> <property name="blobColumnTemplate"> <value> <![CDATA['' ||','|| ]]> </value> </property> <property name="numberColumnTemplate"> <value> <![CDATA[case when $(tableAlias).$(columnName) is null then '' else '"' || $(tableAlias).$(columnName) || '"' end ||','|| ]]> </value> </property> <property name="datetimeColumnTemplate"> <value> <![CDATA[case when $(tableAlias).$(columnName) is null then '' else '"' || $(tableAlias).$(columnName) || '"' end ||','|| ]]> </value> </property> <property name="booleanColumnTemplate"> <value> <![CDATA[case when $(tableAlias).$(columnName) is null then '' when $(tableAlias).$(columnName) then '"1"' else '"0"' end ||','|| ]]> </value> </property> <property name="triggerConcatCharacter" value="||"/> <property name="newTriggerValue" value="new"/> <property name="oldTriggerValue" value="old"/> <property name="sqlTemplates"> <map> <entry key="insertTriggerTemplate"> <value> <![CDATA[ create trigger $(triggerName) insert on $(schemaName)$(tableName) referencing new as new for each row when ($(syncOnInsertCondition) and $(syncOnIncomingBatchCondition)) ( insert into $(defaultSchema)$(prefixName)_data (table_name, event_type, trigger_hist_id, row_data, channel_id, transaction_id, source_node_id, external_data, create_time) values( '$(targetTableName)', 'I', $(triggerHistoryId), $(columns), '$(channelName)', $(txIdExpression), $(defaultSchema)$(prefixName)_node_disabled(), $(externalSelect), CURRENT )); ]]> </value> </entry> <entry key="updateTriggerTemplate"> <value> <![CDATA[ create trigger $(triggerName) update on $(schemaName)$(tableName) referencing old as old new as new for each row when ($(syncOnUpdateCondition) and $(syncOnIncomingBatchCondition)) ( insert into $(defaultSchema)$(prefixName)_data (table_name, event_type, trigger_hist_id, pk_data, row_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) values( '$(targetTableName)', 'U', $(triggerHistoryId), $(oldKeys), $(columns), $(oldColumns), '$(channelName)', $(txIdExpression), $(defaultSchema)$(prefixName)_node_disabled(), $(externalSelect), CURRENT )); ]]> </value> </entry> <entry key="deleteTriggerTemplate"> <value> <![CDATA[ create trigger $(triggerName) delete on $(schemaName)$(tableName) referencing old as old for each row when ($(syncOnDeleteCondition) and $(syncOnIncomingBatchCondition)) ( insert into $(defaultSchema)$(prefixName)_data (table_name, event_type, trigger_hist_id, pk_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) values( '$(targetTableName)', 'D', $(triggerHistoryId), $(oldKeys), $(oldColumns), '$(channelName)', $(txIdExpression), $(defaultSchema)$(prefixName)_node_disabled(), $(externalSelect), CURRENT )); ]]> </value> </entry> <entry key="initialLoadSqlTemplate"> <value> <![CDATA[select $(columns) from $(schemaName)$(tableName) t where $(whereClause)]]> </value> </entry> </map> </property> </bean> </property> </bean> </beans>