Bug 1022773 - Automatically modify a column name at creating view model from XML schema
Automatically modify a column name at creating view model from XML schema
Status: NEW
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: EDS (Show other bugs)
5.3.1
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Van Halbert
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 22:39 EDT by Hisanobu Okuda
Modified: 2013-10-24 02:39 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Feature Request
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hisanobu Okuda 2013-10-23 22:39:27 EDT
Description of problem:


Teiid designer modify column names automatically even if it's not necessary. I'll write 2 examples to describe this issue.

1. In the case of the view model from following schema, even if there are the same column names on the different table, it is numbered automatically.
(I think that the nameValidator object should be created as new instance every table or table's columns in GenerateVirtualFromXsdHelper.java.)

<complexType name="table_a">
<sequence>
<element ref="tns:column_a" />
<element ref="tns:column_b" />
</sequence>
</complexType>
<complexType name="table_b">
<sequence>
<element ref="tns:column_a" />
<element ref="tns:column_b" />
</sequence>
</complexType>

2. If there is a parent element to a column like the following schema, the parent element name is added before column names.
(See GenerateVirtualFromXsdHelper.java line 213 [2].)

<element name="table_a">
<complexType>
<sequence>
<element ref="tns:column_a"/>
<element ref="tns:column_b"/>
</sequence>
</complexType>
</element>
<element name="table_b">
<complexType>
<sequence>
<element ref="tns:column_a"/>
<element ref="tns:column_b"/>
</sequence>
</complexType>
</element>


Version-Release number of selected component (if applicable):
JBoss Developer Studio 5 
Teiid Designer 7.7.x

How reproducible:


Steps to Reproduce:
1. Create two xsd file.
test1.xsd
====
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.example.org/dictionary_b"
elementFormDefault="qualified"
targetNamespace="http://www.example.org/dictionary_b">

<element name="column_a" type="string" />
<element name="column_b" type="string" />

<complexType name="table_a">
<sequence>
<element ref="tns:column_a" />
<element ref="tns:column_b" />
</sequence>
</complexType>
<complexType name="table_b">
<sequence>
<element ref="tns:column_a" />
<element ref="tns:column_b" />
</sequence>
</complexType>
</schema>
====

test2.xsd
====
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.example.org/dictionay_a"
elementFormDefault="qualified"
targetNamespace="http://www.example.org/dictionay_a">
<element name="column_a" type="string"/>
<element name="column_b" type="string"/>

<element name="table_a">
<complexType>
<sequence>
<element ref="tns:column_a"/>
<element ref="tns:column_b"/>
</sequence>
</complexType>
</element>
<element name="table_b">
<complexType>
<sequence>
<element ref="tns:column_a"/>
<element ref="tns:column_b"/>
</sequence>
</complexType>
</element>
</schema>
====

2. Import schema files using teiid designer.
Teiid designer project -> Right click -> import -> Teiid designer -> XML Schemas

3. Create view model from schemas
XSD -> Right click -> Modeling -> Create Relational View Model from Schema action

Actual results:


Expected results:


Additional info:

Note You need to log in before you can comment on or make changes to this bug.