Skip to content

Commit

Permalink
TEIIDDES-1709 moved addChild() call before all setProperties() calls …
Browse files Browse the repository at this point in the history
…while walking through model object creation
  • Loading branch information
blafond committed May 7, 2013
1 parent d61ff42 commit 5dea099
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ private RelationalModel parseFile(String xmlFileUrl) {
case TYPES.TABLE: {
Properties props = getProperties(child.getAttributes());
RelationalTable table = new RelationalTable();
table.setProperties(props);
relModel.addChild(table);
table.setProperties(props);

Node primaryKeyElement = null;
Node uniqueConstraintElement = null;
Expand All @@ -191,8 +191,8 @@ private RelationalModel parseFile(String xmlFileUrl) {
case TYPES.COLUMN: {
Properties columnProps = getProperties(tableChild.getAttributes());
RelationalColumn column = new RelationalColumn();
column.setProperties(columnProps);
table.addColumn(column);
column.setProperties(columnProps);
} break;
case TYPES.PK: {
primaryKeyElement = tableChild;
Expand Down Expand Up @@ -226,8 +226,8 @@ private RelationalModel parseFile(String xmlFileUrl) {
case TYPES.VIEW: {
Properties props = getProperties(child.getAttributes());
RelationalView view = new RelationalView();
view.setProperties(props);
relModel.addChild(view);
view.setProperties(props);

Collection<Node> accessPatternNodes = new ArrayList<Node>();

Expand All @@ -245,8 +245,8 @@ private RelationalModel parseFile(String xmlFileUrl) {
case TYPES.COLUMN: {
Properties columnProps = getProperties(tableChild.getAttributes());
RelationalColumn column = new RelationalColumn();
column.setProperties(columnProps);
view.addColumn(column);
column.setProperties(columnProps);
} break;
case TYPES.AP: {
accessPatternNodes.add(tableChild);
Expand All @@ -263,8 +263,8 @@ private RelationalModel parseFile(String xmlFileUrl) {
case TYPES.PROCEDURE: {
Properties props = getProperties(child.getAttributes());
RelationalProcedure proc = new RelationalProcedure();
proc.setProperties(props);
relModel.addChild(proc);
proc.setProperties(props);

NodeList procChildren = child.getChildNodes();
if(procChildren != null && procChildren.getLength() > 0) {
Expand All @@ -278,8 +278,8 @@ private RelationalModel parseFile(String xmlFileUrl) {
case TYPES.PARAMETER: {
Properties paramProps = getProperties(procChild.getAttributes());
RelationalParameter param = new RelationalParameter();
param.setProperties(paramProps);
proc.addParameter(param);
param.setProperties(paramProps);
} break;
case TYPES.RESULT_SET: {
Properties rsProps = getProperties(procChild.getAttributes());
Expand Down Expand Up @@ -333,8 +333,8 @@ private RelationalModel parseFile(String xmlFileUrl) {
for( Node indexNode : indexNodes ) {
Properties props = getProperties(indexNode.getAttributes());
RelationalIndex index = new RelationalIndex();
index.setProperties(props);
relModel.addChild(index);
index.setProperties(props);

NodeList indexChildren = indexNode.getChildNodes();
if(indexChildren != null && indexChildren.getLength() > 0) {
Expand Down

0 comments on commit 5dea099

Please sign in to comment.