diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-02 22:22:47 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-02 22:22:47 +0000 |
commit | d0e86aec253c57f94e4ebcdb2c417a825daafe3b (patch) | |
tree | 6c7cefe221bd8ef7e7f673ad98108f2e6a4a0907 /das-java/branches/das-java-M2/rdb/src/test/resources | |
parent | c6103c7c9a6b6971d2aa0b8e3997608cb5f2c36f (diff) |
moving das branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@832145 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'das-java/branches/das-java-M2/rdb/src/test/resources')
34 files changed, 1229 insertions, 0 deletions
diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/1xM_mapping_no_cud.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/1xM_mapping_no_cud.xml new file mode 100644 index 0000000000..2d80da8b1a --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/1xM_mapping_no_cud.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER" typeName="Customer"> + <Column columnName="ID" propertyName="ID" primaryKey="true"/> + </Table> + + <Table tableName="ANORDER" typeName="AnOrder"> + <Column columnName="CUSTOMER_ID" propertyName="Customer_ID"/> + <Column columnName="ID" propertyName="ID" primaryKey="true"/> + </Table> + + <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> + </Relationship> + +</Config> + diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/BooksConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/BooksConfig.xml new file mode 100644 index 0000000000..7771d18c11 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/BooksConfig.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="select book 1" SQL="select * from BOOK where BOOK_ID = 1" kind="Select"/> + <Command name="update book 1" SQL="update BOOK set OCC = ? where BOOK_ID = 1" kind="Update"/> + + <Table tableName="BOOK"> + <Column columnName="BOOK_ID" primaryKey="true"/> + <Column columnName="OCC" collision="true" propertyName="anOccColumn"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/BooksConfigWithAlias.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/BooksConfigWithAlias.xml new file mode 100644 index 0000000000..a8ff03297b --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/BooksConfigWithAlias.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="get all books" SQL="SELECT * FROM BOOK" kind="Select"/> + + <Command name="get Cat in the Hat" SQL="SELECT * FROM BOOK WHERE NAME = 'Cat in the Hat'" kind="Select"/> + + <Command name="get book by ID" SQL="SELECT * FROM BOOK WHERE BOOK.BOOK_ID = ?" kind="Select"/> + + + + <Table tableName="BOOK" typeName="Book"> + <Column columnName="BOOK_ID" primaryKey="true"/> + <Column columnName="AUTHOR" propertyName="Writer"/> + <Column columnName="OCC" collision="true"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/CompanyConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/CompanyConfig.xml new file mode 100644 index 0000000000..f0a11c554d --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/CompanyConfig.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="all companies" SQL="select * from COMPANY" kind="Select"/> + + <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/> + + <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/> + + <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/> + + <Table tableName="COMPANY"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Table tableName="DEPARTMENT"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/> + </Relationship> + + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/CompanyEmployeeConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/CompanyEmployeeConfig.xml new file mode 100644 index 0000000000..7de98dffbd --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/CompanyEmployeeConfig.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="get all companies" SQL="select * from COMPANY" kind = "Select"/> + + <Command name="get named employee" SQL="select * from EMPLOYEE where NAME= ?" kind = "Select"/> + + <Command name="get named employee with company" + SQL="select * from EMPLOYEE left outer join COMPANY on EMPLOYEE.ID = COMPANY.EOTMID where EMPLOYEE.NAME= ?" kind = "Select"/> + + <Command name="get employee by ID" SQL="select * from EMPLOYEE where ID= ?" kind = "Select"/> + + <Command name="get all employees" SQL="select * from EMPLOYEE" kind = "Select"/> + + <Command name="get companies with employee of the month" + SQL="select * from COMPANY left outer join EMPLOYEE on COMPANY.EOTMID = EMPLOYEE.ID" kind="Select"/> + + + <Table tableName="COMPANY"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Table tableName="DEPARTMENT"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Table tableName="EMPLOYEE"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Relationship name="company->employee" primaryKeyTable="EMPLOYEE" foreignKeyTable="COMPANY" many="false" > + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="EOTMID" /> + </Relationship> + +</Config> + diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/CustomerConfigWithConverter.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/CustomerConfigWithConverter.xml new file mode 100644 index 0000000000..8ba6ab3e92 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/CustomerConfigWithConverter.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + + <Command name="testArbitraryConverter" SQL="Select * from CUSTOMER where ID = 1" kind="Select"> + <ResultDescriptor columnName="ID" tableName="CUSTOMER" columnType="commonj.sdo.IntObject"/> + <ResultDescriptor columnName="LASTNAME" tableName="CUSTOMER" columnType="commonj.sdo.Date"/> + <ResultDescriptor columnName="ADDRESS" tableName="CUSTOMER" columnType="commonj.sdo.String"/> + </Command> + + <Table tableName="CUSTOMER"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="LASTNAME" converterClassName="org.apache.tuscany.das.rdb.test.mappings.SillyDateStringConverter"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/CustomerConfigWithIDConverter.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/CustomerConfigWithIDConverter.xml new file mode 100644 index 0000000000..638e70101f --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/CustomerConfigWithIDConverter.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="literal" SQL="Select 99, 'Roosevelt', '1600 Pennsylvania Avenue' from customer" kind="Select"> + <ResultDescriptor columnName="ID" tableName="CUSTOMER" columnType="commonj.sdo.Long"/> + <ResultDescriptor columnName="LASTNAME" tableName="CUSTOMER" columnType="commonj.sdo.String"/> + <ResultDescriptor columnName="ADDRESS" tableName="CUSTOMER" columnType="commonj.sdo.String"/> + </Command> + + <Table tableName="CUSTOMER"> + <Column columnName="ID" converterClassName="org.apache.tuscany.das.rdb.test.mappings.StringToLongConverter"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/CustomersOrdersConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/CustomersOrdersConfig.xml new file mode 100644 index 0000000000..4d3a0c87d9 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/CustomersOrdersConfig.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="all customers" SQL="select * from CUSTOMER" kind="Select"/> + + <Command name="customer and orders" + SQL="select * from CUSTOMER left join ANORDER on CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = ?" + kind="Select"> + </Command> + + <Command name="order by id" SQL="select * from ANORDER where ANORDER.ID = ?" + kind="Select"> + </Command> + + <Command name="update customer" + SQL="update CUSTOMER set LASTNAME = 'Pavick' where ID = ?" + kind="Update"> + </Command> + + <Table tableName="CUSTOMER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Table tableName="ANORDER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Relationship name="orders" primaryKeyTable="CUSTOMER" + foreignKeyTable="ANORDER" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> + </Relationship> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/InvalidConfig1.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/InvalidConfig1.xml new file mode 100644 index 0000000000..187609c0a0 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/InvalidConfig1.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="ORDERDETAILS"> + <Column columnName="ORDERID" primaryKey="true"/> + <Column columnName="PRODUCTID" primaryKey="true"/> + </Table> + + + <Relationship name="ORDERDETAILS" primaryKeyTable="xxx" + foreignKeyTable="ORDERDETAILS" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="ORDERID"/> + </Relationship> + +</Config>
\ No newline at end of file diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/InvalidConverter.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/InvalidConverter.xml new file mode 100644 index 0000000000..ef17c8d489 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/InvalidConverter.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +dataObjectModel="http:///org.apache.tuscany.das.rdb.test/customer.xsd"> + + <Table tableName="CUSTOMER" typeName="Customer"> + <Column columnName="ID" primaryKey="true" converterClassName="not.a.valid.class"/> + </Table> + + <Table tableName="ANORDER" typeName="AnOrder"> + <Column columnName="CUSTOMER_ID"/> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> + </Relationship> + +</Config> + diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/ManagedBooksConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/ManagedBooksConfig.xml new file mode 100644 index 0000000000..78eb967689 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/ManagedBooksConfig.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="select book 1" SQL="select * from BOOK where BOOK_ID = 1" kind="Select"/> + <Command name="update book 1" SQL="update BOOK set OCC = ? where BOOK_ID = 1" kind="Update"/> + + <Table tableName="BOOK"> + <Column columnName="BOOK_ID" primaryKey="true"/> + <Column columnName="OCC" collision="true" managed="true"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/OneToOneRestrictedConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/OneToOneRestrictedConfig.xml new file mode 100644 index 0000000000..040b28b71b --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/OneToOneRestrictedConfig.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="get all companies" SQL="select * from COMPANY" kind = "Select"/> + + <Command name="get named employee" SQL="select * from EMPLOYEE where NAME= ?" kind = "Select"/> + + <Command name="get named employee with company" + SQL="select * from EMPLOYEE left outer join COMPANY on EMPLOYEE.ID = COMPANY.EOTMID where EMPLOYEE.NAME= ?" kind = "Select"/> + + <Command name="get employee by ID" SQL="select * from EMPLOYEE where ID= ?" kind = "Select"/> + + <Command name="get all employees" SQL="select * from EMPLOYEE" kind = "Select"/> + + <Command name="get companies with employee of the month" + SQL="select * from COMPANY left outer join EMPLOYEE on COMPANY.EOTMID = EMPLOYEE.ID" kind="Select"/> + + + <Table tableName="COMPANY"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Table tableName="DEPARTMENT"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Table tableName="EMPLOYEE"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Relationship name="company" primaryKeyTable="EMPLOYEE" foreignKeyTable="COMPANY" many="false" keyRestricted="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="EOTMID" /> + </Relationship> + +</Config> + diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/OrdersOrderDetailsConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/OrdersOrderDetailsConfig.xml new file mode 100644 index 0000000000..971788329e --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/OrdersOrderDetailsConfig.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="ORDERDETAILS"> + <Column columnName="ORDERID" primaryKey="true"/> + <Column columnName="PRODUCTID" primaryKey="true"/> + </Table> + + <Table tableName="ANORDER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Relationship name="ORDERDETAILS" primaryKeyTable="ANORDER" + foreignKeyTable="ORDERDETAILS" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="ORDERID"/> + </Relationship> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/PartsConfig.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/PartsConfig.xml new file mode 100644 index 0000000000..a3477c9bf4 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/PartsConfig.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="readEngineParts" kind="Select" SQL="SELECT P1.*, P2.*, P3.* FROM PART AS P1 + LEFT JOIN PART AS P2 ON P1.ID = P2.PARENT_ID + LEFT JOIN PART AS P3 on P2.ID = P3.PARENT_ID WHERE P1.ID = 1"> + <ResultDescriptor columnName="ID" columnType="commonj.sdo.IntObject" tableName="PART"/> + <ResultDescriptor columnName="NAME" columnType="commonj.sdo.String" tableName="PART"/> + <ResultDescriptor columnName="QUANTITY" columnType="commonj.sdo.IntObject" tableName="PART"/> + <ResultDescriptor columnName="PARENT_ID" columnType="commonj.sdo.IntObject" tableName="PART"/> + + <ResultDescriptor columnName="ID" columnType="commonj.sdo.IntObject" tableName="PART"/> + <ResultDescriptor columnName="NAME" columnType="commonj.sdo.String" tableName="PART"/> + <ResultDescriptor columnName="QUANTITY" columnType="commonj.sdo.IntObject" tableName="PART"/> + <ResultDescriptor columnName="PARENT_ID" columnType="commonj.sdo.IntObject" tableName="PART"/> + + <ResultDescriptor columnName="ID" columnType="commonj.sdo.IntObject" tableName="PART"/> + <ResultDescriptor columnName="NAME" columnType="commonj.sdo.String" tableName="PART"/> + <ResultDescriptor columnName="QUANTITY" columnType="commonj.sdo.IntObject" tableName="PART"/> + <ResultDescriptor columnName="PARENT_ID" columnType="commonj.sdo.IntObject" tableName="PART"/> + + </Command> + + <Table tableName="PART"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Relationship name="subparts" primaryKeyTable="PART" foreignKeyTable="PART" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="PARENT_ID"/> + </Relationship> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicCompanyDepartmentMapping.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCompanyDepartmentMapping.xml new file mode 100644 index 0000000000..ae0d691902 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCompanyDepartmentMapping.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="COMPANY"> + <Column columnName="ID" primaryKey="true" generated="true"/> + <Column columnName="NAME"/> + </Table> + + <Table tableName="DEPARTMENT"> + <Column columnName="ID" primaryKey="true" generated="true"/> + <Column columnName="NAME"/> + <Column columnName="NUMBER"/> + <Column columnName="COMPANYID"/> + <Column columnName="EOTM"/> + </Table> + + <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/> + </Relationship> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicCompanyMapping.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCompanyMapping.xml new file mode 100644 index 0000000000..7d81e363d7 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCompanyMapping.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Table tableName="COMPANY"> + <Column columnName="ID" primaryKey="true" generated="true"/> + <Column columnName="NAME"/> + </Table> +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMapping.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMapping.xml new file mode 100644 index 0000000000..191f238515 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMapping.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="LASTNAME"/> + <Column columnName="ADDRESS"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithCUD.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithCUD.xml new file mode 100644 index 0000000000..ae29ff8d93 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithCUD.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER"> + <create sql="insert into customer values (?, ?, ?)" parameters="ID LASTNAME ADDRESS"/> + <update sql="update customer set lastname = ?, address = ? where ID = ?" parameters="LASTNAME ADDRESS ID"/> + <delete sql="delete from customer where ID = ?" parameters="ID"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithCUD2.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithCUD2.xml new file mode 100644 index 0000000000..36d2ece17b --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithCUD2.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER"> + <create sql="insert into customer values (?, ?, ?)" parameters="ID LASTNAME ADDRESS"/> + <update sql="update customer set lastname = ? where ID = ?" parameters="LASTNAME ID"/> + <delete sql="delete from customer where ID = ?" parameters="ID"/> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="LASTNAME"/> + <Column columnName="ADDRESS"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml new file mode 100644 index 0000000000..e610549909 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER"> + <create sql="isnert into customer blah values (?, ?, ?)" parameters="ID LASTNAME ADDRESS"/> + <update sql="udpate customer blah set lastname = ?, address = ? where ID = ?" parameters="LASTNAME ADDRESS ID"/> + <delete sql="dleete from customer blah where ID = ?" parameters="ID"/> + + <Column columnName="ID" primaryKey="true"/> + <Column columnName="LASTNAME"/> + <Column columnName="ADDRESS"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerOrderMapping.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerOrderMapping.xml new file mode 100644 index 0000000000..68d842e630 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicCustomerOrderMapping.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + <Table tableName="ANORDER"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="CUSTOMER_ID"/> + </Table> + + <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> + </Relationship> + +</Config> + diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/basicStaticCustomer.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/basicStaticCustomer.xml new file mode 100644 index 0000000000..2706687161 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/basicStaticCustomer.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +dataObjectModel="http:///org.apache.tuscany.das.rdb.test/customer.xsd"> + + <Table tableName="CUSTOMER" typeName="Customer"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="LASTNAME"/> + <Column columnName="ADDRESS"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/cityStates.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/cityStates.xml new file mode 100644 index 0000000000..801828f960 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/cityStates.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="STATES"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="NAME"/> + </Table> + + <Table tableName="CITIES"> + + <Column columnName="ID" primaryKey="true"/> + <Column columnName="NAME"/> + <Column columnName="STATE_ID"/> + + </Table> + + <Relationship name="cities" primaryKeyTable="STATES" foreignKeyTable="CITIES" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="STATE_ID"/> + </Relationship> + + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/company.xsd b/das-java/branches/das-java-M2/rdb/src/test/resources/company.xsd new file mode 100644 index 0000000000..a7118ec808 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/company.xsd @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<xsd:schema targetNamespace="org.apache.tuscany.das.rdb.test/company.xsd" + xmlns:company="org.apache.tuscany.das.rdb.test/company.xsd" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"> + + <xsd:element name="company" type="company:CompanyType"/> + + <xsd:complexType name="CompanyType"> + <xsd:sequence> + <xsd:element maxOccurs="unbounded" name="departments" type="company:DepartmentType"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="employeeOfTheMonth" type="xsd:IDREF" ecore:reference="EmployeeType"/> + </xsd:complexType> + + <xsd:complexType name="DepartmentType"> + <xsd:sequence> + <xsd:element maxOccurs="unbounded" name="employees" type="company:EmployeeType"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="location" type="xsd:string"/> + <xsd:attribute name="number" type="xsd:int"/> + </xsd:complexType> + <xsd:complexType name="EmployeeType"> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="SN" type="xsd:ID"/> + <xsd:attribute name="manager" type="xsd:boolean"/> + </xsd:complexType> + </xsd:schema> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/companyMapping.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/companyMapping.xml new file mode 100644 index 0000000000..795c36a783 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/companyMapping.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="COMPANY" typeName="CompanyType"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Table tableName="DEPARTMENT" typeName="DepartmentType"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Table tableName="EMPLOYEE" typeName="EmployeeType"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/> + </Relationship> + + <Relationship name="employees" primaryKeyTable="DEPARTMENT" foreignKeyTable="EMPLOYEE" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="DEPARTMENTID"/> + </Relationship> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/companyMappingWithConverters.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/companyMappingWithConverters.xml new file mode 100644 index 0000000000..93bbea5130 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/companyMappingWithConverters.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +dataObjectModel="org.apache.tuscany.das.rdb.test/company.xsd"> + + <Table tableName="COMPANY" typeName="CompanyType"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Table tableName="DEPARTMENT" typeName="DepartmentType"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="DEPNUMBER" propertyName="NUMBER" converterClassName="org.apache.tuscany.das.rdb.test.mappings.StringToIntegerConverter"/> + </Table> + + <Table tableName="EMPLOYEE" typeName="EmployeeType"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="MANAGER" converterClassName="org.apache.tuscany.das.rdb.test.mappings.IntegerToBooleanConverter"/> + </Table> + + <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/> + </Relationship> + + <Relationship name="employees" primaryKeyTable="DEPARTMENT" foreignKeyTable="EMPLOYEE" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="DEPARTMENTID"/> + </Relationship> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/customer.xsd b/das-java/branches/das-java-M2/rdb/src/test/resources/customer.xsd new file mode 100644 index 0000000000..e5482ae3a0 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/customer.xsd @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:this="http:///org.apache.tuscany.das.rdb.test/customer.xsd" targetNamespace="http:///org.apache.tuscany.das.rdb.test/customer.xsd"> + + <xsd:complexType name="Customer"> + <xsd:sequence> + <xsd:element name="ID" nillable="false" type="xsd:int"/> + <xsd:element name="lastName" type="xsd:string"/> + <xsd:element name="address" type="xsd:string"/> + <xsd:element maxOccurs="unbounded" name="orders" type="this:AnOrder"/> + </xsd:sequence> + </xsd:complexType> + + + <!-- An Order --> + <xsd:complexType name="AnOrder"> + <xsd:sequence> + <xsd:element name="ID" nillable="false" type="xsd:int"/> + <xsd:element name="Product" type="xsd:string"/> + <xsd:element name="Quantity" type="xsd:int"/> + <xsd:element name="Customer_ID" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + + +</xsd:schema> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/customerMapping.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/customerMapping.xml new file mode 100644 index 0000000000..56f7c9d5b1 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/customerMapping.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER" typeName="Customer"> + <Column columnName="ID" propertyName="id" primaryKey="true"/> + <Column columnName="LASTNAME" propertyName="lastname"/> + <Column columnName="ADDRESS" propertyName="address"/> + </Table> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/customerOrderRelationshipMapping.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/customerOrderRelationshipMapping.xml new file mode 100644 index 0000000000..fb816c5628 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/customerOrderRelationshipMapping.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + <Table tableName="ANORDER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> + </Relationship> + +</Config> + diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/passiveConnection.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/passiveConnection.xml new file mode 100644 index 0000000000..b343d52b02 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/passiveConnection.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <ConnectionInfo managedtx="false"/> + + <Command name="get a customer" SQL="Select * from CUSTOMER where ID = 1" kind="select"/> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/staticCustomer.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/staticCustomer.xml new file mode 100644 index 0000000000..169e9e2f8e --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/staticCustomer.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +dataObjectModel="http:///org.apache.tuscany.das.rdb.test/customer.xsd"> + + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/staticCustomerOrder.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/staticCustomerOrder.xml new file mode 100644 index 0000000000..81c9628da1 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/staticCustomerOrder.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +dataObjectModel="http:///org.apache.tuscany.das.rdb.test/customer.xsd"> + + <Command name="Customer and Orders" SQL="SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = ?" kind="Select"/> + + <Table tableName="CUSTOMER" typeName="Customer"> + <Column columnName="ID" primaryKey="true"/> + </Table> + <Table tableName="ANORDER" typeName="AnOrder"> + <Column columnName="ID" primaryKey="true"/> + <Column columnName="CUSTOMER_ID"/> + </Table> + + <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> + </Relationship> + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/staticInvalid.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/staticInvalid.xml new file mode 100644 index 0000000000..6b76ae3309 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/staticInvalid.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +dataObjectModel="invalidURI"> + + +</Config> diff --git a/das-java/branches/das-java-M2/rdb/src/test/resources/storedProcTest.xml b/das-java/branches/das-java-M2/rdb/src/test/resources/storedProcTest.xml new file mode 100644 index 0000000000..04744dfbb9 --- /dev/null +++ b/das-java/branches/das-java-M2/rdb/src/test/resources/storedProcTest.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> + +<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Command name="getNamedCustomers" SQL="{call GETNAMEDCUSTOMERS(?,?)}" kind="procedure"> + <Parameter direction="IN" columnType="commonj.sdo.String"/> + <Parameter direction="OUT" columnType="commonj.sdo.IntObject"/> + </Command> + +</Config> |