Rachitha |
Newbie |
|
Bangalore |
|
|
None Specified |
|
Friday, October 17, 2014 |
Friday, October 17, 2014 7:51:26 AM |
1 [0.01% of all post / 0.00 posts per day] |
|
Hello,
I am facing a similar problem while using Altova XMLSpy 2015 Enterprise Edition.
Below is a sample xsd I have created. Two tables Company and Employee where employee's company Id is mapped to the Company Id. I do a JDBC connection to database MySQL 5.0 and use the "Create DB structure from Xml Schema". The tables are created but no foreign keys or primary keys appear.
<?xml version="1.0" encoding="UTF-8" ?> <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Database"> <xs:complexType> <xs:sequence> <xs:element name="COMPANY"> <xs:complexType> <xs:sequence> <xs:element name="EMPLOYEE"> <xs:complexType> <xs:attribute name="EMPLOYEEID" type="xs:int"> </xs:attribute> <xs:attribute name="EMPLOYEENAME" type="xs:string"> </xs:attribute> <xs:attribute name="EMPLOYEECOMPANYID" type="xs:int"> </xs:attribute> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="COMPANYID" type="xs:int"> </xs:attribute> <xs:attribute name="COMPANYNAME" type="xs:string"> </xs:attribute> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:key name="COMPANY_PRIMARY_KEY"> <xs:selector xpath="COMPANY"/> <xs:field xpath="@COMPANYID"/> </xs:key> <xs:key name="EMPLOYEE_FOREIGN_KEY"> <xs:selector xpath="COMPANY/EMPLOYEE"/> <xs:field xpath="@EMPLOYEEID"/> <xs:field xpath="@EMPLOYEECOMPANYID"/> </xs:key> </xs:element> </xs:schema>
Let me know if I am missing any configuration setting to get this. It would be of great help.
Thank you.
Regards, Rachitha
|
|