Skip to content

Commit

Permalink
0005295: Started work on relational to json
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed May 18, 2022
1 parent 36cff95 commit 7f34cb7
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
6 changes: 6 additions & 0 deletions symmetric-assemble/src/asciidoc/configuration.ad
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ endif::pro[]

include::configuration/groups.ad[]
include::configuration/group-links.ad[]

ifdef::pro[]
include::configuration/table-groups.ad[]
include::configuration/table-group-hiers.ad[]
endif::pro[]

include::configuration/routers.ad[]
include::configuration/channels.ad[]
include::configuration/table-triggers.ad[]
Expand Down
25 changes: 25 additions & 0 deletions symmetric-assemble/src/asciidoc/configuration/table-group-hiers.ad
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

== Table Group Hierarchies
Table group hierarchies

ID:: Unique identifier for a table group hierarchy.
Table Group ID:: Unique identifier for the table group associated with this table in the hierarchy.
Source Catalog:: Optional name for the catalog the configured table is in.
Source Schema:: Optional name for the schema the configured table is in.
Source Table:: The name of the source table that will be a part of this table group.
Parent ID:: Unique identifier for the parent of this table in the hierarchy.
Parent Relation Type::

[cols="<2,<7", options="header"]
|===
|Type
|Description

|Object|

|Array|

|===

Primary Key Column Names:: A comma-separated list of the configured table's primary keys
Foreign Key Column Names:: A comma-separated list of the configured table's foreign keys
17 changes: 17 additions & 0 deletions symmetric-assemble/src/asciidoc/configuration/table-groups.ad
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

== Table Groups
Table groups

ID:: Unique identifier for a table group.
Writer Type::

[cols="<2,<7", options="header"]
|===
|Type
|Description

|Default|

|Json|

|===
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,27 @@
*/
package org.jumpmind.symmetric.io.data.transform;

import java.util.ArrayList;
import java.util.List;

import org.jumpmind.db.model.Table;
import org.jumpmind.symmetric.io.data.CsvData;
import org.jumpmind.symmetric.io.data.transform.TableGroupHier.RelationType;

public class CsvDataHier {
private CsvData csvData;
private List<CsvDataHier> children;
private String catalog;
private String schema;
private String table;
private RelationType parentRelationType;

public CsvDataHier(CsvData csvData) {
public CsvDataHier(CsvData csvData, Table table, RelationType parentRelationType) {
this.csvData = csvData;
this.catalog = table.getCatalog();
this.schema = table.getSchema();
this.table = table.getName();
this.parentRelationType = parentRelationType;
}

public CsvData getCsvData() {
Expand All @@ -49,6 +60,41 @@ public void setChildren(List<CsvDataHier> children) {
}

public void addChild(CsvDataHier csvDataHier) {
if (children == null) {
children = new ArrayList<CsvDataHier>();
}
children.add(csvDataHier);
}

public String getCatalog() {
return catalog;
}

public void setCatalog(String catalog) {
this.catalog = catalog;
}

public String getSchema() {
return schema;
}

public void setSchema(String schema) {
this.schema = schema;
}

public String getTable() {
return table;
}

public void setTable(String table) {
this.table = table;
}

public RelationType getParentRelationType() {
return parentRelationType;
}

public void setParentRelationType(RelationType parentRelationType) {
this.parentRelationType = parentRelationType;
}
}

0 comments on commit 7f34cb7

Please sign in to comment.