Skip to content

Commit 392fd92

Browse files
DbEntity sync nhl#131
1 parent be72d78 commit 392fd92

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

link-move/src/test/java/com/nhl/link/move/itest/CreateOrUpdateDbIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class CreateOrUpdateDbIT extends LmIntegrationTest {
1818
@Test
1919
public void test_ByAttribute() {
2020

21-
LmTask task = etl.service(ITaskService.class).createOrUpdate("etl1t")
22-
.sourceExtractor("com/nhl/link/move/itest/etl1_to_etl1t").matchBy("name").task();
21+
LmTask task = etl.service(ITaskService.class).createOrUpdate("etl11t")
22+
.sourceExtractor("com/nhl/link/move/itest/etl11_to_etl11t").matchBy("name").task();
2323

2424
srcRunSql("INSERT INTO utest.etl1 (NAME, AGE) VALUES ('a', 3)");
2525
srcRunSql("INSERT INTO utest.etl1 (NAME, AGE) VALUES ('b', NULL)");
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://linkmove.io/xsd/extractor_config_2.xsd"
3+
xmlns="http://linkmove.io/xsd/extractor_config_2.xsd">
4+
<type>jdbc</type>
5+
<connectorId>derbysrc</connectorId>
6+
<extractor>
7+
<attributes>
8+
<attribute>
9+
<type>java.lang.Integer</type>
10+
<source>ID</source>
11+
<target>db:id</target>
12+
</attribute>
13+
<attribute>
14+
<type>java.lang.String</type>
15+
<source>NAME</source>
16+
<target>name</target>
17+
</attribute>
18+
</attributes>
19+
<properties>
20+
<extractor.jdbc.sqltemplate>
21+
<![CDATA[SELECT id, name FROM utest.etl9
22+
]]>
23+
</extractor.jdbc.sqltemplate>
24+
</properties>
25+
</extractor>
26+
</config>

link-move/src/test/resources/datamap-targets.map.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
6565
<db-attribute name="name" type="VARCHAR" length="100"/>
6666
</db-entity>
67+
<db-entity name="etl11t" schema="utest">
68+
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
69+
<db-attribute name="name" type="VARCHAR" length="100"/>
70+
</db-entity>
6771
<obj-entity name="Etl10t" className="com.nhl.link.move.unit.cayenne.t.Etl10t" dbEntityName="etl10t">
6872
<obj-attribute name="name" type="java.lang.String" db-attribute-path="name"/>
6973
</obj-entity>

link-move/src/test/resources/datamap.map.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
5959
<db-attribute name="name" type="VARCHAR" length="100"/>
6060
</db-entity>
61+
<db-entity name="etl11" schema="utest">
62+
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
63+
<db-attribute name="name" type="VARCHAR" length="100"/>
64+
</db-entity>
6165
<db-relationship name="e3s" source="etl2" target="etl3" toMany="true">
6266
<db-attribute-pair source="id" target="e2_id"/>
6367
</db-relationship>

0 commit comments

Comments
 (0)