diff options
Diffstat (limited to 'tags/java-stable-20060304/das/rdb')
200 files changed, 0 insertions, 33591 deletions
diff --git a/tags/java-stable-20060304/das/rdb/LICENSE.txt b/tags/java-stable-20060304/das/rdb/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/das/rdb/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. diff --git a/tags/java-stable-20060304/das/rdb/pom.xml b/tags/java-stable-20060304/das/rdb/pom.xml deleted file mode 100644 index 6cbd9b1163..0000000000 --- a/tags/java-stable-20060304/das/rdb/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - --> -<project> - <parent> - <groupId>org.apache.tuscany.das</groupId> - <artifactId>tuscany-das</artifactId> - <version>SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <artifactId>tuscany-das-rdb</artifactId> - <name>Tuscany DAS for Relational Databases</name> - <version>SNAPSHOT</version> - - <dependencies> - <dependency> - <groupId>commonj</groupId> - <artifactId>sdo-api</artifactId> - <version>SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany</groupId> - <artifactId>tuscany-sdo-impl</artifactId> - <version>SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.1.2.1</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile> - </archive> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <includes> - <include>**/*AllTestsDerby.java</include> - </includes> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ApplyChangesCommand.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ApplyChangesCommand.java deleted file mode 100644 index 0c53492d15..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ApplyChangesCommand.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * An ApplyChangesCommand is used to flush the changes associated with a - * modified graph of DataObjects to a database. - * - * - */ -public interface ApplyChangesCommand { - - /** - * Adds a user-provided update command. In the absence of a user-provided - * command, the DAS will generate one. However this alternative may make - * sense if the user requires a SQL statement different from what the DAS - * generates. - * - * @param type - * The DataObject type this command applys to - * @param cmd - * The Command used to UPDATE data objects of the specified type - */ - public void addUpdateCommand(Type type, Command cmd); - - /** - * Adds a user-provided create command. In the absence of a user-provided - * command, the DAS will generate one. However this alternative may make - * sense if the user requires a SQL statement different from what the DAS - * generates. - * - * @param type - * The DataObject type this command applys to - * @param cmd - * The Command used to INSERT data objects of the specified type - */ - public void addCreateCommand(Type type, Command cmd); - - /** - * Adds a user-provided delete command. In the absence of a user-provided - * command, the DAS will generate one. However this alternative may make - * sense if the user requires a SQL statement different from what the DAS - * generates. - * - * @param type - * The DataObject type this command applys to - * @param cmd - * The Command used to DELETE data objects of the specified type - */ - public void addDeleteCommand(Type type, Command cmd); - - /** - * The change history is scanned and modifications to the graph of data - * objects are flushed to the database. - * - * @param root - * the topmost containing data object - */ - public void execute(DataObject root); - - /** - * TODO - Need to remove this. COnfig now set via factory method - */ - public void setMapping(InputStream mappingModel) throws IOException; - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - */ - public void setConnection(Connection connection); - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - * @param manageTransactions - * <code>true</code> if the DAS should perform tx - * commit/rollback - */ - public void setConnection(Connection connection, boolean manageTransactions); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parent - * a name identifying the relationship parent key (example: - * "CUSTOMER.ID") - * @param child - * a name identifying the relationship child key - * ("ORDER.CUSTOMER_ID") - */ - public void addRelationship(String parent, String child); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parentKey - * the parent key for the relationship - * @param childKey - * the child key in the relationship - * @see Key - */ - public void addRelationship(Key parentKey, Key childKey); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param pk - * the string identifying a prmary key. (Example: "CUSTOMER.ID") - */ - public void addPrimaryKey(String columnName); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param key - * the primary key - * @see Key - */ - public void addPrimaryKey(Key key); - - /** - * Adds a column to be used in a optimistic concurrency control (OCC) - * strategy. The generated UPDATE statement will include a overqualified - * where clause using this column - * - * @param columnName - * the name of the column to be used for OCC - */ - public void addCollisionColumn(String columnName); - - /** - * Add metadata that indicate a column is a generated primary key. - * - * @param string - * the name of the generated primary key column. Example - * ("COMPANY.ID") - */ - public void addGeneratedPrimaryKey(String columnName); - - /** - * Associate a {@link Converter} with a column to be used by this command. - * This is an alternative to providing the same information in a config - * file. - * - * @param name - * the name of the column being assigned a converter (example: - * "CUSTOMER.LASTNAME") - * @param converterName - * the name of the converter instance being assigned (example: - * org.company.project.StringConverter) - * @see Converter - **/ - public void addConverter(String name, String converterName); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Command.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Command.java deleted file mode 100644 index 0f5534f705..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Command.java +++ /dev/null @@ -1,283 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.impl.CommandFactoryImpl; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * A Command is used to execute a read or write to a database - * - * - */ -public interface Command { - - public static CommandFactory FACTORY = new CommandFactoryImpl(); - - /** - * Performs the function defined by the command - */ - public void execute(); - - /** - * Performs the function defined by the command and return the results in - * the root DataObject - * - * @return the root DataObject - */ - public DataObject executeQuery(); - - /** - * Returns the parameter associated with "name" - * - * @param name - * the name of the parameter - * @return the associated parameter - */ - public Parameter getParameter(String name); - - /** - * Returns the Parameter at index - * - * @param index - * the index of the Parameter - * @return the associated Parameter - */ - public Parameter getParameter(int index); - - /** - * Sets the value of the named Parameter - * - * @param name - * the name of this Parameter - * @param value - * the value for the Parameter - */ - public void setParameterValue(String name, Object value); - - /** - * Sets the value of the associated Parameter - * - * @param index - * the index of the Parameter - * @param value - * the value for the Parameter - */ - public void setParameterValue(int index, Object value); - - /** - * Sets the "type" of the associated Parameter - * - * @param name - * the name of this Parameter - * @param type - * the SDODataTypes-defined "type" for the Parameter. - */ - public void setParameterType(String string, Type dataType); - - /** - * Sets the "type" of the associated Parameter - * - * @param index - * the index of the Parameter - * @param type - * the SDODataTypes-defined "type" for the Parameter. - */ - public void setParameterType(int index, Type dataType); - - /** - * Returns the value of the associated Parameter - * - * @param name - * the name of the Parameter - * @return the value of the Parameter - */ - public Object getParameterValue(String name); - - /** - * Returns the value of the associated Parameter - * - * @param index - * the index of the Parameter - * @return the value of the Parameter - */ - public Object getParameterValue(int index); - - /** - * Adds a Parameter to the command - * - * @param index - * the index of the parameter - * @param sdoType - * the commonj.sdo.Type of the Parameter - */ - public void addParameter(int index, Type sdoType); - - /** - * Adds a Parameter to the command - * - * @param name - * the index of the parameter - * @param sdoType - * the commonj.sdo.Type of the Parameter - */ - public void addParameter(String name, Type sdoType); - - /** - * Adds a Parameter to the command - * - * @param index - * the index of the parameter - * @param direction - * the direction of the Parameter. Either Parameter.IN, - * Parameter.OUT or Parameter.INOUT - * @param sdoType - * specifies the type as a commonj.sdo.Type from - * {@link SDODataTypes} - */ - public void addParameter(int index, int direction, Type sdoType); - - /** - * Adds a Parameter to the command - * - * @param name - * the name associated with the Parameter - * @param direction - * the direction of the Parameter. Either Parameter.IN, - * Parameter.OUT or Parameter.INOUT - * @param sdoType - * specifies the type as a commonj.sdo.Type from - * {@link SDODataTypes} - */ - public void addParameter(String name, int direction, Type sdoType); - - /** - * Specifies an object model for a graph of DataObjects returned by - * #executeQuery() - * - * @param schema - * the model as a commonj.sdo.Type - */ - public void setDataObjectModel(Type schema); - - /** - * Defines the structure of the ResultSet returned by the JDBC Driver when - * this command is executed. If the shape is not specified then the shape is - * taken from the ResultSetMetatadta instance provided by the JDBC Driver. - * <p> - * This method is prvided primarily to support platforms (such as Oracle) - * that do not provide complete support for ResultSetMetadata - * - * @param shape - * the specified result set shape - * @see ResultSetShape - */ - public void setResultSetShape(ResultSetShape shape); - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - */ - public void setConnection(Connection connection); - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - * @param manageTransactions - * <code>true</code> if the DAS should perform tx - * commit/rollback - */ - public void setConnection(Connection connection, boolean manageTransactions); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parent - * a name identifying the relationship parent key (example: - * "CUSTOMER.ID") - * @param child - * a name identifying the relationship child key - * ("ORDER.CUSTOMER_ID") - */ - public void addRelationship(String parent, String child); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parentKey - * the parent key for the relationship - * @param childKey - * the child key in the relationship - * @see Key - */ - public void addRelationship(Key parentKey, Key childKey); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param pk - * the string identifying a prmary key. (Example: "CUSTOMER.ID") - */ - public void addPrimaryKey(String pk); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param key - * the primary key - * @see Key - */ - public void addPrimaryKey(Key key); - - /** - * Associate a {@link Converter} with a column to be used by this command. - * This is an alternative to providing the same information in a config - * file. - * - * @param name - * the name of the column being assigned a converter (example: - * "CUSTOMER.LASTNAME") - * @param converterName - * the name of the converter instance being assigned (example: - * org.company.project.StringConverter) - * @see Converter - */ - public void addConverter(String name, String converterName); - - /** - * Cleans up and realeases all resources associated with this command. This - * should be called when the application is done with this command. - */ - public void close(); - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandFactory.java deleted file mode 100644 index c68855ec2a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import java.io.IOException; -import java.io.InputStream; - -/** - * A CommandFactory produces {@link Command} and {@link ApplyChangesCommand} - * instances. - * - * - */ -public interface CommandFactory { - - /** - * Creates a Command based on the provided SQL statement - * - * @param sql - * The SQL statement - * @return returns a Command instance - */ - public Command createCommand(String sql); - - /** - * Creates a Command based on the provided SQL statement and configuration - * - * @param sql - * The SQL statement - * @param mappingModel - * The congiguration as XML file stream - * @return returns a COmmand instance - */ - public Command createCommand(String sql, InputStream mappingModel); - - /** - * Creates an {@linkApplyChangesCommand} instance - * @return Returns the ApplyChangesCommand instance - */ - public ApplyChangesCommand createApplyChangesCommand(); - - /** - * Creates an {@linkApplyChangesCommand} instance with the provided configuration - * @param mappingModel The provided configuration as a stream over an xml file - * @return Returns an ApplyChangesCOmmand in stance - * @throws IOException - * TODO - Either remove this throws clause or add it to createCommand - */ - public ApplyChangesCommand createApplyChangesCommand( - InputStream mappingModel) throws IOException; - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroup.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroup.java deleted file mode 100644 index 5a39e0d390..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroup.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.impl.CommandGroupFactoryImpl; - -/** - * A CommandGroup represents a set of {@link Command} and single - * {@link ApplyChangesCommand} that are created from a common config file. - * - * - */ -public interface CommandGroup { - - public static CommandGroupFactory FACTORY = new CommandGroupFactoryImpl(); - - /** - * Return the ApplyChangesCommnad for this configured factory - * - * @return Returns an instance of ApplyChangesCommand - */ - public ApplyChangesCommand getApplyChangesCommand(); - - /** - * Gets the named command from this factory's inventory - * - * @param name - * The identifying name of the requested command - * @return Returns the identified command - */ - public Command getCommand(String name); - - /** - * Set the default connection for all command in the group - * - * @param connection - */ - public void setConnection(Connection connection); - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroupFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroupFactory.java deleted file mode 100644 index dfcdd81823..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroupFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import java.io.InputStream; - -/** - * A CommandGroupFactory produces {@link CommandGroup} instances. - * - * - */ -public interface CommandGroupFactory { - - /** - * Creates a CommandGroup based on the provided config file stream - * - * @param configStream - * A stream over a DAS config file - * @return returns a CommandGroup instance - */ - public CommandGroup createCommandGroup(InputStream configStream); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Converter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Converter.java deleted file mode 100644 index 8110d2c5a5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Converter.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -/** - * A lightweight Tabele-column <--> DataObject-property converter framework. - * Converters allow a user to insert a transformation between a column value and - * is destination DataObject property value. For example, by default, a VARCHAR - * column will be represented as a String in its corresponding DataObject - * property. A user could insert a converter that transforms the the VARCHAR - * value to an Integer. If this is done then although the column returns - * character data, the DataObject property will be an Integer - * - * - */ -public interface Converter { - - /** - * Transform the columnData object to a new value and possibly new type. - * This should be the invers operation of #getColumnValue - * - * @param columnData - * The column value to transorm - * @return Returns the transformed value - */ - public Object getPropertyValue(Object columnData); - - /** - * Transform the columnData object to a new value and possibly new type. - * This should be the invers operation of #getPropertyValue - * - * @param propertyData - * The property value to transform - * @return Returns the transformed value - */ - public Object getColumnValue(Object propertyData); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Key.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Key.java deleted file mode 100644 index 4622b2a8fb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Key.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import java.util.ArrayList; -import java.util.List; - -/** - * A key instance is used to describe a Table key definition. This is used - * primarily for compound keys since simple keys are described with a name. - * - * - */public class Key { - - private List columnNames = new ArrayList(); - - /** - * Contructor for a single column key - * @param columnName The single column fo rthe key - */ - public Key(String columnName) { - super(); - this.columnNames.add(columnName); - } - - /** - * Constructor for a compound key - * @param columns The array of column names that compose the key - */ - public Key(String[] columns) { - for (int i=0;i<columns.length; i++) { - this.columnNames.add(columns[i]); - } - } - - /** - * Returns a List of column names that compose the key - * @return a list of column names - */ - public List getColumNames() { - return this.columnNames; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Pager.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Pager.java deleted file mode 100644 index 4edb447e31..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Pager.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import commonj.sdo.DataObject; - -/** - * An iterator-like interface to conveniently move through chunks of data. The - * idea is that a Pager works with a read Command. The read command returns a - * large amount of data and the client wants to work with chunks of it at a - * time. So the Pager is created on the command and each call to next returns - * the next chunk of data. This is done completely disconnected. No cursor is - * maintained between calls to #next. - * - * TODO - This is very preliminary. We need to look at this interface in the - * context of disonnected scenarios such as a web app. The Pager instance will - * probably be saved in session so it must be very light and cannot reference a - * connection. Also, we probably need to define a factory or add a method to set - * page size. - * - * - */ -public interface Pager { - - /** - * Get the next page of data - * - * @return the next page of data - */ - public DataObject next(); - - /** - * Get the page prior to the last page returned - * - * @return the previous page - */ - public DataObject previous(); - - /** - * Return a specific identified page. - * - * @param page - * The number of the page to return - * @return the indicated page - */ - public DataObject getPage(int page); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Parameter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Parameter.java deleted file mode 100644 index 89251cbd0f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Parameter.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import commonj.sdo.Type; - -/** - * Describes a single parameter for a parameterized SQL statement. - * - * - */ -public interface Parameter { - - /** - * Value for "Direction" that indicates that a parameter is soley for input. - */ - final static int IN = 1; - - /** - * Value for "Direction" that indicates that a parameter is soley for - * output. Out parameters only apply to Stored Procedures - */ - final static int OUT = 2; - - /** - * Value for "Direction" that indicates that a parameter is for both input - * and output. In-out parameters only apply to stored procedures - */ - final static int IN_OUT = 3; - - /** - * A parameter has a type in terms of SDO2 DataTypes. Legal values are - * provided in {@link SDODataTypes} - * <p> - * Explicit definition of type is required only for OUT parameters of stored - * procedures commands - * - * @param type - */ - public void setType(Type type); - - /** - * Set the index of the parameter. For example, if a SQL statement requires - * two parameters, the first one has an index of one. - * - * @param index - * The index of the parameter - */ - public void setIndex(int index); - - /** - * Sets the name of the parameter - * - * @param name - * the parameter name - */ - public void setName(String name); - - /** - * Sets the value of the parameter. All IN and IN_OUT parameters must be set - * beore a command can be executed. - * - * @param value - * The value for the parameter - */ - public void setValue(Object value); - - /** - * Parameters are typically IN and this is the default. A parameter's - * direction must be set when the parameter is OUT or IN_OUT. - * - * @param direction - * the parameters direction - */ - public void setDirection(int direction); - - /** - * TODO Not sure this method is needed. - * @param converter - */ - public void setConverter(Converter converter); - - /** - * @return the type of the paramater in terms of {@link SDODataTypes} - */ - public Type getType(); - - /** - * TODO Not sure this is is needed. - * @return - */ - public Converter getConverter(); - - /** - * @return the index of the parameter - */ - public int getIndex(); - - /** - * @return the name of the parameter - */ - public String getName(); - - /** - * @return the value of the parameter - */ - public Object getValue(); - - /** - * @return the direction of the parameter - */ - public int getDirection(); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java deleted file mode 100644 index 52d4487963..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import java.sql.ResultSetMetaData; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.graphbuilder.impl.DefaultConverter; -import org.apache.tuscany.das.rdb.graphbuilder.schema.ResultSetTypeMap; - -import commonj.sdo.Type; - -/** - * Describes the structure of the result set returned from execution - * of a SELECT statement. This description is typcially not required since the - * shape can be retreived from the JDBC ResultSetMetadata. However, some platforms - * such as Oracle do not support fully suport ResultSetMedata. - * <p> - * There may also be a performance boost when using this interface. - * - * TODO - This is very preliminary. We need to go over this again and consider making is as close as possible to - * to the infromation returned from ResultSetMetadata. For example, we may want to use JDBC types - * here rather than SDODataTypes. Also, ResultSetMetadata doe not provide converters, so, maybe this - * interface should also not. - * - * - */ -public class ResultSetShape { - - private final String[] columns; - private final String[] tables; - private final Type[] types; - //TODO - Are converters really needed here? - private Converter[] converters; - - public ResultSetShape(String[] t, String[] c, Type[] dataTypes) { - this.columns = c; - this.tables = t; - this.types = dataTypes; - this.converters = new DefaultConverter[c.length]; - } - - public ResultSetShape(ResultSetMetaData metadata) throws SQLException { - columns = new String[metadata.getColumnCount()]; - tables = new String[metadata.getColumnCount()]; - types = new Type[metadata.getColumnCount()]; - converters = new DefaultConverter[metadata.getColumnCount()]; - - ResultSetTypeMap typeMap = ResultSetTypeMap.instance; - for (int i = 1; i <= metadata.getColumnCount(); i++) { - tables[i-1] = metadata.getTableName(i); - columns[i-1] = metadata.getColumnName(i); - types[i-1] = typeMap.getType(metadata.getColumnType(i), true); - } - } - - public int getColumnCount() { - return columns.length; - } - - public String getTableName(int i) { - return tables[i-1]; - } - - public String getColumnName(int i) { - return columns[i-1]; - } - - public Type getColumnType(int i) { - return types[i-1]; - } - - public void setConverter(int i, Converter converter) { - this.converters[i] = converter; - } - - public Converter getConverter(int i) { - return this.converters[i-1]; - } - - public void setConverterFactory(Converter converter) { - for ( int i=0; i < getColumnCount(); i++ ) { - this.converters[i] = converter; - } - - } - - public String toString() { - StringBuffer result = new StringBuffer(); - result.append(" column/table/type: "); - for (int i=0; i < columns.length; i++) { - result.append(columns[i]); - result.append('\t'); - result.append(tables[i]); - result.append('\t'); - if ( types[i] == null ) - result.append("null"); - else - result.append(types[i].getName()); - result.append('\t'); - result.append(converters[i]); - result.append('\n'); - } - - return result.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java deleted file mode 100644 index 65184c88cb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb; - -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - -/** - * Defines SDO data types. This is used primalirly to type stored procedure OUT parameters. - * - * TODO - This maybe be obviated by the move to SDO2. We also need to settle the question - * of whether config information is in terms of database or data object types - * - * - */public class SDODataTypes { - - static TypeHelper helper = TypeHelper.INSTANCE; - - final public static Type BOOLEAN = helper.getType("commonj.sdo", "Boolean"); - final public static Type BYTE = helper.getType("commonj.sdo", "Byte"); - final public static Type BYTES = helper.getType("commonj.sdo", "ByteArray"); - final public static Type CHARACTER = helper.getType("commonj.sdo", "Char"); - final public static Type DATE = helper.getType("commonj.sdo", "Date"); - final public static Type DATETIME = helper.getType("commonj.sdo", "Date"); - final public static Type DAY = helper.getType("commonj.sdo", "Date"); - final public static Type DECIMAL = helper.getType("commonj.sdo", "Float"); - final public static Type DOUBLE =helper.getType("commonj.sdo", "Double"); - final public static Type DURATION = helper.getType("commonj.sdo", "Date"); - final public static Type FLOAT = helper.getType("commonj.sdo", "Float"); - final public static Type INT = helper.getType("commonj.sdo", "Int"); - final public static Type INTEGER = helper.getType("commonj.sdo", "Integer"); - final public static Type LONG = helper.getType("commonj.sdo", "Long"); - final public static Type MONTH = helper.getType("commonj.sdo", "Date"); - final public static Type MONTHDAY = helper.getType("commonj.sdo", "Date"); - final public static Type OBJECT = helper.getType("commonj.sdo", "Object"); - final public static Type SHORT = helper.getType("commonj.sdo", "Short"); - final public static Type STRING = helper.getType("commonj.sdo", "String"); - final public static Type STRINGS = helper.getType("commonj.sdo", "String"); - final public static Type TIME = helper.getType("commonj.sdo", "Date"); - final public static Type URI = helper.getType("commonj.sdo", "String"); - final public static Type YEAR = helper.getType("commonj.sdo", "Date"); - final public static Type YEARMONTH = helper.getType("commonj.sdo", "Date"); - final public static Type YEARMONTHDAY = helper.getType("commonj.sdo", "Date"); - final public static Type BOOLEANOBJECT = helper.getType("commonj.sdo", "BooleanObject"); - final public static Type BYTEOBJECT = helper.getType("commonj.sdo", "ByteObject"); - final public static Type CHARACTEROBJECT = helper.getType("commonj.sdo", "CharacterObject"); - final public static Type DOUBLEOBJECT = helper.getType("commonj.sdo", "DoubleObject"); - final public static Type FLOATOBJECT = helper.getType("commonj.sdo", "FloatObject"); - final public static Type INTEGEROBJECT = helper.getType("commonj.sdo", "IntObject"); - final public static Type LONGOBJECT = helper.getType("commonj.sdo", "LongObject"); - final public static Type SHORTOBJECT = helper.getType("commonj.sdo", "ShortObject"); - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Column.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Column.java deleted file mode 100644 index e004726fbe..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Column.java +++ /dev/null @@ -1,306 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Column</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#isCollision <em>Collision</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#getColumnType <em>Column Type</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#getConverterClassName <em>Converter Class Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#isGenerated <em>Generated</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey <em>Primary Key</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#getPropertyName <em>Property Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Column#getTable <em>Table</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface Column -{ - /** - * Returns the value of the '<em><b>Collision</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Collision</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Collision</em>' attribute. - * @see #isSetCollision() - * @see #unsetCollision() - * @see #setCollision(boolean) - * @generated - */ - boolean isCollision(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isCollision <em>Collision</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Collision</em>' attribute. - * @see #isSetCollision() - * @see #unsetCollision() - * @see #isCollision() - * @generated - */ - void setCollision(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isCollision <em>Collision</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetCollision() - * @see #isCollision() - * @see #setCollision(boolean) - * @generated - */ - void unsetCollision(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isCollision <em>Collision</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Collision</em>' attribute is set. - * @see #unsetCollision() - * @see #isCollision() - * @see #setCollision(boolean) - * @generated - */ - boolean isSetCollision(); - - /** - * Returns the value of the '<em><b>Column Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Column Type</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Column Type</em>' attribute. - * @see #setColumnType(String) - * @generated - */ - String getColumnType(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getColumnType <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Column Type</em>' attribute. - * @see #getColumnType() - * @generated - */ - void setColumnType(String value); - - /** - * Returns the value of the '<em><b>Converter Class Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Converter Class Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Converter Class Name</em>' attribute. - * @see #setConverterClassName(String) - * @generated - */ - String getConverterClassName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getConverterClassName <em>Converter Class Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Converter Class Name</em>' attribute. - * @see #getConverterClassName() - * @generated - */ - void setConverterClassName(String value); - - /** - * Returns the value of the '<em><b>Generated</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Generated</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Generated</em>' attribute. - * @see #isSetGenerated() - * @see #unsetGenerated() - * @see #setGenerated(boolean) - * @generated - */ - boolean isGenerated(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated <em>Generated</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Generated</em>' attribute. - * @see #isSetGenerated() - * @see #unsetGenerated() - * @see #isGenerated() - * @generated - */ - void setGenerated(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated <em>Generated</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetGenerated() - * @see #isGenerated() - * @see #setGenerated(boolean) - * @generated - */ - void unsetGenerated(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated <em>Generated</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Generated</em>' attribute is set. - * @see #unsetGenerated() - * @see #isGenerated() - * @see #setGenerated(boolean) - * @generated - */ - boolean isSetGenerated(); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the '<em><b>Primary Key</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Primary Key</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Primary Key</em>' attribute. - * @see #isSetPrimaryKey() - * @see #unsetPrimaryKey() - * @see #setPrimaryKey(boolean) - * @generated - */ - boolean isPrimaryKey(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey <em>Primary Key</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Primary Key</em>' attribute. - * @see #isSetPrimaryKey() - * @see #unsetPrimaryKey() - * @see #isPrimaryKey() - * @generated - */ - void setPrimaryKey(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey <em>Primary Key</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetPrimaryKey() - * @see #isPrimaryKey() - * @see #setPrimaryKey(boolean) - * @generated - */ - void unsetPrimaryKey(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey <em>Primary Key</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Primary Key</em>' attribute is set. - * @see #unsetPrimaryKey() - * @see #isPrimaryKey() - * @see #setPrimaryKey(boolean) - * @generated - */ - boolean isSetPrimaryKey(); - - /** - * Returns the value of the '<em><b>Property Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Property Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Property Name</em>' attribute. - * @see #setPropertyName(String) - * @generated - */ - String getPropertyName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getPropertyName <em>Property Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Property Name</em>' attribute. - * @see #getPropertyName() - * @generated - */ - void setPropertyName(String value); - - /** - * Returns the value of the '<em><b>Table</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Table</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Table</em>' attribute. - * @see #setTable(String) - * @generated - */ - String getTable(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getTable <em>Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Table</em>' attribute. - * @see #getTable() - * @generated - */ - void setTable(String value); - -} // Column diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Command.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Command.java deleted file mode 100644 index 3bce9e601e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Command.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Command</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.Command#getParameter <em>Parameter</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Command#getResultDescriptor <em>Result Descriptor</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Command#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Command#getKind <em>Kind</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Command#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Command#getSQL <em>SQL</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface Command -{ - /** - * Returns the value of the '<em><b>Parameter</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Parameter}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Parameter</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Parameter</em>' containment reference list. - * @generated - */ - List getParameter(); - - /** - * Returns the value of the '<em><b>Result Descriptor</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.ResultDescriptor}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Result Descriptor</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Result Descriptor</em>' containment reference list. - * @generated - */ - List getResultDescriptor(); - - /** - * Returns the value of the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Config</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Config</em>' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getConfig <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Config</em>' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the '<em><b>Kind</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Kind</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Kind</em>' attribute. - * @see #setKind(String) - * @generated - */ - String getKind(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getKind <em>Kind</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Kind</em>' attribute. - * @see #getKind() - * @generated - */ - void setKind(String value); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the '<em><b>SQL</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>SQL</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>SQL</em>' attribute. - * @see #setSQL(String) - * @generated - */ - String getSQL(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getSQL <em>SQL</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>SQL</em>' attribute. - * @see #getSQL() - * @generated - */ - void setSQL(String value); - -} // Command diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Config.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Config.java deleted file mode 100644 index c00d946dac..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Config.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Config</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.Config#getCommand <em>Command</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Config#getConnectionProperties <em>Connection Properties</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Config#getTable <em>Table</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Config#getRelationship <em>Relationship</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Config#getUri <em>Uri</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface Config -{ - /** - * Returns the value of the '<em><b>Command</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Command}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Command</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Command</em>' containment reference list. - * @generated - */ - List getCommand(); - - /** - * Returns the value of the '<em><b>Connection Properties</b></em>' containment reference. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Connection Properties</em>' containment reference isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Connection Properties</em>' containment reference. - * @see #setConnectionProperties(ConnectionProperties) - * @generated - */ - ConnectionProperties getConnectionProperties(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Config#getConnectionProperties <em>Connection Properties</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Connection Properties</em>' containment reference. - * @see #getConnectionProperties() - * @generated - */ - void setConnectionProperties(ConnectionProperties value); - - /** - * Returns the value of the '<em><b>Table</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Table}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Table</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Table</em>' containment reference list. - * @generated - */ - List getTable(); - - /** - * Returns the value of the '<em><b>Relationship</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Relationship}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Relationship</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Relationship</em>' containment reference list. - * @generated - */ - List getRelationship(); - - /** - * Returns the value of the '<em><b>Uri</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Uri</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Uri</em>' attribute. - * @see #setUri(String) - * @generated - */ - String getUri(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Config#getUri <em>Uri</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Uri</em>' attribute. - * @see #getUri() - * @generated - */ - void setUri(String value); - -} // Config diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConfigFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConfigFactory.java deleted file mode 100644 index f3c25814ac..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConfigFactory.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * <!-- begin-user-doc --> - * The <b>Factory</b> for the model. - * It provides a create method for each non-abstract class of the model. - * <!-- end-user-doc --> - * @generated - */ -public interface ConfigFactory -{ - /** - * The singleton instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - ConfigFactory INSTANCE = org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl.eINSTANCE; - - /** - * Returns a new object of class '<em>Column</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Column</em>'. - * @generated - */ - Column createColumn(); - - /** - * Returns a new object of class '<em>Command</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Command</em>'. - * @generated - */ - Command createCommand(); - - /** - * Returns a new object of class '<em>Config</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Config</em>'. - * @generated - */ - Config createConfig(); - - /** - * Returns a new object of class '<em>Connection Properties</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Connection Properties</em>'. - * @generated - */ - ConnectionProperties createConnectionProperties(); - - /** - * Returns a new object of class '<em>Key Pair</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Key Pair</em>'. - * @generated - */ - KeyPair createKeyPair(); - - /** - * Returns a new object of class '<em>Parameter</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Parameter</em>'. - * @generated - */ - Parameter createParameter(); - - /** - * Returns a new object of class '<em>Relationship</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Relationship</em>'. - * @generated - */ - Relationship createRelationship(); - - /** - * Returns a new object of class '<em>Result Descriptor</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Result Descriptor</em>'. - * @generated - */ - ResultDescriptor createResultDescriptor(); - - /** - * Returns a new object of class '<em>Table</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Table</em>'. - * @generated - */ - Table createTable(); - -} //ConfigFactory diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConnectionProperties.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConnectionProperties.java deleted file mode 100644 index 4b4008b446..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConnectionProperties.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Connection Properties</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDataSource <em>Data Source</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverClassName <em>Driver Class Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverPassword <em>Driver Password</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverURL <em>Driver URL</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverUserName <em>Driver User Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface ConnectionProperties -{ - /** - * Returns the value of the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Config</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Config</em>' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getConfig <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Config</em>' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the '<em><b>Data Source</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Data Source</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Data Source</em>' attribute. - * @see #setDataSource(String) - * @generated - */ - String getDataSource(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDataSource <em>Data Source</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Data Source</em>' attribute. - * @see #getDataSource() - * @generated - */ - void setDataSource(String value); - - /** - * Returns the value of the '<em><b>Driver Class Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Driver Class Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Driver Class Name</em>' attribute. - * @see #setDriverClassName(String) - * @generated - */ - String getDriverClassName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverClassName <em>Driver Class Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Driver Class Name</em>' attribute. - * @see #getDriverClassName() - * @generated - */ - void setDriverClassName(String value); - - /** - * Returns the value of the '<em><b>Driver Password</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Driver Password</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Driver Password</em>' attribute. - * @see #setDriverPassword(String) - * @generated - */ - String getDriverPassword(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverPassword <em>Driver Password</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Driver Password</em>' attribute. - * @see #getDriverPassword() - * @generated - */ - void setDriverPassword(String value); - - /** - * Returns the value of the '<em><b>Driver URL</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Driver URL</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Driver URL</em>' attribute. - * @see #setDriverURL(String) - * @generated - */ - String getDriverURL(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverURL <em>Driver URL</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Driver URL</em>' attribute. - * @see #getDriverURL() - * @generated - */ - void setDriverURL(String value); - - /** - * Returns the value of the '<em><b>Driver User Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Driver User Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Driver User Name</em>' attribute. - * @see #setDriverUserName(String) - * @generated - */ - String getDriverUserName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverUserName <em>Driver User Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Driver User Name</em>' attribute. - * @see #getDriverUserName() - * @generated - */ - void setDriverUserName(String value); - -} // ConnectionProperties diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/KeyPair.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/KeyPair.java deleted file mode 100644 index 7a1759ee90..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/KeyPair.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Key Pair</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.KeyPair#getForeignKeyColumn <em>Foreign Key Column</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.KeyPair#getPrimaryKeyColumn <em>Primary Key Column</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.KeyPair#getRelationship <em>Relationship</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface KeyPair -{ - /** - * Returns the value of the '<em><b>Foreign Key Column</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Foreign Key Column</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Foreign Key Column</em>' attribute. - * @see #setForeignKeyColumn(String) - * @generated - */ - String getForeignKeyColumn(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.KeyPair#getForeignKeyColumn <em>Foreign Key Column</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Foreign Key Column</em>' attribute. - * @see #getForeignKeyColumn() - * @generated - */ - void setForeignKeyColumn(String value); - - /** - * Returns the value of the '<em><b>Primary Key Column</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Primary Key Column</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Primary Key Column</em>' attribute. - * @see #setPrimaryKeyColumn(String) - * @generated - */ - String getPrimaryKeyColumn(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.KeyPair#getPrimaryKeyColumn <em>Primary Key Column</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Primary Key Column</em>' attribute. - * @see #getPrimaryKeyColumn() - * @generated - */ - void setPrimaryKeyColumn(String value); - - /** - * Returns the value of the '<em><b>Relationship</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Relationship</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Relationship</em>' attribute. - * @see #setRelationship(String) - * @generated - */ - String getRelationship(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.KeyPair#getRelationship <em>Relationship</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Relationship</em>' attribute. - * @see #getRelationship() - * @generated - */ - void setRelationship(String value); - -} // KeyPair diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Parameter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Parameter.java deleted file mode 100644 index 63872a7afd..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Parameter.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Parameter</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.Parameter#getColumnType <em>Column Type</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Parameter#getCommand <em>Command</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Parameter#getName <em>Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface Parameter -{ - /** - * Returns the value of the '<em><b>Column Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Column Type</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Column Type</em>' attribute. - * @see #setColumnType(String) - * @generated - */ - String getColumnType(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Parameter#getColumnType <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Column Type</em>' attribute. - * @see #getColumnType() - * @generated - */ - void setColumnType(String value); - - /** - * Returns the value of the '<em><b>Command</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Command</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Command</em>' attribute. - * @see #setCommand(String) - * @generated - */ - String getCommand(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Parameter#getCommand <em>Command</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Command</em>' attribute. - * @see #getCommand() - * @generated - */ - void setCommand(String value); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Parameter#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - -} // Parameter diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Relationship.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Relationship.java deleted file mode 100644 index d63348ade1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Relationship.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Relationship</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.Relationship#getKeyPair <em>Key Pair</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Relationship#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Relationship#getForeignKeyTable <em>Foreign Key Table</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Relationship#isMany <em>Many</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Relationship#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Relationship#getPrimaryKeyTable <em>Primary Key Table</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface Relationship -{ - /** - * Returns the value of the '<em><b>Key Pair</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.KeyPair}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Key Pair</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Key Pair</em>' containment reference list. - * @generated - */ - List getKeyPair(); - - /** - * Returns the value of the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Config</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Config</em>' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getConfig <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Config</em>' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the '<em><b>Foreign Key Table</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Foreign Key Table</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Foreign Key Table</em>' attribute. - * @see #setForeignKeyTable(String) - * @generated - */ - String getForeignKeyTable(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getForeignKeyTable <em>Foreign Key Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Foreign Key Table</em>' attribute. - * @see #getForeignKeyTable() - * @generated - */ - void setForeignKeyTable(String value); - - /** - * Returns the value of the '<em><b>Many</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Many</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Many</em>' attribute. - * @see #isSetMany() - * @see #unsetMany() - * @see #setMany(boolean) - * @generated - */ - boolean isMany(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany <em>Many</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Many</em>' attribute. - * @see #isSetMany() - * @see #unsetMany() - * @see #isMany() - * @generated - */ - void setMany(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany <em>Many</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetMany() - * @see #isMany() - * @see #setMany(boolean) - * @generated - */ - void unsetMany(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany <em>Many</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Many</em>' attribute is set. - * @see #unsetMany() - * @see #isMany() - * @see #setMany(boolean) - * @generated - */ - boolean isSetMany(); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the '<em><b>Primary Key Table</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Primary Key Table</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Primary Key Table</em>' attribute. - * @see #setPrimaryKeyTable(String) - * @generated - */ - String getPrimaryKeyTable(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getPrimaryKeyTable <em>Primary Key Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Primary Key Table</em>' attribute. - * @see #getPrimaryKeyTable() - * @generated - */ - void setPrimaryKeyTable(String value); - -} // Relationship diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ResultDescriptor.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ResultDescriptor.java deleted file mode 100644 index 648c33bf7e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ResultDescriptor.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Result Descriptor</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName <em>Column Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType <em>Column Type</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getCommand <em>Command</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getConverter <em>Converter</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName <em>Table Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface ResultDescriptor -{ - /** - * Returns the value of the '<em><b>Column Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Column Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Column Name</em>' attribute. - * @see #setColumnName(String) - * @generated - */ - String getColumnName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName <em>Column Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Column Name</em>' attribute. - * @see #getColumnName() - * @generated - */ - void setColumnName(String value); - - /** - * Returns the value of the '<em><b>Column Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Column Type</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Column Type</em>' attribute. - * @see #setColumnType(String) - * @generated - */ - String getColumnType(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Column Type</em>' attribute. - * @see #getColumnType() - * @generated - */ - void setColumnType(String value); - - /** - * Returns the value of the '<em><b>Command</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Command</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Command</em>' attribute. - * @see #setCommand(String) - * @generated - */ - String getCommand(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getCommand <em>Command</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Command</em>' attribute. - * @see #getCommand() - * @generated - */ - void setCommand(String value); - - /** - * Returns the value of the '<em><b>Converter</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Converter</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Converter</em>' attribute. - * @see #setConverter(String) - * @generated - */ - String getConverter(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getConverter <em>Converter</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Converter</em>' attribute. - * @see #getConverter() - * @generated - */ - void setConverter(String value); - - /** - * Returns the value of the '<em><b>Table Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Table Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Table Name</em>' attribute. - * @see #setTableName(String) - * @generated - */ - String getTableName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName <em>Table Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Table Name</em>' attribute. - * @see #getTableName() - * @generated - */ - void setTableName(String value); - -} // ResultDescriptor diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Table.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Table.java deleted file mode 100644 index 8f0956f291..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Table.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Table</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.Table#getColumn <em>Column</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Table#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Table#getCreate <em>Create</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Table#getDelete <em>Delete</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Table#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Table#getPropertyName <em>Property Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.Table#getUpdate <em>Update</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface Table -{ - /** - * Returns the value of the '<em><b>Column</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Column}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Column</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Column</em>' containment reference list. - * @generated - */ - List getColumn(); - - /** - * Returns the value of the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Config</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Config</em>' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getConfig <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Config</em>' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the '<em><b>Create</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Create</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Create</em>' attribute. - * @see #setCreate(String) - * @generated - */ - String getCreate(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getCreate <em>Create</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Create</em>' attribute. - * @see #getCreate() - * @generated - */ - void setCreate(String value); - - /** - * Returns the value of the '<em><b>Delete</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Delete</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Delete</em>' attribute. - * @see #setDelete(String) - * @generated - */ - String getDelete(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getDelete <em>Delete</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Delete</em>' attribute. - * @see #getDelete() - * @generated - */ - void setDelete(String value); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the '<em><b>Property Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Property Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Property Name</em>' attribute. - * @see #setPropertyName(String) - * @generated - */ - String getPropertyName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getPropertyName <em>Property Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Property Name</em>' attribute. - * @see #getPropertyName() - * @generated - */ - void setPropertyName(String value); - - /** - * Returns the value of the '<em><b>Update</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Update</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Update</em>' attribute. - * @see #setUpdate(String) - * @generated - */ - String getUpdate(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getUpdate <em>Update</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Update</em>' attribute. - * @see #getUpdate() - * @generated - */ - void setUpdate(String value); - -} // Table diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ColumnImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ColumnImpl.java deleted file mode 100644 index 30be8870b3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ColumnImpl.java +++ /dev/null @@ -1,675 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.Column; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Column</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#isCollision <em>Collision</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#getColumnType <em>Column Type</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#getConverterClassName <em>Converter Class Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#isGenerated <em>Generated</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#isPrimaryKey <em>Primary Key</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#getPropertyName <em>Property Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl#getTable <em>Table</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ColumnImpl extends DataObjectImpl implements Column -{ - /** - * The default value of the '{@link #isCollision() <em>Collision</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isCollision() - * @generated - * @ordered - */ - protected static final boolean COLLISION_EDEFAULT = false; - - /** - * The cached value of the '{@link #isCollision() <em>Collision</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isCollision() - * @generated - * @ordered - */ - protected boolean collision = COLLISION_EDEFAULT; - - /** - * This is true if the Collision attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean collisionESet = false; - - /** - * The default value of the '{@link #getColumnType() <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnType() - * @generated - * @ordered - */ - protected static final String COLUMN_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnType() <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnType() - * @generated - * @ordered - */ - protected String columnType = COLUMN_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getConverterClassName() <em>Converter Class Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConverterClassName() - * @generated - * @ordered - */ - protected static final String CONVERTER_CLASS_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConverterClassName() <em>Converter Class Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConverterClassName() - * @generated - * @ordered - */ - protected String converterClassName = CONVERTER_CLASS_NAME_EDEFAULT; - - /** - * The default value of the '{@link #isGenerated() <em>Generated</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isGenerated() - * @generated - * @ordered - */ - protected static final boolean GENERATED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isGenerated() <em>Generated</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isGenerated() - * @generated - * @ordered - */ - protected boolean generated = GENERATED_EDEFAULT; - - /** - * This is true if the Generated attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean generatedESet = false; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #isPrimaryKey() <em>Primary Key</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isPrimaryKey() - * @generated - * @ordered - */ - protected static final boolean PRIMARY_KEY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isPrimaryKey() <em>Primary Key</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isPrimaryKey() - * @generated - * @ordered - */ - protected boolean primaryKey = PRIMARY_KEY_EDEFAULT; - - /** - * This is true if the Primary Key attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean primaryKeyESet = false; - - /** - * The default value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPropertyName() - * @generated - * @ordered - */ - protected static final String PROPERTY_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPropertyName() - * @generated - * @ordered - */ - protected String propertyName = PROPERTY_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getTable() <em>Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTable() - * @generated - * @ordered - */ - protected static final String TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getTable() <em>Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTable() - * @generated - * @ordered - */ - protected String table = TABLE_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ColumnImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.COLUMN; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isCollision() - { - return collision; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setCollision(boolean newCollision) - { - boolean oldCollision = collision; - collision = newCollision; - boolean oldCollisionESet = collisionESet; - collisionESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__COLLISION, oldCollision, collision, !oldCollisionESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetCollision() - { - boolean oldCollision = collision; - boolean oldCollisionESet = collisionESet; - collision = COLLISION_EDEFAULT; - collisionESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.COLUMN__COLLISION, oldCollision, COLLISION_EDEFAULT, oldCollisionESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetCollision() - { - return collisionESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getColumnType() - { - return columnType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setColumnType(String newColumnType) - { - String oldColumnType = columnType; - columnType = newColumnType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__COLUMN_TYPE, oldColumnType, columnType)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getConverterClassName() - { - return converterClassName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setConverterClassName(String newConverterClassName) - { - String oldConverterClassName = converterClassName; - converterClassName = newConverterClassName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME, oldConverterClassName, converterClassName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isGenerated() - { - return generated; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setGenerated(boolean newGenerated) - { - boolean oldGenerated = generated; - generated = newGenerated; - boolean oldGeneratedESet = generatedESet; - generatedESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__GENERATED, oldGenerated, generated, !oldGeneratedESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetGenerated() - { - boolean oldGenerated = generated; - boolean oldGeneratedESet = generatedESet; - generated = GENERATED_EDEFAULT; - generatedESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.COLUMN__GENERATED, oldGenerated, GENERATED_EDEFAULT, oldGeneratedESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetGenerated() - { - return generatedESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isPrimaryKey() - { - return primaryKey; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setPrimaryKey(boolean newPrimaryKey) - { - boolean oldPrimaryKey = primaryKey; - primaryKey = newPrimaryKey; - boolean oldPrimaryKeyESet = primaryKeyESet; - primaryKeyESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__PRIMARY_KEY, oldPrimaryKey, primaryKey, !oldPrimaryKeyESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetPrimaryKey() - { - boolean oldPrimaryKey = primaryKey; - boolean oldPrimaryKeyESet = primaryKeyESet; - primaryKey = PRIMARY_KEY_EDEFAULT; - primaryKeyESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.COLUMN__PRIMARY_KEY, oldPrimaryKey, PRIMARY_KEY_EDEFAULT, oldPrimaryKeyESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetPrimaryKey() - { - return primaryKeyESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getPropertyName() - { - return propertyName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setPropertyName(String newPropertyName) - { - String oldPropertyName = propertyName; - propertyName = newPropertyName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__PROPERTY_NAME, oldPropertyName, propertyName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getTable() - { - return table; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setTable(String newTable) - { - String oldTable = table; - table = newTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__TABLE, oldTable, table)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - return isCollision() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - return getColumnType(); - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - return getConverterClassName(); - case ConfigPackageImpl.COLUMN__GENERATED: - return isGenerated() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.COLUMN__NAME: - return getName(); - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - return isPrimaryKey() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - return getPropertyName(); - case ConfigPackageImpl.COLUMN__TABLE: - return getTable(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - setCollision(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - setColumnType((String)newValue); - return; - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - setConverterClassName((String)newValue); - return; - case ConfigPackageImpl.COLUMN__GENERATED: - setGenerated(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.COLUMN__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - setPrimaryKey(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - setPropertyName((String)newValue); - return; - case ConfigPackageImpl.COLUMN__TABLE: - setTable((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - unsetCollision(); - return; - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - setColumnType(COLUMN_TYPE_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - setConverterClassName(CONVERTER_CLASS_NAME_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__GENERATED: - unsetGenerated(); - return; - case ConfigPackageImpl.COLUMN__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - unsetPrimaryKey(); - return; - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - setPropertyName(PROPERTY_NAME_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__TABLE: - setTable(TABLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - return isSetCollision(); - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - return COLUMN_TYPE_EDEFAULT == null ? columnType != null : !COLUMN_TYPE_EDEFAULT.equals(columnType); - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - return CONVERTER_CLASS_NAME_EDEFAULT == null ? converterClassName != null : !CONVERTER_CLASS_NAME_EDEFAULT.equals(converterClassName); - case ConfigPackageImpl.COLUMN__GENERATED: - return isSetGenerated(); - case ConfigPackageImpl.COLUMN__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - return isSetPrimaryKey(); - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName); - case ConfigPackageImpl.COLUMN__TABLE: - return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (collision: "); - if (collisionESet) result.append(collision); else result.append("<unset>"); - result.append(", columnType: "); - result.append(columnType); - result.append(", converterClassName: "); - result.append(converterClassName); - result.append(", generated: "); - if (generatedESet) result.append(generated); else result.append("<unset>"); - result.append(", name: "); - result.append(name); - result.append(", primaryKey: "); - if (primaryKeyESet) result.append(primaryKey); else result.append("<unset>"); - result.append(", propertyName: "); - result.append(propertyName); - result.append(", table: "); - result.append(table); - result.append(')'); - return result.toString(); - } - -} //ColumnImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/CommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/CommandImpl.java deleted file mode 100644 index 7750d34ded..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/CommandImpl.java +++ /dev/null @@ -1,444 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Command; -import org.apache.tuscany.das.rdb.config.Parameter; -import org.apache.tuscany.das.rdb.config.ResultDescriptor; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Command</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getParameter <em>Parameter</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getResultDescriptor <em>Result Descriptor</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getKind <em>Kind</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getSQL <em>SQL</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class CommandImpl extends DataObjectImpl implements Command -{ - /** - * The cached value of the '{@link #getParameter() <em>Parameter</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getParameter() - * @generated - * @ordered - */ - protected EList parameter = null; - - /** - * The cached value of the '{@link #getResultDescriptor() <em>Result Descriptor</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResultDescriptor() - * @generated - * @ordered - */ - protected EList resultDescriptor = null; - - /** - * The default value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getKind() <em>Kind</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getKind() - * @generated - * @ordered - */ - protected static final String KIND_EDEFAULT = null; - - /** - * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getKind() - * @generated - * @ordered - */ - protected String kind = KIND_EDEFAULT; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getSQL() <em>SQL</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getSQL() - * @generated - * @ordered - */ - protected static final String SQL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSQL() <em>SQL</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getSQL() - * @generated - * @ordered - */ - protected String sQL = SQL_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected CommandImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.COMMAND; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getParameter() - { - if (parameter == null) - { - parameter = new EObjectContainmentEList(Parameter.class, this, ConfigPackageImpl.COMMAND__PARAMETER); - } - return parameter; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getResultDescriptor() - { - if (resultDescriptor == null) - { - resultDescriptor = new EObjectContainmentEList(ResultDescriptor.class, this, ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR); - } - return resultDescriptor; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__CONFIG, oldConfig, config)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getKind() - { - return kind; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setKind(String newKind) - { - String oldKind = kind; - kind = newKind; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__KIND, oldKind, kind)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getSQL() - { - return sQL; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setSQL(String newSQL) - { - String oldSQL = sQL; - sQL = newSQL; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__SQL, oldSQL, sQL)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - return ((InternalEList)getParameter()).basicRemove(otherEnd, msgs); - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - return ((InternalEList)getResultDescriptor()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - return getParameter(); - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - return getResultDescriptor(); - case ConfigPackageImpl.COMMAND__CONFIG: - return getConfig(); - case ConfigPackageImpl.COMMAND__KIND: - return getKind(); - case ConfigPackageImpl.COMMAND__NAME: - return getName(); - case ConfigPackageImpl.COMMAND__SQL: - return getSQL(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - getParameter().clear(); - getParameter().addAll((Collection)newValue); - return; - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - getResultDescriptor().clear(); - getResultDescriptor().addAll((Collection)newValue); - return; - case ConfigPackageImpl.COMMAND__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.COMMAND__KIND: - setKind((String)newValue); - return; - case ConfigPackageImpl.COMMAND__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.COMMAND__SQL: - setSQL((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - getParameter().clear(); - return; - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - getResultDescriptor().clear(); - return; - case ConfigPackageImpl.COMMAND__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.COMMAND__KIND: - setKind(KIND_EDEFAULT); - return; - case ConfigPackageImpl.COMMAND__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.COMMAND__SQL: - setSQL(SQL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - return parameter != null && !parameter.isEmpty(); - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - return resultDescriptor != null && !resultDescriptor.isEmpty(); - case ConfigPackageImpl.COMMAND__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.COMMAND__KIND: - return KIND_EDEFAULT == null ? kind != null : !KIND_EDEFAULT.equals(kind); - case ConfigPackageImpl.COMMAND__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.COMMAND__SQL: - return SQL_EDEFAULT == null ? sQL != null : !SQL_EDEFAULT.equals(sQL); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", kind: "); - result.append(kind); - result.append(", name: "); - result.append(name); - result.append(", sQL: "); - result.append(sQL); - result.append(')'); - return result.toString(); - } - -} //CommandImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigFactoryImpl.java deleted file mode 100644 index 7f67ad8e76..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigFactoryImpl.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * <!-- begin-user-doc --> - * An implementation of the model <b>Factory</b>. - * <!-- end-user-doc --> - * @generated - */ -public class ConfigFactoryImpl extends EFactoryImpl implements ConfigFactory -{ - /** - * The singleton instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final ConfigFactoryImpl eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static ConfigFactoryImpl init() - { - try - { - ConfigFactoryImpl theConfigFactory = (ConfigFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("http:///org.apache.tuscany.das.rdb/config.xsd"); - if (theConfigFactory != null) - { - return theConfigFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new ConfigFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public ConfigFactoryImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case ConfigPackageImpl.COLUMN: return (EObject)createColumn(); - case ConfigPackageImpl.COMMAND: return (EObject)createCommand(); - case ConfigPackageImpl.CONFIG: return (EObject)createConfig(); - case ConfigPackageImpl.CONNECTION_PROPERTIES: return (EObject)createConnectionProperties(); - case ConfigPackageImpl.KEY_PAIR: return (EObject)createKeyPair(); - case ConfigPackageImpl.PARAMETER: return (EObject)createParameter(); - case ConfigPackageImpl.RELATIONSHIP: return (EObject)createRelationship(); - case ConfigPackageImpl.RESULT_DESCRIPTOR: return (EObject)createResultDescriptor(); - case ConfigPackageImpl.TABLE: return (EObject)createTable(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Column createColumn() - { - ColumnImpl column = new ColumnImpl(); - return column; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Command createCommand() - { - CommandImpl command = new CommandImpl(); - return command; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Config createConfig() - { - ConfigImpl config = new ConfigImpl(); - return config; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public ConnectionProperties createConnectionProperties() - { - ConnectionPropertiesImpl connectionProperties = new ConnectionPropertiesImpl(); - return connectionProperties; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public KeyPair createKeyPair() - { - KeyPairImpl keyPair = new KeyPairImpl(); - return keyPair; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Parameter createParameter() - { - ParameterImpl parameter = new ParameterImpl(); - return parameter; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Relationship createRelationship() - { - RelationshipImpl relationship = new RelationshipImpl(); - return relationship; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public ResultDescriptor createResultDescriptor() - { - ResultDescriptorImpl resultDescriptor = new ResultDescriptorImpl(); - return resultDescriptor; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Table createTable() - { - TableImpl table = new TableImpl(); - return table; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public ConfigPackageImpl getConfigPackageImpl() - { - return (ConfigPackageImpl)getEPackage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @deprecated - * @generated - */ - public static ConfigPackageImpl getPackage() - { - return ConfigPackageImpl.eINSTANCE; - } - -} //ConfigFactoryImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigImpl.java deleted file mode 100644 index 67e1e5f8a7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigImpl.java +++ /dev/null @@ -1,387 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Command; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.Table; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Config</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getCommand <em>Command</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getConnectionProperties <em>Connection Properties</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getTable <em>Table</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getRelationship <em>Relationship</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getUri <em>Uri</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ConfigImpl extends DataObjectImpl implements Config -{ - /** - * The cached value of the '{@link #getCommand() <em>Command</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCommand() - * @generated - * @ordered - */ - protected EList command = null; - - /** - * The cached value of the '{@link #getConnectionProperties() <em>Connection Properties</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConnectionProperties() - * @generated - * @ordered - */ - protected ConnectionProperties connectionProperties = null; - - /** - * The cached value of the '{@link #getTable() <em>Table</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTable() - * @generated - * @ordered - */ - protected EList table = null; - - /** - * The cached value of the '{@link #getRelationship() <em>Relationship</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getRelationship() - * @generated - * @ordered - */ - protected EList relationship = null; - - /** - * The default value of the '{@link #getUri() <em>Uri</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getUri() - * @generated - * @ordered - */ - protected static final String URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getUri() <em>Uri</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getUri() - * @generated - * @ordered - */ - protected String uri = URI_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ConfigImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.CONFIG; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getCommand() - { - if (command == null) - { - command = new EObjectContainmentEList(Command.class, this, ConfigPackageImpl.CONFIG__COMMAND); - } - return command; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public ConnectionProperties getConnectionProperties() - { - return connectionProperties; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetConnectionProperties(ConnectionProperties newConnectionProperties, NotificationChain msgs) - { - ConnectionProperties oldConnectionProperties = connectionProperties; - connectionProperties = newConnectionProperties; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, oldConnectionProperties, newConnectionProperties); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setConnectionProperties(ConnectionProperties newConnectionProperties) - { - if (newConnectionProperties != connectionProperties) - { - NotificationChain msgs = null; - if (connectionProperties != null) - msgs = ((InternalEObject)connectionProperties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, null, msgs); - if (newConnectionProperties != null) - msgs = ((InternalEObject)newConnectionProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, null, msgs); - msgs = basicSetConnectionProperties(newConnectionProperties, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, newConnectionProperties, newConnectionProperties)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getTable() - { - if (table == null) - { - table = new EObjectContainmentEList(Table.class, this, ConfigPackageImpl.CONFIG__TABLE); - } - return table; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getRelationship() - { - if (relationship == null) - { - relationship = new EObjectContainmentEList(Relationship.class, this, ConfigPackageImpl.CONFIG__RELATIONSHIP); - } - return relationship; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getUri() - { - return uri; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setUri(String newUri) - { - String oldUri = uri; - uri = newUri; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONFIG__URI, oldUri, uri)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - return ((InternalEList)getCommand()).basicRemove(otherEnd, msgs); - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - return basicSetConnectionProperties(null, msgs); - case ConfigPackageImpl.CONFIG__TABLE: - return ((InternalEList)getTable()).basicRemove(otherEnd, msgs); - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - return ((InternalEList)getRelationship()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - return getCommand(); - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - return getConnectionProperties(); - case ConfigPackageImpl.CONFIG__TABLE: - return getTable(); - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - return getRelationship(); - case ConfigPackageImpl.CONFIG__URI: - return getUri(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - getCommand().clear(); - getCommand().addAll((Collection)newValue); - return; - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - setConnectionProperties((ConnectionProperties)newValue); - return; - case ConfigPackageImpl.CONFIG__TABLE: - getTable().clear(); - getTable().addAll((Collection)newValue); - return; - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - getRelationship().clear(); - getRelationship().addAll((Collection)newValue); - return; - case ConfigPackageImpl.CONFIG__URI: - setUri((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - getCommand().clear(); - return; - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - setConnectionProperties((ConnectionProperties)null); - return; - case ConfigPackageImpl.CONFIG__TABLE: - getTable().clear(); - return; - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - getRelationship().clear(); - return; - case ConfigPackageImpl.CONFIG__URI: - setUri(URI_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - return command != null && !command.isEmpty(); - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - return connectionProperties != null; - case ConfigPackageImpl.CONFIG__TABLE: - return table != null && !table.isEmpty(); - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - return relationship != null && !relationship.isEmpty(); - case ConfigPackageImpl.CONFIG__URI: - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (uri: "); - result.append(uri); - result.append(')'); - return result.toString(); - } - -} //ConfigImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigPackageImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigPackageImpl.java deleted file mode 100644 index e018f00586..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigPackageImpl.java +++ /dev/null @@ -1,2808 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Command; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Parameter; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.ResultDescriptor; -import org.apache.tuscany.das.rdb.config.Table; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * <!-- begin-user-doc --> - * The <b>Package</b> for the model. - * It contains accessors for the meta objects to represent - * <ul> - * <li>each class,</li> - * <li>each feature of each class,</li> - * <li>each enum,</li> - * <li>and each data type</li> - * </ul> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.ConfigFactory - * @generated - */ -public class ConfigPackageImpl extends EPackageImpl -{ - /** - * The package name. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNAME = "config"; - - /** - * The package namespace URI. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNS_URI = "http:///org.apache.tuscany.das.rdb/config.xsd"; - - /** - * The package namespace name. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNS_PREFIX = "org.apache.tuscany.das.rdb.config"; - - /** - * The singleton instance of the package. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final ConfigPackageImpl eINSTANCE = org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl.init(); - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl <em>Column</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ColumnImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getColumn() - * @generated - */ - public static final int COLUMN = 0; - - /** - * The feature id for the '<em><b>Collision</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__COLLISION = 0; - - /** - * The feature id for the '<em><b>Column Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__COLUMN_TYPE = 1; - - /** - * The feature id for the '<em><b>Converter Class Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__CONVERTER_CLASS_NAME = 2; - - /** - * The feature id for the '<em><b>Generated</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__GENERATED = 3; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__NAME = 4; - - /** - * The feature id for the '<em><b>Primary Key</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__PRIMARY_KEY = 5; - - /** - * The feature id for the '<em><b>Property Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__PROPERTY_NAME = 6; - - /** - * The feature id for the '<em><b>Table</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN__TABLE = 7; - - /** - * The number of structural features of the '<em>Column</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COLUMN_FEATURE_COUNT = 8; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl <em>Command</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.CommandImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getCommand() - * @generated - */ - public static final int COMMAND = 1; - - /** - * The feature id for the '<em><b>Parameter</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMMAND__PARAMETER = 0; - - /** - * The feature id for the '<em><b>Result Descriptor</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMMAND__RESULT_DESCRIPTOR = 1; - - /** - * The feature id for the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMMAND__CONFIG = 2; - - /** - * The feature id for the '<em><b>Kind</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMMAND__KIND = 3; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMMAND__NAME = 4; - - /** - * The feature id for the '<em><b>SQL</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMMAND__SQL = 5; - - /** - * The number of structural features of the '<em>Command</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMMAND_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl <em>Config</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ConfigImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConfig() - * @generated - */ - public static final int CONFIG = 2; - - /** - * The feature id for the '<em><b>Command</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONFIG__COMMAND = 0; - - /** - * The feature id for the '<em><b>Connection Properties</b></em>' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONFIG__CONNECTION_PROPERTIES = 1; - - /** - * The feature id for the '<em><b>Table</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONFIG__TABLE = 2; - - /** - * The feature id for the '<em><b>Relationship</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONFIG__RELATIONSHIP = 3; - - /** - * The feature id for the '<em><b>Uri</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONFIG__URI = 4; - - /** - * The number of structural features of the '<em>Config</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONFIG_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl <em>Connection Properties</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConnectionProperties() - * @generated - */ - public static final int CONNECTION_PROPERTIES = 3; - - /** - * The feature id for the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__CONFIG = 0; - - /** - * The feature id for the '<em><b>Data Source</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DATA_SOURCE = 1; - - /** - * The feature id for the '<em><b>Driver Class Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_CLASS_NAME = 2; - - /** - * The feature id for the '<em><b>Driver Password</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_PASSWORD = 3; - - /** - * The feature id for the '<em><b>Driver URL</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_URL = 4; - - /** - * The feature id for the '<em><b>Driver User Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_USER_NAME = 5; - - /** - * The number of structural features of the '<em>Connection Properties</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl <em>Key Pair</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.KeyPairImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getKeyPair() - * @generated - */ - public static final int KEY_PAIR = 4; - - /** - * The feature id for the '<em><b>Foreign Key Column</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int KEY_PAIR__FOREIGN_KEY_COLUMN = 0; - - /** - * The feature id for the '<em><b>Primary Key Column</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int KEY_PAIR__PRIMARY_KEY_COLUMN = 1; - - /** - * The feature id for the '<em><b>Relationship</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int KEY_PAIR__RELATIONSHIP = 2; - - /** - * The number of structural features of the '<em>Key Pair</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int KEY_PAIR_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl <em>Parameter</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ParameterImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getParameter() - * @generated - */ - public static final int PARAMETER = 5; - - /** - * The feature id for the '<em><b>Column Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int PARAMETER__COLUMN_TYPE = 0; - - /** - * The feature id for the '<em><b>Command</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int PARAMETER__COMMAND = 1; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int PARAMETER__NAME = 2; - - /** - * The number of structural features of the '<em>Parameter</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int PARAMETER_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl <em>Relationship</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.RelationshipImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getRelationship() - * @generated - */ - public static final int RELATIONSHIP = 6; - - /** - * The feature id for the '<em><b>Key Pair</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RELATIONSHIP__KEY_PAIR = 0; - - /** - * The feature id for the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RELATIONSHIP__CONFIG = 1; - - /** - * The feature id for the '<em><b>Foreign Key Table</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RELATIONSHIP__FOREIGN_KEY_TABLE = 2; - - /** - * The feature id for the '<em><b>Many</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RELATIONSHIP__MANY = 3; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RELATIONSHIP__NAME = 4; - - /** - * The feature id for the '<em><b>Primary Key Table</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RELATIONSHIP__PRIMARY_KEY_TABLE = 5; - - /** - * The number of structural features of the '<em>Relationship</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RELATIONSHIP_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl <em>Result Descriptor</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getResultDescriptor() - * @generated - */ - public static final int RESULT_DESCRIPTOR = 7; - - /** - * The feature id for the '<em><b>Column Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__COLUMN_NAME = 0; - - /** - * The feature id for the '<em><b>Column Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__COLUMN_TYPE = 1; - - /** - * The feature id for the '<em><b>Command</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__COMMAND = 2; - - /** - * The feature id for the '<em><b>Converter</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__CONVERTER = 3; - - /** - * The feature id for the '<em><b>Table Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__TABLE_NAME = 4; - - /** - * The number of structural features of the '<em>Result Descriptor</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.TableImpl <em>Table</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.TableImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getTable() - * @generated - */ - public static final int TABLE = 8; - - /** - * The feature id for the '<em><b>Column</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE__COLUMN = 0; - - /** - * The feature id for the '<em><b>Config</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE__CONFIG = 1; - - /** - * The feature id for the '<em><b>Create</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE__CREATE = 2; - - /** - * The feature id for the '<em><b>Delete</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE__DELETE = 3; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE__NAME = 4; - - /** - * The feature id for the '<em><b>Property Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE__PROPERTY_NAME = 5; - - /** - * The feature id for the '<em><b>Update</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE__UPDATE = 6; - - /** - * The number of structural features of the '<em>Table</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int TABLE_FEATURE_COUNT = 7; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass columnEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass commandEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass configEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass connectionPropertiesEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass keyPairEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass parameterEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass relationshipEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass resultDescriptorEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass tableEClass = null; - - /** - * Creates an instance of the model <b>Package</b>, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - * <p>Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#eNS_URI - * @see #init() - * @generated - */ - private ConfigPackageImpl() - { - super(eNS_URI, ((EFactory)ConfigFactory.INSTANCE)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the <b>Package</b> for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - * <p>Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - * <p>Invocation of this method will not affect any packages that have - * already been initialized. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static ConfigPackageImpl init() - { - if (isInited) return (ConfigPackageImpl)EPackage.Registry.INSTANCE.getEPackage(ConfigPackageImpl.eNS_URI); - - // Obtain or create and register package - ConfigPackageImpl theConfigPackageImpl = (ConfigPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ConfigPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ConfigPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XMLTypePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theConfigPackageImpl.createPackageContents(); - - // Initialize created meta-data - theConfigPackageImpl.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theConfigPackageImpl.freeze(); - - return theConfigPackageImpl; - } - - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Column <em>Column</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Column</em>'. - * @see org.apache.tuscany.das.rdb.config.Column - * @generated - */ - public EClass getColumn() - { - return columnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#isCollision <em>Collision</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Collision</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#isCollision() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Collision() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getColumnType <em>Column Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Column Type</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#getColumnType() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_ColumnType() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getConverterClassName <em>Converter Class Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Converter Class Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#getConverterClassName() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_ConverterClassName() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated <em>Generated</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Generated</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#isGenerated() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Generated() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#getName() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Name() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey <em>Primary Key</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Primary Key</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#isPrimaryKey() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_PrimaryKey() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getPropertyName <em>Property Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Property Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#getPropertyName() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_PropertyName() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getTable <em>Table</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Table</em>'. - * @see org.apache.tuscany.das.rdb.config.Column#getTable() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Table() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Command <em>Command</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Command</em>'. - * @see org.apache.tuscany.das.rdb.config.Command - * @generated - */ - public EClass getCommand() - { - return commandEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Command#getParameter <em>Parameter</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Parameter</em>'. - * @see org.apache.tuscany.das.rdb.config.Command#getParameter() - * @see #getCommand() - * @generated - */ - public EReference getCommand_Parameter() - { - return (EReference)commandEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Command#getResultDescriptor <em>Result Descriptor</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Result Descriptor</em>'. - * @see org.apache.tuscany.das.rdb.config.Command#getResultDescriptor() - * @see #getCommand() - * @generated - */ - public EReference getCommand_ResultDescriptor() - { - return (EReference)commandEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getConfig <em>Config</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Config</em>'. - * @see org.apache.tuscany.das.rdb.config.Command#getConfig() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_Config() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getKind <em>Kind</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Kind</em>'. - * @see org.apache.tuscany.das.rdb.config.Command#getKind() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_Kind() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Command#getName() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_Name() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getSQL <em>SQL</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>SQL</em>'. - * @see org.apache.tuscany.das.rdb.config.Command#getSQL() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_SQL() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Config <em>Config</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Config</em>'. - * @see org.apache.tuscany.das.rdb.config.Config - * @generated - */ - public EClass getConfig() - { - return configEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Config#getCommand <em>Command</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Command</em>'. - * @see org.apache.tuscany.das.rdb.config.Config#getCommand() - * @see #getConfig() - * @generated - */ - public EReference getConfig_Command() - { - return (EReference)configEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.apache.tuscany.das.rdb.config.Config#getConnectionProperties <em>Connection Properties</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference '<em>Connection Properties</em>'. - * @see org.apache.tuscany.das.rdb.config.Config#getConnectionProperties() - * @see #getConfig() - * @generated - */ - public EReference getConfig_ConnectionProperties() - { - return (EReference)configEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Config#getTable <em>Table</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Table</em>'. - * @see org.apache.tuscany.das.rdb.config.Config#getTable() - * @see #getConfig() - * @generated - */ - public EReference getConfig_Table() - { - return (EReference)configEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Config#getRelationship <em>Relationship</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Relationship</em>'. - * @see org.apache.tuscany.das.rdb.config.Config#getRelationship() - * @see #getConfig() - * @generated - */ - public EReference getConfig_Relationship() - { - return (EReference)configEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Config#getUri <em>Uri</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Uri</em>'. - * @see org.apache.tuscany.das.rdb.config.Config#getUri() - * @see #getConfig() - * @generated - */ - public EAttribute getConfig_Uri() - { - return (EAttribute)configEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties <em>Connection Properties</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Connection Properties</em>'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties - * @generated - */ - public EClass getConnectionProperties() - { - return connectionPropertiesEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getConfig <em>Config</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Config</em>'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getConfig() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_Config() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDataSource <em>Data Source</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Data Source</em>'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDataSource() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DataSource() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverClassName <em>Driver Class Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Driver Class Name</em>'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverClassName() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverClassName() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverPassword <em>Driver Password</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Driver Password</em>'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverPassword() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverPassword() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverURL <em>Driver URL</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Driver URL</em>'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverURL() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverURL() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverUserName <em>Driver User Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Driver User Name</em>'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverUserName() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverUserName() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.KeyPair <em>Key Pair</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Key Pair</em>'. - * @see org.apache.tuscany.das.rdb.config.KeyPair - * @generated - */ - public EClass getKeyPair() - { - return keyPairEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.KeyPair#getForeignKeyColumn <em>Foreign Key Column</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Foreign Key Column</em>'. - * @see org.apache.tuscany.das.rdb.config.KeyPair#getForeignKeyColumn() - * @see #getKeyPair() - * @generated - */ - public EAttribute getKeyPair_ForeignKeyColumn() - { - return (EAttribute)keyPairEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.KeyPair#getPrimaryKeyColumn <em>Primary Key Column</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Primary Key Column</em>'. - * @see org.apache.tuscany.das.rdb.config.KeyPair#getPrimaryKeyColumn() - * @see #getKeyPair() - * @generated - */ - public EAttribute getKeyPair_PrimaryKeyColumn() - { - return (EAttribute)keyPairEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.KeyPair#getRelationship <em>Relationship</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Relationship</em>'. - * @see org.apache.tuscany.das.rdb.config.KeyPair#getRelationship() - * @see #getKeyPair() - * @generated - */ - public EAttribute getKeyPair_Relationship() - { - return (EAttribute)keyPairEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Parameter <em>Parameter</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Parameter</em>'. - * @see org.apache.tuscany.das.rdb.config.Parameter - * @generated - */ - public EClass getParameter() - { - return parameterEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Parameter#getColumnType <em>Column Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Column Type</em>'. - * @see org.apache.tuscany.das.rdb.config.Parameter#getColumnType() - * @see #getParameter() - * @generated - */ - public EAttribute getParameter_ColumnType() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Parameter#getCommand <em>Command</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Command</em>'. - * @see org.apache.tuscany.das.rdb.config.Parameter#getCommand() - * @see #getParameter() - * @generated - */ - public EAttribute getParameter_Command() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Parameter#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Parameter#getName() - * @see #getParameter() - * @generated - */ - public EAttribute getParameter_Name() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Relationship <em>Relationship</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Relationship</em>'. - * @see org.apache.tuscany.das.rdb.config.Relationship - * @generated - */ - public EClass getRelationship() - { - return relationshipEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Relationship#getKeyPair <em>Key Pair</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Key Pair</em>'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getKeyPair() - * @see #getRelationship() - * @generated - */ - public EReference getRelationship_KeyPair() - { - return (EReference)relationshipEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getConfig <em>Config</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Config</em>'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getConfig() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_Config() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getForeignKeyTable <em>Foreign Key Table</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Foreign Key Table</em>'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getForeignKeyTable() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_ForeignKeyTable() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany <em>Many</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Many</em>'. - * @see org.apache.tuscany.das.rdb.config.Relationship#isMany() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_Many() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getName() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_Name() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getPrimaryKeyTable <em>Primary Key Table</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Primary Key Table</em>'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getPrimaryKeyTable() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_PrimaryKeyTable() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor <em>Result Descriptor</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Result Descriptor</em>'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor - * @generated - */ - public EClass getResultDescriptor() - { - return resultDescriptorEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName <em>Column Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Column Name</em>'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_ColumnName() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType <em>Column Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Column Type</em>'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_ColumnType() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getCommand <em>Command</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Command</em>'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getCommand() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_Command() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getConverter <em>Converter</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Converter</em>'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getConverter() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_Converter() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName <em>Table Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Table Name</em>'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_TableName() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Table <em>Table</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Table</em>'. - * @see org.apache.tuscany.das.rdb.config.Table - * @generated - */ - public EClass getTable() - { - return tableEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Table#getColumn <em>Column</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Column</em>'. - * @see org.apache.tuscany.das.rdb.config.Table#getColumn() - * @see #getTable() - * @generated - */ - public EReference getTable_Column() - { - return (EReference)tableEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getConfig <em>Config</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Config</em>'. - * @see org.apache.tuscany.das.rdb.config.Table#getConfig() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Config() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getCreate <em>Create</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Create</em>'. - * @see org.apache.tuscany.das.rdb.config.Table#getCreate() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Create() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getDelete <em>Delete</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Delete</em>'. - * @see org.apache.tuscany.das.rdb.config.Table#getDelete() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Delete() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Table#getName() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Name() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getPropertyName <em>Property Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Property Name</em>'. - * @see org.apache.tuscany.das.rdb.config.Table#getPropertyName() - * @see #getTable() - * @generated - */ - public EAttribute getTable_PropertyName() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getUpdate <em>Update</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Update</em>'. - * @see org.apache.tuscany.das.rdb.config.Table#getUpdate() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Update() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the factory that creates the instances of the model. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the factory that creates the instances of the model. - * @generated - */ - public ConfigFactory getConfigFactory() - { - return (ConfigFactory)getEFactoryInstance(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - columnEClass = createEClass(COLUMN); - createEAttribute(columnEClass, COLUMN__COLLISION); - createEAttribute(columnEClass, COLUMN__COLUMN_TYPE); - createEAttribute(columnEClass, COLUMN__CONVERTER_CLASS_NAME); - createEAttribute(columnEClass, COLUMN__GENERATED); - createEAttribute(columnEClass, COLUMN__NAME); - createEAttribute(columnEClass, COLUMN__PRIMARY_KEY); - createEAttribute(columnEClass, COLUMN__PROPERTY_NAME); - createEAttribute(columnEClass, COLUMN__TABLE); - - commandEClass = createEClass(COMMAND); - createEReference(commandEClass, COMMAND__PARAMETER); - createEReference(commandEClass, COMMAND__RESULT_DESCRIPTOR); - createEAttribute(commandEClass, COMMAND__CONFIG); - createEAttribute(commandEClass, COMMAND__KIND); - createEAttribute(commandEClass, COMMAND__NAME); - createEAttribute(commandEClass, COMMAND__SQL); - - configEClass = createEClass(CONFIG); - createEReference(configEClass, CONFIG__COMMAND); - createEReference(configEClass, CONFIG__CONNECTION_PROPERTIES); - createEReference(configEClass, CONFIG__TABLE); - createEReference(configEClass, CONFIG__RELATIONSHIP); - createEAttribute(configEClass, CONFIG__URI); - - connectionPropertiesEClass = createEClass(CONNECTION_PROPERTIES); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__CONFIG); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DATA_SOURCE); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_CLASS_NAME); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_PASSWORD); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_URL); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_USER_NAME); - - keyPairEClass = createEClass(KEY_PAIR); - createEAttribute(keyPairEClass, KEY_PAIR__FOREIGN_KEY_COLUMN); - createEAttribute(keyPairEClass, KEY_PAIR__PRIMARY_KEY_COLUMN); - createEAttribute(keyPairEClass, KEY_PAIR__RELATIONSHIP); - - parameterEClass = createEClass(PARAMETER); - createEAttribute(parameterEClass, PARAMETER__COLUMN_TYPE); - createEAttribute(parameterEClass, PARAMETER__COMMAND); - createEAttribute(parameterEClass, PARAMETER__NAME); - - relationshipEClass = createEClass(RELATIONSHIP); - createEReference(relationshipEClass, RELATIONSHIP__KEY_PAIR); - createEAttribute(relationshipEClass, RELATIONSHIP__CONFIG); - createEAttribute(relationshipEClass, RELATIONSHIP__FOREIGN_KEY_TABLE); - createEAttribute(relationshipEClass, RELATIONSHIP__MANY); - createEAttribute(relationshipEClass, RELATIONSHIP__NAME); - createEAttribute(relationshipEClass, RELATIONSHIP__PRIMARY_KEY_TABLE); - - resultDescriptorEClass = createEClass(RESULT_DESCRIPTOR); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__COLUMN_NAME); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__COLUMN_TYPE); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__COMMAND); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__CONVERTER); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__TABLE_NAME); - - tableEClass = createEClass(TABLE); - createEReference(tableEClass, TABLE__COLUMN); - createEAttribute(tableEClass, TABLE__CONFIG); - createEAttribute(tableEClass, TABLE__CREATE); - createEAttribute(tableEClass, TABLE__DELETE); - createEAttribute(tableEClass, TABLE__NAME); - createEAttribute(tableEClass, TABLE__PROPERTY_NAME); - createEAttribute(tableEClass, TABLE__UPDATE); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(columnEClass, Column.class, "Column", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getColumn_Collision(), theXMLTypePackage.getBoolean(), "collision", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_ColumnType(), theXMLTypePackage.getString(), "columnType", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_ConverterClassName(), theXMLTypePackage.getString(), "converterClassName", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_Generated(), theXMLTypePackage.getBoolean(), "generated", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_PrimaryKey(), theXMLTypePackage.getBoolean(), "primaryKey", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_PropertyName(), theXMLTypePackage.getString(), "propertyName", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_Table(), theXMLTypePackage.getAnyURI(), "table", null, 0, 1, Column.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(commandEClass, Command.class, "Command", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCommand_Parameter(), this.getParameter(), null, "parameter", null, 0, -1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getCommand_ResultDescriptor(), this.getResultDescriptor(), null, "resultDescriptor", null, 0, -1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, Command.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_Kind(), theXMLTypePackage.getString(), "kind", null, 0, 1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_SQL(), theXMLTypePackage.getString(), "sQL", null, 0, 1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(configEClass, Config.class, "Config", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getConfig_Command(), this.getCommand(), null, "command", null, 0, -1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getConfig_ConnectionProperties(), this.getConnectionProperties(), null, "connectionProperties", null, 0, 1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getConfig_Table(), this.getTable(), null, "table", null, 0, -1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getConfig_Relationship(), this.getRelationship(), null, "relationship", null, 0, -1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConfig_Uri(), theXMLTypePackage.getString(), "uri", null, 0, 1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(connectionPropertiesEClass, ConnectionProperties.class, "ConnectionProperties", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getConnectionProperties_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, ConnectionProperties.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DataSource(), theXMLTypePackage.getString(), "dataSource", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverClassName(), theXMLTypePackage.getString(), "driverClassName", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverPassword(), theXMLTypePackage.getString(), "driverPassword", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverURL(), theXMLTypePackage.getString(), "driverURL", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverUserName(), theXMLTypePackage.getString(), "driverUserName", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(keyPairEClass, KeyPair.class, "KeyPair", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getKeyPair_ForeignKeyColumn(), theXMLTypePackage.getString(), "foreignKeyColumn", null, 0, 1, KeyPair.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getKeyPair_PrimaryKeyColumn(), theXMLTypePackage.getString(), "primaryKeyColumn", null, 0, 1, KeyPair.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getKeyPair_Relationship(), theXMLTypePackage.getAnyURI(), "relationship", null, 0, 1, KeyPair.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getParameter_ColumnType(), theXMLTypePackage.getString(), "columnType", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getParameter_Command(), theXMLTypePackage.getAnyURI(), "command", null, 0, 1, Parameter.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getParameter_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(relationshipEClass, Relationship.class, "Relationship", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getRelationship_KeyPair(), this.getKeyPair(), null, "keyPair", null, 0, -1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, Relationship.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_ForeignKeyTable(), theXMLTypePackage.getString(), "foreignKeyTable", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_Many(), theXMLTypePackage.getBoolean(), "many", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_PrimaryKeyTable(), theXMLTypePackage.getString(), "primaryKeyTable", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(resultDescriptorEClass, ResultDescriptor.class, "ResultDescriptor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getResultDescriptor_ColumnName(), theXMLTypePackage.getString(), "columnName", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_ColumnType(), theXMLTypePackage.getString(), "columnType", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_Command(), theXMLTypePackage.getAnyURI(), "command", null, 0, 1, ResultDescriptor.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_Converter(), theXMLTypePackage.getString(), "converter", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_TableName(), theXMLTypePackage.getString(), "tableName", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(tableEClass, Table.class, "Table", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getTable_Column(), this.getColumn(), null, "column", null, 0, -1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, Table.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Create(), theXMLTypePackage.getString(), "create", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Delete(), theXMLTypePackage.getString(), "delete", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_PropertyName(), theXMLTypePackage.getString(), "propertyName", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Update(), theXMLTypePackage.getString(), "update", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (columnEClass, - source, - new String[] - { - "name", "Column", - "kind", "empty" - }); - addAnnotation - (getColumn_Collision(), - source, - new String[] - { - "kind", "attribute", - "name", "collision" - }); - addAnnotation - (getColumn_ColumnType(), - source, - new String[] - { - "kind", "attribute", - "name", "columnType" - }); - addAnnotation - (getColumn_ConverterClassName(), - source, - new String[] - { - "kind", "attribute", - "name", "converterClassName" - }); - addAnnotation - (getColumn_Generated(), - source, - new String[] - { - "kind", "attribute", - "name", "generated" - }); - addAnnotation - (getColumn_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getColumn_PrimaryKey(), - source, - new String[] - { - "kind", "attribute", - "name", "primaryKey" - }); - addAnnotation - (getColumn_PropertyName(), - source, - new String[] - { - "kind", "attribute", - "name", "propertyName" - }); - addAnnotation - (getColumn_Table(), - source, - new String[] - { - "kind", "attribute", - "name", "Table" - }); - addAnnotation - (commandEClass, - source, - new String[] - { - "name", "Command", - "kind", "elementOnly" - }); - addAnnotation - (getCommand_Parameter(), - source, - new String[] - { - "kind", "element", - "name", "Parameter" - }); - addAnnotation - (getCommand_ResultDescriptor(), - source, - new String[] - { - "kind", "element", - "name", "ResultDescriptor" - }); - addAnnotation - (getCommand_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getCommand_Kind(), - source, - new String[] - { - "kind", "attribute", - "name", "kind" - }); - addAnnotation - (getCommand_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getCommand_SQL(), - source, - new String[] - { - "kind", "attribute", - "name", "SQL" - }); - addAnnotation - (configEClass, - source, - new String[] - { - "name", "Config", - "kind", "elementOnly" - }); - addAnnotation - (getConfig_Command(), - source, - new String[] - { - "kind", "element", - "name", "Command" - }); - addAnnotation - (getConfig_ConnectionProperties(), - source, - new String[] - { - "kind", "element", - "name", "ConnectionProperties" - }); - addAnnotation - (getConfig_Table(), - source, - new String[] - { - "kind", "element", - "name", "Table" - }); - addAnnotation - (getConfig_Relationship(), - source, - new String[] - { - "kind", "element", - "name", "Relationship" - }); - addAnnotation - (getConfig_Uri(), - source, - new String[] - { - "kind", "attribute", - "name", "uri" - }); - addAnnotation - (connectionPropertiesEClass, - source, - new String[] - { - "name", "ConnectionProperties", - "kind", "empty" - }); - addAnnotation - (getConnectionProperties_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getConnectionProperties_DataSource(), - source, - new String[] - { - "kind", "attribute", - "name", "dataSource" - }); - addAnnotation - (getConnectionProperties_DriverClassName(), - source, - new String[] - { - "kind", "attribute", - "name", "driverClassName" - }); - addAnnotation - (getConnectionProperties_DriverPassword(), - source, - new String[] - { - "kind", "attribute", - "name", "driverPassword" - }); - addAnnotation - (getConnectionProperties_DriverURL(), - source, - new String[] - { - "kind", "attribute", - "name", "driverURL" - }); - addAnnotation - (getConnectionProperties_DriverUserName(), - source, - new String[] - { - "kind", "attribute", - "name", "driverUserName" - }); - addAnnotation - (keyPairEClass, - source, - new String[] - { - "name", "KeyPair", - "kind", "empty" - }); - addAnnotation - (getKeyPair_ForeignKeyColumn(), - source, - new String[] - { - "kind", "attribute", - "name", "foreignKeyColumn" - }); - addAnnotation - (getKeyPair_PrimaryKeyColumn(), - source, - new String[] - { - "kind", "attribute", - "name", "primaryKeyColumn" - }); - addAnnotation - (getKeyPair_Relationship(), - source, - new String[] - { - "kind", "attribute", - "name", "Relationship" - }); - addAnnotation - (parameterEClass, - source, - new String[] - { - "name", "Parameter", - "kind", "empty" - }); - addAnnotation - (getParameter_ColumnType(), - source, - new String[] - { - "kind", "attribute", - "name", "columnType" - }); - addAnnotation - (getParameter_Command(), - source, - new String[] - { - "kind", "attribute", - "name", "Command" - }); - addAnnotation - (getParameter_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (relationshipEClass, - source, - new String[] - { - "name", "Relationship", - "kind", "elementOnly" - }); - addAnnotation - (getRelationship_KeyPair(), - source, - new String[] - { - "kind", "element", - "name", "KeyPair" - }); - addAnnotation - (getRelationship_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getRelationship_ForeignKeyTable(), - source, - new String[] - { - "kind", "attribute", - "name", "foreignKeyTable" - }); - addAnnotation - (getRelationship_Many(), - source, - new String[] - { - "kind", "attribute", - "name", "many" - }); - addAnnotation - (getRelationship_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getRelationship_PrimaryKeyTable(), - source, - new String[] - { - "kind", "attribute", - "name", "primaryKeyTable" - }); - addAnnotation - (resultDescriptorEClass, - source, - new String[] - { - "name", "ResultDescriptor", - "kind", "empty" - }); - addAnnotation - (getResultDescriptor_ColumnName(), - source, - new String[] - { - "kind", "attribute", - "name", "columnName" - }); - addAnnotation - (getResultDescriptor_ColumnType(), - source, - new String[] - { - "kind", "attribute", - "name", "columnType" - }); - addAnnotation - (getResultDescriptor_Command(), - source, - new String[] - { - "kind", "attribute", - "name", "Command" - }); - addAnnotation - (getResultDescriptor_Converter(), - source, - new String[] - { - "kind", "attribute", - "name", "converter" - }); - addAnnotation - (getResultDescriptor_TableName(), - source, - new String[] - { - "kind", "attribute", - "name", "tableName" - }); - addAnnotation - (tableEClass, - source, - new String[] - { - "name", "Table", - "kind", "elementOnly" - }); - addAnnotation - (getTable_Column(), - source, - new String[] - { - "kind", "element", - "name", "Column" - }); - addAnnotation - (getTable_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getTable_Create(), - source, - new String[] - { - "kind", "attribute", - "name", "create" - }); - addAnnotation - (getTable_Delete(), - source, - new String[] - { - "kind", "attribute", - "name", "delete" - }); - addAnnotation - (getTable_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getTable_PropertyName(), - source, - new String[] - { - "kind", "attribute", - "name", "propertyName" - }); - addAnnotation - (getTable_Update(), - source, - new String[] - { - "kind", "attribute", - "name", "update" - }); - } - - /** - * <!-- begin-user-doc --> - * Defines literals for the meta objects that represent - * <ul> - * <li>each class,</li> - * <li>each feature of each class,</li> - * <li>each enum,</li> - * <li>and each data type</li> - * </ul> - * <!-- end-user-doc --> - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl <em>Column</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ColumnImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getColumn() - * @generated - */ - public static final EClass COLUMN = eINSTANCE.getColumn(); - - /** - * The meta object literal for the '<em><b>Collision</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__COLLISION = eINSTANCE.getColumn_Collision(); - - /** - * The meta object literal for the '<em><b>Column Type</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__COLUMN_TYPE = eINSTANCE.getColumn_ColumnType(); - - /** - * The meta object literal for the '<em><b>Converter Class Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__CONVERTER_CLASS_NAME = eINSTANCE.getColumn_ConverterClassName(); - - /** - * The meta object literal for the '<em><b>Generated</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__GENERATED = eINSTANCE.getColumn_Generated(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__NAME = eINSTANCE.getColumn_Name(); - - /** - * The meta object literal for the '<em><b>Primary Key</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__PRIMARY_KEY = eINSTANCE.getColumn_PrimaryKey(); - - /** - * The meta object literal for the '<em><b>Property Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__PROPERTY_NAME = eINSTANCE.getColumn_PropertyName(); - - /** - * The meta object literal for the '<em><b>Table</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COLUMN__TABLE = eINSTANCE.getColumn_Table(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl <em>Command</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.CommandImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getCommand() - * @generated - */ - public static final EClass COMMAND = eINSTANCE.getCommand(); - - /** - * The meta object literal for the '<em><b>Parameter</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference COMMAND__PARAMETER = eINSTANCE.getCommand_Parameter(); - - /** - * The meta object literal for the '<em><b>Result Descriptor</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference COMMAND__RESULT_DESCRIPTOR = eINSTANCE.getCommand_ResultDescriptor(); - - /** - * The meta object literal for the '<em><b>Config</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COMMAND__CONFIG = eINSTANCE.getCommand_Config(); - - /** - * The meta object literal for the '<em><b>Kind</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COMMAND__KIND = eINSTANCE.getCommand_Kind(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COMMAND__NAME = eINSTANCE.getCommand_Name(); - - /** - * The meta object literal for the '<em><b>SQL</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COMMAND__SQL = eINSTANCE.getCommand_SQL(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl <em>Config</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ConfigImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConfig() - * @generated - */ - public static final EClass CONFIG = eINSTANCE.getConfig(); - - /** - * The meta object literal for the '<em><b>Command</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference CONFIG__COMMAND = eINSTANCE.getConfig_Command(); - - /** - * The meta object literal for the '<em><b>Connection Properties</b></em>' containment reference feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference CONFIG__CONNECTION_PROPERTIES = eINSTANCE.getConfig_ConnectionProperties(); - - /** - * The meta object literal for the '<em><b>Table</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference CONFIG__TABLE = eINSTANCE.getConfig_Table(); - - /** - * The meta object literal for the '<em><b>Relationship</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference CONFIG__RELATIONSHIP = eINSTANCE.getConfig_Relationship(); - - /** - * The meta object literal for the '<em><b>Uri</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CONFIG__URI = eINSTANCE.getConfig_Uri(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl <em>Connection Properties</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConnectionProperties() - * @generated - */ - public static final EClass CONNECTION_PROPERTIES = eINSTANCE.getConnectionProperties(); - - /** - * The meta object literal for the '<em><b>Config</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__CONFIG = eINSTANCE.getConnectionProperties_Config(); - - /** - * The meta object literal for the '<em><b>Data Source</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DATA_SOURCE = eINSTANCE.getConnectionProperties_DataSource(); - - /** - * The meta object literal for the '<em><b>Driver Class Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_CLASS_NAME = eINSTANCE.getConnectionProperties_DriverClassName(); - - /** - * The meta object literal for the '<em><b>Driver Password</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_PASSWORD = eINSTANCE.getConnectionProperties_DriverPassword(); - - /** - * The meta object literal for the '<em><b>Driver URL</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_URL = eINSTANCE.getConnectionProperties_DriverURL(); - - /** - * The meta object literal for the '<em><b>Driver User Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_USER_NAME = eINSTANCE.getConnectionProperties_DriverUserName(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl <em>Key Pair</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.KeyPairImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getKeyPair() - * @generated - */ - public static final EClass KEY_PAIR = eINSTANCE.getKeyPair(); - - /** - * The meta object literal for the '<em><b>Foreign Key Column</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute KEY_PAIR__FOREIGN_KEY_COLUMN = eINSTANCE.getKeyPair_ForeignKeyColumn(); - - /** - * The meta object literal for the '<em><b>Primary Key Column</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute KEY_PAIR__PRIMARY_KEY_COLUMN = eINSTANCE.getKeyPair_PrimaryKeyColumn(); - - /** - * The meta object literal for the '<em><b>Relationship</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute KEY_PAIR__RELATIONSHIP = eINSTANCE.getKeyPair_Relationship(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl <em>Parameter</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ParameterImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getParameter() - * @generated - */ - public static final EClass PARAMETER = eINSTANCE.getParameter(); - - /** - * The meta object literal for the '<em><b>Column Type</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute PARAMETER__COLUMN_TYPE = eINSTANCE.getParameter_ColumnType(); - - /** - * The meta object literal for the '<em><b>Command</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute PARAMETER__COMMAND = eINSTANCE.getParameter_Command(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute PARAMETER__NAME = eINSTANCE.getParameter_Name(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl <em>Relationship</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.RelationshipImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getRelationship() - * @generated - */ - public static final EClass RELATIONSHIP = eINSTANCE.getRelationship(); - - /** - * The meta object literal for the '<em><b>Key Pair</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference RELATIONSHIP__KEY_PAIR = eINSTANCE.getRelationship_KeyPair(); - - /** - * The meta object literal for the '<em><b>Config</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RELATIONSHIP__CONFIG = eINSTANCE.getRelationship_Config(); - - /** - * The meta object literal for the '<em><b>Foreign Key Table</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RELATIONSHIP__FOREIGN_KEY_TABLE = eINSTANCE.getRelationship_ForeignKeyTable(); - - /** - * The meta object literal for the '<em><b>Many</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RELATIONSHIP__MANY = eINSTANCE.getRelationship_Many(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RELATIONSHIP__NAME = eINSTANCE.getRelationship_Name(); - - /** - * The meta object literal for the '<em><b>Primary Key Table</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RELATIONSHIP__PRIMARY_KEY_TABLE = eINSTANCE.getRelationship_PrimaryKeyTable(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl <em>Result Descriptor</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getResultDescriptor() - * @generated - */ - public static final EClass RESULT_DESCRIPTOR = eINSTANCE.getResultDescriptor(); - - /** - * The meta object literal for the '<em><b>Column Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__COLUMN_NAME = eINSTANCE.getResultDescriptor_ColumnName(); - - /** - * The meta object literal for the '<em><b>Column Type</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__COLUMN_TYPE = eINSTANCE.getResultDescriptor_ColumnType(); - - /** - * The meta object literal for the '<em><b>Command</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__COMMAND = eINSTANCE.getResultDescriptor_Command(); - - /** - * The meta object literal for the '<em><b>Converter</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__CONVERTER = eINSTANCE.getResultDescriptor_Converter(); - - /** - * The meta object literal for the '<em><b>Table Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__TABLE_NAME = eINSTANCE.getResultDescriptor_TableName(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.TableImpl <em>Table</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.config.impl.TableImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getTable() - * @generated - */ - public static final EClass TABLE = eINSTANCE.getTable(); - - /** - * The meta object literal for the '<em><b>Column</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference TABLE__COLUMN = eINSTANCE.getTable_Column(); - - /** - * The meta object literal for the '<em><b>Config</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute TABLE__CONFIG = eINSTANCE.getTable_Config(); - - /** - * The meta object literal for the '<em><b>Create</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute TABLE__CREATE = eINSTANCE.getTable_Create(); - - /** - * The meta object literal for the '<em><b>Delete</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute TABLE__DELETE = eINSTANCE.getTable_Delete(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute TABLE__NAME = eINSTANCE.getTable_Name(); - - /** - * The meta object literal for the '<em><b>Property Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute TABLE__PROPERTY_NAME = eINSTANCE.getTable_PropertyName(); - - /** - * The meta object literal for the '<em><b>Update</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute TABLE__UPDATE = eINSTANCE.getTable_Update(); - - } - -} //ConfigPackageImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConnectionPropertiesImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConnectionPropertiesImpl.java deleted file mode 100644 index c961732dca..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConnectionPropertiesImpl.java +++ /dev/null @@ -1,455 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.ConnectionProperties; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Connection Properties</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDataSource <em>Data Source</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverClassName <em>Driver Class Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverPassword <em>Driver Password</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverURL <em>Driver URL</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverUserName <em>Driver User Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ConnectionPropertiesImpl extends DataObjectImpl implements ConnectionProperties -{ - /** - * The default value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getDataSource() <em>Data Source</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDataSource() - * @generated - * @ordered - */ - protected static final String DATA_SOURCE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDataSource() <em>Data Source</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDataSource() - * @generated - * @ordered - */ - protected String dataSource = DATA_SOURCE_EDEFAULT; - - /** - * The default value of the '{@link #getDriverClassName() <em>Driver Class Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverClassName() - * @generated - * @ordered - */ - protected static final String DRIVER_CLASS_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverClassName() <em>Driver Class Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverClassName() - * @generated - * @ordered - */ - protected String driverClassName = DRIVER_CLASS_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDriverPassword() <em>Driver Password</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverPassword() - * @generated - * @ordered - */ - protected static final String DRIVER_PASSWORD_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverPassword() <em>Driver Password</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverPassword() - * @generated - * @ordered - */ - protected String driverPassword = DRIVER_PASSWORD_EDEFAULT; - - /** - * The default value of the '{@link #getDriverURL() <em>Driver URL</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverURL() - * @generated - * @ordered - */ - protected static final String DRIVER_URL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverURL() <em>Driver URL</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverURL() - * @generated - * @ordered - */ - protected String driverURL = DRIVER_URL_EDEFAULT; - - /** - * The default value of the '{@link #getDriverUserName() <em>Driver User Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverUserName() - * @generated - * @ordered - */ - protected static final String DRIVER_USER_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverUserName() <em>Driver User Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDriverUserName() - * @generated - * @ordered - */ - protected String driverUserName = DRIVER_USER_NAME_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ConnectionPropertiesImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.CONNECTION_PROPERTIES; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG, oldConfig, config)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getDataSource() - { - return dataSource; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setDataSource(String newDataSource) - { - String oldDataSource = dataSource; - dataSource = newDataSource; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE, oldDataSource, dataSource)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getDriverClassName() - { - return driverClassName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setDriverClassName(String newDriverClassName) - { - String oldDriverClassName = driverClassName; - driverClassName = newDriverClassName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME, oldDriverClassName, driverClassName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getDriverPassword() - { - return driverPassword; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setDriverPassword(String newDriverPassword) - { - String oldDriverPassword = driverPassword; - driverPassword = newDriverPassword; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD, oldDriverPassword, driverPassword)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getDriverURL() - { - return driverURL; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setDriverURL(String newDriverURL) - { - String oldDriverURL = driverURL; - driverURL = newDriverURL; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL, oldDriverURL, driverURL)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getDriverUserName() - { - return driverUserName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setDriverUserName(String newDriverUserName) - { - String oldDriverUserName = driverUserName; - driverUserName = newDriverUserName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME, oldDriverUserName, driverUserName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - return getConfig(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - return getDataSource(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - return getDriverClassName(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - return getDriverPassword(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - return getDriverURL(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - return getDriverUserName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - setDataSource((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - setDriverClassName((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - setDriverPassword((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - setDriverURL((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - setDriverUserName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - setDataSource(DATA_SOURCE_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - setDriverClassName(DRIVER_CLASS_NAME_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - setDriverPassword(DRIVER_PASSWORD_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - setDriverURL(DRIVER_URL_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - setDriverUserName(DRIVER_USER_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - return DATA_SOURCE_EDEFAULT == null ? dataSource != null : !DATA_SOURCE_EDEFAULT.equals(dataSource); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - return DRIVER_CLASS_NAME_EDEFAULT == null ? driverClassName != null : !DRIVER_CLASS_NAME_EDEFAULT.equals(driverClassName); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - return DRIVER_PASSWORD_EDEFAULT == null ? driverPassword != null : !DRIVER_PASSWORD_EDEFAULT.equals(driverPassword); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - return DRIVER_URL_EDEFAULT == null ? driverURL != null : !DRIVER_URL_EDEFAULT.equals(driverURL); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - return DRIVER_USER_NAME_EDEFAULT == null ? driverUserName != null : !DRIVER_USER_NAME_EDEFAULT.equals(driverUserName); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", dataSource: "); - result.append(dataSource); - result.append(", driverClassName: "); - result.append(driverClassName); - result.append(", driverPassword: "); - result.append(driverPassword); - result.append(", driverURL: "); - result.append(driverURL); - result.append(", driverUserName: "); - result.append(driverUserName); - result.append(')'); - return result.toString(); - } - -} //ConnectionPropertiesImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/KeyPairImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/KeyPairImpl.java deleted file mode 100644 index f12c7a3ec1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/KeyPairImpl.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.KeyPair; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Key Pair</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl#getForeignKeyColumn <em>Foreign Key Column</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl#getPrimaryKeyColumn <em>Primary Key Column</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl#getRelationship <em>Relationship</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class KeyPairImpl extends DataObjectImpl implements KeyPair -{ - /** - * The default value of the '{@link #getForeignKeyColumn() <em>Foreign Key Column</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getForeignKeyColumn() - * @generated - * @ordered - */ - protected static final String FOREIGN_KEY_COLUMN_EDEFAULT = null; - - /** - * The cached value of the '{@link #getForeignKeyColumn() <em>Foreign Key Column</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getForeignKeyColumn() - * @generated - * @ordered - */ - protected String foreignKeyColumn = FOREIGN_KEY_COLUMN_EDEFAULT; - - /** - * The default value of the '{@link #getPrimaryKeyColumn() <em>Primary Key Column</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPrimaryKeyColumn() - * @generated - * @ordered - */ - protected static final String PRIMARY_KEY_COLUMN_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPrimaryKeyColumn() <em>Primary Key Column</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPrimaryKeyColumn() - * @generated - * @ordered - */ - protected String primaryKeyColumn = PRIMARY_KEY_COLUMN_EDEFAULT; - - /** - * The default value of the '{@link #getRelationship() <em>Relationship</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getRelationship() - * @generated - * @ordered - */ - protected static final String RELATIONSHIP_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRelationship() <em>Relationship</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getRelationship() - * @generated - * @ordered - */ - protected String relationship = RELATIONSHIP_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected KeyPairImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.KEY_PAIR; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getForeignKeyColumn() - { - return foreignKeyColumn; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setForeignKeyColumn(String newForeignKeyColumn) - { - String oldForeignKeyColumn = foreignKeyColumn; - foreignKeyColumn = newForeignKeyColumn; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN, oldForeignKeyColumn, foreignKeyColumn)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getPrimaryKeyColumn() - { - return primaryKeyColumn; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setPrimaryKeyColumn(String newPrimaryKeyColumn) - { - String oldPrimaryKeyColumn = primaryKeyColumn; - primaryKeyColumn = newPrimaryKeyColumn; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN, oldPrimaryKeyColumn, primaryKeyColumn)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getRelationship() - { - return relationship; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setRelationship(String newRelationship) - { - String oldRelationship = relationship; - relationship = newRelationship; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.KEY_PAIR__RELATIONSHIP, oldRelationship, relationship)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - return getForeignKeyColumn(); - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - return getPrimaryKeyColumn(); - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - return getRelationship(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - setForeignKeyColumn((String)newValue); - return; - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - setPrimaryKeyColumn((String)newValue); - return; - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - setRelationship((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - setForeignKeyColumn(FOREIGN_KEY_COLUMN_EDEFAULT); - return; - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - setPrimaryKeyColumn(PRIMARY_KEY_COLUMN_EDEFAULT); - return; - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - setRelationship(RELATIONSHIP_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - return FOREIGN_KEY_COLUMN_EDEFAULT == null ? foreignKeyColumn != null : !FOREIGN_KEY_COLUMN_EDEFAULT.equals(foreignKeyColumn); - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - return PRIMARY_KEY_COLUMN_EDEFAULT == null ? primaryKeyColumn != null : !PRIMARY_KEY_COLUMN_EDEFAULT.equals(primaryKeyColumn); - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - return RELATIONSHIP_EDEFAULT == null ? relationship != null : !RELATIONSHIP_EDEFAULT.equals(relationship); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (foreignKeyColumn: "); - result.append(foreignKeyColumn); - result.append(", primaryKeyColumn: "); - result.append(primaryKeyColumn); - result.append(", relationship: "); - result.append(relationship); - result.append(')'); - return result.toString(); - } - -} //KeyPairImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ParameterImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ParameterImpl.java deleted file mode 100644 index ef4b7e58a5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ParameterImpl.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.Parameter; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Parameter</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl#getColumnType <em>Column Type</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl#getCommand <em>Command</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl#getName <em>Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ParameterImpl extends DataObjectImpl implements Parameter -{ - /** - * The default value of the '{@link #getColumnType() <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnType() - * @generated - * @ordered - */ - protected static final String COLUMN_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnType() <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnType() - * @generated - * @ordered - */ - protected String columnType = COLUMN_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getCommand() <em>Command</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCommand() - * @generated - * @ordered - */ - protected static final String COMMAND_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCommand() <em>Command</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCommand() - * @generated - * @ordered - */ - protected String command = COMMAND_EDEFAULT; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ParameterImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.PARAMETER; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getColumnType() - { - return columnType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setColumnType(String newColumnType) - { - String oldColumnType = columnType; - columnType = newColumnType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.PARAMETER__COLUMN_TYPE, oldColumnType, columnType)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getCommand() - { - return command; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setCommand(String newCommand) - { - String oldCommand = command; - command = newCommand; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.PARAMETER__COMMAND, oldCommand, command)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.PARAMETER__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - return getColumnType(); - case ConfigPackageImpl.PARAMETER__COMMAND: - return getCommand(); - case ConfigPackageImpl.PARAMETER__NAME: - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - setColumnType((String)newValue); - return; - case ConfigPackageImpl.PARAMETER__COMMAND: - setCommand((String)newValue); - return; - case ConfigPackageImpl.PARAMETER__NAME: - setName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - setColumnType(COLUMN_TYPE_EDEFAULT); - return; - case ConfigPackageImpl.PARAMETER__COMMAND: - setCommand(COMMAND_EDEFAULT); - return; - case ConfigPackageImpl.PARAMETER__NAME: - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - return COLUMN_TYPE_EDEFAULT == null ? columnType != null : !COLUMN_TYPE_EDEFAULT.equals(columnType); - case ConfigPackageImpl.PARAMETER__COMMAND: - return COMMAND_EDEFAULT == null ? command != null : !COMMAND_EDEFAULT.equals(command); - case ConfigPackageImpl.PARAMETER__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (columnType: "); - result.append(columnType); - result.append(", command: "); - result.append(command); - result.append(", name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} //ParameterImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java deleted file mode 100644 index 002edf508c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java +++ /dev/null @@ -1,497 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Relationship</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getKeyPair <em>Key Pair</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getForeignKeyTable <em>Foreign Key Table</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#isMany <em>Many</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getPrimaryKeyTable <em>Primary Key Table</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class RelationshipImpl extends DataObjectImpl implements Relationship -{ - /** - * The cached value of the '{@link #getKeyPair() <em>Key Pair</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getKeyPair() - * @generated - * @ordered - */ - protected EList keyPair = null; - - /** - * The default value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getForeignKeyTable() <em>Foreign Key Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getForeignKeyTable() - * @generated - * @ordered - */ - protected static final String FOREIGN_KEY_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getForeignKeyTable() <em>Foreign Key Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getForeignKeyTable() - * @generated - * @ordered - */ - protected String foreignKeyTable = FOREIGN_KEY_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #isMany() <em>Many</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isMany() - * @generated - * @ordered - */ - protected static final boolean MANY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isMany() <em>Many</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isMany() - * @generated - * @ordered - */ - protected boolean many = MANY_EDEFAULT; - - /** - * This is true if the Many attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean manyESet = false; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getPrimaryKeyTable() <em>Primary Key Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPrimaryKeyTable() - * @generated - * @ordered - */ - protected static final String PRIMARY_KEY_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPrimaryKeyTable() <em>Primary Key Table</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPrimaryKeyTable() - * @generated - * @ordered - */ - protected String primaryKeyTable = PRIMARY_KEY_TABLE_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected RelationshipImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.RELATIONSHIP; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getKeyPair() - { - if (keyPair == null) - { - keyPair = new EObjectContainmentEList(KeyPair.class, this, ConfigPackageImpl.RELATIONSHIP__KEY_PAIR); - } - return keyPair; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__CONFIG, oldConfig, config)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getForeignKeyTable() - { - return foreignKeyTable; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setForeignKeyTable(String newForeignKeyTable) - { - String oldForeignKeyTable = foreignKeyTable; - foreignKeyTable = newForeignKeyTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE, oldForeignKeyTable, foreignKeyTable)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isMany() - { - return many; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setMany(boolean newMany) - { - boolean oldMany = many; - many = newMany; - boolean oldManyESet = manyESet; - manyESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__MANY, oldMany, many, !oldManyESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetMany() - { - boolean oldMany = many; - boolean oldManyESet = manyESet; - many = MANY_EDEFAULT; - manyESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.RELATIONSHIP__MANY, oldMany, MANY_EDEFAULT, oldManyESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetMany() - { - return manyESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getPrimaryKeyTable() - { - return primaryKeyTable; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setPrimaryKeyTable(String newPrimaryKeyTable) - { - String oldPrimaryKeyTable = primaryKeyTable; - primaryKeyTable = newPrimaryKeyTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE, oldPrimaryKeyTable, primaryKeyTable)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - return ((InternalEList)getKeyPair()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - return getKeyPair(); - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - return getConfig(); - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - return getForeignKeyTable(); - case ConfigPackageImpl.RELATIONSHIP__MANY: - return isMany() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.RELATIONSHIP__NAME: - return getName(); - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - return getPrimaryKeyTable(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - getKeyPair().clear(); - getKeyPair().addAll((Collection)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - setForeignKeyTable((String)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__MANY: - setMany(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.RELATIONSHIP__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - setPrimaryKeyTable((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - getKeyPair().clear(); - return; - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - setForeignKeyTable(FOREIGN_KEY_TABLE_EDEFAULT); - return; - case ConfigPackageImpl.RELATIONSHIP__MANY: - unsetMany(); - return; - case ConfigPackageImpl.RELATIONSHIP__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - setPrimaryKeyTable(PRIMARY_KEY_TABLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - return keyPair != null && !keyPair.isEmpty(); - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - return FOREIGN_KEY_TABLE_EDEFAULT == null ? foreignKeyTable != null : !FOREIGN_KEY_TABLE_EDEFAULT.equals(foreignKeyTable); - case ConfigPackageImpl.RELATIONSHIP__MANY: - return isSetMany(); - case ConfigPackageImpl.RELATIONSHIP__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - return PRIMARY_KEY_TABLE_EDEFAULT == null ? primaryKeyTable != null : !PRIMARY_KEY_TABLE_EDEFAULT.equals(primaryKeyTable); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", foreignKeyTable: "); - result.append(foreignKeyTable); - result.append(", many: "); - if (manyESet) result.append(many); else result.append("<unset>"); - result.append(", name: "); - result.append(name); - result.append(", primaryKeyTable: "); - result.append(primaryKeyTable); - result.append(')'); - return result.toString(); - } - -} //RelationshipImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java deleted file mode 100644 index f6b6e1c8f8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java +++ /dev/null @@ -1,399 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.ResultDescriptor; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Result Descriptor</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getColumnName <em>Column Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getColumnType <em>Column Type</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getCommand <em>Command</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getConverter <em>Converter</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getTableName <em>Table Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ResultDescriptorImpl extends DataObjectImpl implements ResultDescriptor -{ - /** - * The default value of the '{@link #getColumnName() <em>Column Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnName() - * @generated - * @ordered - */ - protected static final String COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnName() <em>Column Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnName() - * @generated - * @ordered - */ - protected String columnName = COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getColumnType() <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnType() - * @generated - * @ordered - */ - protected static final String COLUMN_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnType() <em>Column Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumnType() - * @generated - * @ordered - */ - protected String columnType = COLUMN_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getCommand() <em>Command</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCommand() - * @generated - * @ordered - */ - protected static final String COMMAND_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCommand() <em>Command</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCommand() - * @generated - * @ordered - */ - protected String command = COMMAND_EDEFAULT; - - /** - * The default value of the '{@link #getConverter() <em>Converter</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConverter() - * @generated - * @ordered - */ - protected static final String CONVERTER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConverter() <em>Converter</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConverter() - * @generated - * @ordered - */ - protected String converter = CONVERTER_EDEFAULT; - - /** - * The default value of the '{@link #getTableName() <em>Table Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTableName() - * @generated - * @ordered - */ - protected static final String TABLE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getTableName() <em>Table Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTableName() - * @generated - * @ordered - */ - protected String tableName = TABLE_NAME_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ResultDescriptorImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.RESULT_DESCRIPTOR; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getColumnName() - { - return columnName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setColumnName(String newColumnName) - { - String oldColumnName = columnName; - columnName = newColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME, oldColumnName, columnName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getColumnType() - { - return columnType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setColumnType(String newColumnType) - { - String oldColumnType = columnType; - columnType = newColumnType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE, oldColumnType, columnType)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getCommand() - { - return command; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setCommand(String newCommand) - { - String oldCommand = command; - command = newCommand; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND, oldCommand, command)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getConverter() - { - return converter; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setConverter(String newConverter) - { - String oldConverter = converter; - converter = newConverter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER, oldConverter, converter)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getTableName() - { - return tableName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setTableName(String newTableName) - { - String oldTableName = tableName; - tableName = newTableName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME, oldTableName, tableName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - return getColumnName(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - return getColumnType(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - return getCommand(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - return getConverter(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - return getTableName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - setColumnName((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - setColumnType((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - setCommand((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - setConverter((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - setTableName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - setColumnName(COLUMN_NAME_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - setColumnType(COLUMN_TYPE_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - setCommand(COMMAND_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - setConverter(CONVERTER_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - setTableName(TABLE_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - return COLUMN_NAME_EDEFAULT == null ? columnName != null : !COLUMN_NAME_EDEFAULT.equals(columnName); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - return COLUMN_TYPE_EDEFAULT == null ? columnType != null : !COLUMN_TYPE_EDEFAULT.equals(columnType); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - return COMMAND_EDEFAULT == null ? command != null : !COMMAND_EDEFAULT.equals(command); - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - return CONVERTER_EDEFAULT == null ? converter != null : !CONVERTER_EDEFAULT.equals(converter); - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - return TABLE_NAME_EDEFAULT == null ? tableName != null : !TABLE_NAME_EDEFAULT.equals(tableName); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (columnName: "); - result.append(columnName); - result.append(", columnType: "); - result.append(columnType); - result.append(", command: "); - result.append(command); - result.append(", converter: "); - result.append(converter); - result.append(", tableName: "); - result.append(tableName); - result.append(')'); - return result.toString(); - } - -} //ResultDescriptorImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java deleted file mode 100644 index b63816c350..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java +++ /dev/null @@ -1,517 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Table; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Table</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getColumn <em>Column</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getConfig <em>Config</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getCreate <em>Create</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getDelete <em>Delete</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getPropertyName <em>Property Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getUpdate <em>Update</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class TableImpl extends DataObjectImpl implements Table -{ - /** - * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getColumn() - * @generated - * @ordered - */ - protected EList column = null; - - /** - * The default value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() <em>Config</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getCreate() <em>Create</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCreate() - * @generated - * @ordered - */ - protected static final String CREATE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCreate() <em>Create</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCreate() - * @generated - * @ordered - */ - protected String create = CREATE_EDEFAULT; - - /** - * The default value of the '{@link #getDelete() <em>Delete</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDelete() - * @generated - * @ordered - */ - protected static final String DELETE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDelete() <em>Delete</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDelete() - * @generated - * @ordered - */ - protected String delete = DELETE_EDEFAULT; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPropertyName() - * @generated - * @ordered - */ - protected static final String PROPERTY_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPropertyName() - * @generated - * @ordered - */ - protected String propertyName = PROPERTY_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getUpdate() <em>Update</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getUpdate() - * @generated - * @ordered - */ - protected static final String UPDATE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getUpdate() <em>Update</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getUpdate() - * @generated - * @ordered - */ - protected String update = UPDATE_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected TableImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.TABLE; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getColumn() - { - if (column == null) - { - column = new EObjectContainmentEList(Column.class, this, ConfigPackageImpl.TABLE__COLUMN); - } - return column; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__CONFIG, oldConfig, config)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getCreate() - { - return create; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setCreate(String newCreate) - { - String oldCreate = create; - create = newCreate; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__CREATE, oldCreate, create)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getDelete() - { - return delete; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setDelete(String newDelete) - { - String oldDelete = delete; - delete = newDelete; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__DELETE, oldDelete, delete)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getPropertyName() - { - return propertyName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setPropertyName(String newPropertyName) - { - String oldPropertyName = propertyName; - propertyName = newPropertyName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__PROPERTY_NAME, oldPropertyName, propertyName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getUpdate() - { - return update; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setUpdate(String newUpdate) - { - String oldUpdate = update; - update = newUpdate; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__UPDATE, oldUpdate, update)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - return ((InternalEList)getColumn()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - return getColumn(); - case ConfigPackageImpl.TABLE__CONFIG: - return getConfig(); - case ConfigPackageImpl.TABLE__CREATE: - return getCreate(); - case ConfigPackageImpl.TABLE__DELETE: - return getDelete(); - case ConfigPackageImpl.TABLE__NAME: - return getName(); - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - return getPropertyName(); - case ConfigPackageImpl.TABLE__UPDATE: - return getUpdate(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - getColumn().clear(); - getColumn().addAll((Collection)newValue); - return; - case ConfigPackageImpl.TABLE__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.TABLE__CREATE: - setCreate((String)newValue); - return; - case ConfigPackageImpl.TABLE__DELETE: - setDelete((String)newValue); - return; - case ConfigPackageImpl.TABLE__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - setPropertyName((String)newValue); - return; - case ConfigPackageImpl.TABLE__UPDATE: - setUpdate((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - getColumn().clear(); - return; - case ConfigPackageImpl.TABLE__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__CREATE: - setCreate(CREATE_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__DELETE: - setDelete(DELETE_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - setPropertyName(PROPERTY_NAME_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__UPDATE: - setUpdate(UPDATE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - return column != null && !column.isEmpty(); - case ConfigPackageImpl.TABLE__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.TABLE__CREATE: - return CREATE_EDEFAULT == null ? create != null : !CREATE_EDEFAULT.equals(create); - case ConfigPackageImpl.TABLE__DELETE: - return DELETE_EDEFAULT == null ? delete != null : !DELETE_EDEFAULT.equals(delete); - case ConfigPackageImpl.TABLE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName); - case ConfigPackageImpl.TABLE__UPDATE: - return UPDATE_EDEFAULT == null ? update != null : !UPDATE_EDEFAULT.equals(update); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", create: "); - result.append(create); - result.append(", delete: "); - result.append(delete); - result.append(", name: "); - result.append(name); - result.append(", propertyName: "); - result.append(propertyName); - result.append(", update: "); - result.append(update); - result.append(')'); - return result.toString(); - } - -} //TableImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java deleted file mode 100644 index 92499bd000..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java +++ /dev/null @@ -1,381 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.config.wrapper; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public class MappingWrapper { - - private static final ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - - private static final boolean debug = false; - - private Config config; - - public MappingWrapper() { - // Empty Constructor - } - - public MappingWrapper(Config mapping) { - this.config = mapping; - } - - public Config getConfig() { - return this.config; - } - - - public Table getTable(String name) { - if (config == null) - return null; - DebugUtil.debugln(getClass(), debug, "Looking for table " + name); - Iterator i = config.getTable().iterator(); - while (i.hasNext()) { - Table t = (Table) i.next(); - if (name.equals(t.getName())) - return t; - } - - return null; - } - - public Table getTableByPropertyName(String name) { - if (config == null) - return null; - DebugUtil.debugln(getClass(), debug, "Looking for table by property: " - + name); - Iterator i = config.getTable().iterator(); - while (i.hasNext()) { - Table t = (Table) i.next(); - TableWrapper wrapper = new TableWrapper(t); - if (name.equals(wrapper.getPropertyName())) - return t; - } - - throw new RuntimeException("Table with property name " + name - + " not found."); - - } - - public void addRelationship(String parentName, String childName) { - - if (config == null) - config = factory.createConfig(); - - QualifiedColumn parent = new QualifiedColumn(parentName); - QualifiedColumn child = new QualifiedColumn(childName); - - Relationship r = factory.createRelationship(); - r.setName(child.getTableName()); - r.setPrimaryKeyTable(parent.getTableName()); - r.setForeignKeyTable(child.getTableName()); - DebugUtil.debugln(getClass(), debug, "Created relationship from " - + r.getPrimaryKeyTable() + " to " + r.getForeignKeyTable() + " named " - + r.getName()); - - KeyPair pair = factory.createKeyPair(); - pair.setPrimaryKeyColumn(parent.getColumnName()); - pair.setForeignKeyColumn(child.getColumnName()); - - r.getKeyPair().add(pair); - r.setMany(true); - - config.getRelationship().add(r); - - } - - - public void addRelationship(Key parentKey, Key childKey) { - - if (config == null) - config = factory.createConfig(); - - QualifiedColumn parent = new QualifiedColumn((String) parentKey.getColumNames().get(0)); - QualifiedColumn child = new QualifiedColumn((String) childKey.getColumNames().get(0)); - - Relationship r = factory.createRelationship(); - r.setName(child.getTableName()); - r.setPrimaryKeyTable(parent.getTableName()); - r.setForeignKeyTable(child.getTableName()); - DebugUtil.debugln(getClass(), debug, "Created relationship from " - + r.getPrimaryKeyTable() + " to " + r.getForeignKeyTable() + " named " - + r.getName()); - - - Iterator i = parentKey.getColumNames().iterator(); - Iterator j = childKey.getColumNames().iterator(); - while ( i.hasNext() && j.hasNext()) { - parent = new QualifiedColumn((String) i.next()); - child = new QualifiedColumn((String) j.next()); - KeyPair pair = factory.createKeyPair(); - pair.setPrimaryKeyColumn(parent.getColumnName()); - pair.setForeignKeyColumn(child.getColumnName()); - - r.getKeyPair().add(pair); - } - r.setMany(true); - config.getRelationship().add(r); - - } - - public void addPrimaryKey(String columnName) { - Key k = new Key(columnName); - addPrimaryKey(k, false); - } - - public void addPrimaryKey(Key key) { - addPrimaryKey(key, false); - } - - public void addGeneratedPrimaryKey(String columnName) { - Key key = new Key(columnName); - addPrimaryKey(key, true); - } - - private void addPrimaryKey(Key key, boolean generated) { - if (config == null) - config = factory.createConfig(); - - Iterator i = key.getColumNames().iterator(); - while (i.hasNext()) { - String columnName = (String) i.next(); - - QualifiedColumn pkColumn = new QualifiedColumn(columnName); - Table t = findOrCreateTable(pkColumn.getTableName()); - Column c = findOrCreateColumn(t, pkColumn.getColumnName()); - c.setPrimaryKey(true); - if ( generated ) - c.setGenerated(true); - - t.getColumn().add(c); - } - } - - - - public String getTablePropertyName(String tableName) { - Table t = getTable(tableName); - if (t == null) - return tableName; - String propertyName = t.getPropertyName(); - - if (propertyName == null) - return tableName; - - return propertyName; - } - - public Column getColumn(Table t, String name) { - if (t == null) - return null; - Iterator i = t.getColumn().iterator(); - while (i.hasNext()) { - Column c = (Column) i.next(); - if (c.getName().equals(name)) { - return c; - } - } - DebugUtil.debugln(getClass(), debug, "WARNING: Could not find column " - + name + " in table " + t.getName()); - return null; - } - - public String getColumnPropertyName(String tableName, String columnName) { - Table t = getTable(tableName); - Column c = getColumn(t, columnName); - if (c == null) - return columnName; - - String propertyName = c.getPropertyName(); - if (propertyName == null) - return c.getName(); - - return propertyName; - } - - public void addCollisionColumn(String columnName) { - - if (config == null) - config = factory.createConfig(); - - QualifiedColumn occColumn = new QualifiedColumn(columnName); - Table t = findOrCreateTable(occColumn.getTableName()); - Column c = findOrCreateColumn(t, occColumn.getColumnName()); - c.setCollision(true); - - config.getTable().add(t); - } - - private Table findOrCreateTable(String tableName) { - Table table = getTable(tableName); - if (table == null) { - table = ConfigFactoryImpl.eINSTANCE.createTable(); - table.setName(tableName); - config.getTable().add(table); - } - return table; - - } - - private Column findOrCreateColumn(Table t, String name) { - Iterator i = t.getColumn().iterator(); - while (i.hasNext()) { - Column c = (Column) i.next(); - if (name.equals(c.getName())) - return c; - } - - Column c = ConfigFactoryImpl.eINSTANCE.createColumn(); - c.setName(name); - t.getColumn().add(c); - return c; - } - - public boolean hasRecursiveRelationships() { - if (config != null) { - Iterator i = getConfig().getRelationship().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - if (r.getPrimaryKeyTable().equals(r.getForeignKeyTable())) - return true; - } - } - return false; - } - - public Collection getRelationshipsByChildTable(String name) { - ArrayList results = new ArrayList(); - if (config != null) { - Iterator i = getConfig().getRelationship().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - if (name.equals(r.getForeignKeyTable())) - results.add(r); - } - } - return results; - } - - // TODO optimize - public ArrayList getInsertOrder() { - DebugUtil.debugln(getClass(), debug, "Getting insert order"); - ArrayList inserts = new ArrayList(); - HashMap parentToChild = new HashMap(); - - ArrayList parents = new ArrayList(); - ArrayList children = new ArrayList(); - if (config != null) { - Iterator i = getConfig().getRelationship().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - parents.add(r.getPrimaryKeyTable()); - children.add(r.getForeignKeyTable()); - parentToChild.put(r.getPrimaryKeyTable(), r.getForeignKeyTable()); - } - - while (parents.size() > 0) { - String parent = (String) parents.get(0); - if (!children.contains(parent)) { - if (!inserts.contains(parent)) - inserts.add(parent); - - String child = (String) parentToChild.get(parent); - if (!inserts.contains(child)) - inserts.add(child); - - parents.remove(parent); - children.remove(child); - } else { - parents.add(parents.remove(0)); - } - } - inserts.addAll(children); - - } - - DebugUtil.debugln(getClass(), debug, inserts); - return inserts; - } - - public ArrayList getDeleteOrder() { - ArrayList deleteOrder = new ArrayList(); - deleteOrder.addAll(getInsertOrder()); - Collections.reverse(deleteOrder); - return deleteOrder; - } - - public void addConverter(String name, String converter) { - if (config == null) - config = factory.createConfig(); - - QualifiedColumn column = new QualifiedColumn(name); - Table t = findOrCreateTable(column.getTableName()); - Column c = findOrCreateColumn(t, column.getColumnName()); - c.setConverterClassName(converter); - - } - - public String getConverter(String tableName, String columnName) { - Table t = getTable(tableName); - Column c = getColumn(t, columnName); - if (c != null) - return c.getConverterClassName(); - return null; - } - - public HashMap getConverters(Table table) { - HashMap converters = new HashMap(); - - Iterator columns = table.getColumn().iterator(); - while ( columns.hasNext() ) { - Column c = (Column) columns.next(); - if ( c.getConverterClassName() != null ) { - String property = c.getPropertyName(); - if ( property == null ) - property = c.getName(); - converters.put(property, c.getConverterClassName()); - } - } - return converters; - } - - public Relationship getRelationshipByName(String name) { - Iterator i = config.getRelationship().iterator(); - while ( i.hasNext() ) { - Relationship r = (Relationship) i.next(); - if ( name.equals (r.getName())) - return r; - } - throw new RuntimeException("Could not find relationship " + name + " in the configuration"); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/QualifiedColumn.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/QualifiedColumn.java deleted file mode 100644 index 6babe0c349..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/QualifiedColumn.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.config.wrapper; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -public class QualifiedColumn { - - private final String tableName; - private final String columnName; - private static boolean debug = false; - - public QualifiedColumn(String name) { - tableName = name.substring(0, name.indexOf('.')); - columnName = name.substring(name.indexOf('.') + 1); - DebugUtil.debugln(getClass(), debug, tableName); - DebugUtil.debugln(getClass(), debug, columnName); - } - - public String getTableName() { - return this.tableName; - } - - public String getColumnName() { - return this.columnName; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/RelationshipWrapper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/RelationshipWrapper.java deleted file mode 100644 index 14403367d8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/RelationshipWrapper.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.config.wrapper; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; - -public class RelationshipWrapper { - - private Relationship relationship; - - public RelationshipWrapper(Relationship r) { - this.relationship = r; - } - - public Collection getForeignKeys() { - ArrayList keys = new ArrayList(); - Iterator i = this.relationship.getKeyPair().iterator(); - while ( i.hasNext()) { - KeyPair pair = (KeyPair) i.next(); - keys.add(pair.getForeignKeyColumn()); - } - return keys; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/TableWrapper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/TableWrapper.java deleted file mode 100644 index 2c2d1dc677..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/TableWrapper.java +++ /dev/null @@ -1,124 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.config.wrapper; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Table; - -public class TableWrapper { - - private Table table; - - public TableWrapper(Table table) { - this.table = table; - } - - public String getPropertyName() { - return table.getPropertyName() == null ? table.getName() : table - .getPropertyName(); - } - - public Collection getPrimaryKeyNames() { - ArrayList pkNames = new ArrayList(); - Iterator i = table.getColumn().iterator(); - while (i.hasNext()) { - Column c = (Column) i.next(); - if (c.isPrimaryKey()) - pkNames.add(c.getName()); - } - return pkNames; - } - - public Collection getPrimaryKeyProperties() { - - ArrayList keyProperties = new ArrayList(); - Iterator columns = table.getColumn().iterator(); - while (columns.hasNext()) { - Column c = (Column) columns.next(); - if (c.isPrimaryKey()) { - keyProperties.add(getColumnPropertyName(c)); - } - } - - return keyProperties; - } - - private String getColumnPropertyName(Column c) { - if (c.getPropertyName() != null) - return c.getPropertyName(); - else - return c.getName(); - } - - public boolean isGeneratedColumnProperty(String name) { - Column c = getColumnByPropertyName(name); - return c == null ? false : c.isGenerated(); - } - - // public Object getColumnNameByProperty(String propertyName) { - // Iterator i = table.getColumn().iterator(); - // while (i.hasNext()) { - // Column c = (Column) i.next(); - // if (propertyName.equals(c.getPropertyName())) - // return c.getName(); - // } - // return propertyName; - // } - - public String getConverter(String propertyName) { - Column c = getColumnByPropertyName(propertyName); - return (c == null) ? null : c.getConverterClassName(); - } - - public Column getColumnByPropertyName(String propertyName) { - Iterator columns = table.getColumn().iterator(); - while (columns.hasNext()) { - Column c = (Column) columns.next(); - String property = c.getPropertyName(); - if (property == null) - property = c.getName(); - if (propertyName.equals(property)) - return c; - } - - return null; - } - - public Column getCollisionColumn() { - Iterator columns = table.getColumn().iterator(); - while (columns.hasNext()) { - Column c = (Column) columns.next(); - if ( c.isCollision() ) - return c; - } - - return null; - - } - - public String getCollisionColumnPropertyName() { - Column c = getCollisionColumn(); - if ( c.getPropertyName() != null ) - return c.getPropertyName(); - else - return c.getName(); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/CudGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/CudGenerator.java deleted file mode 100644 index 31ab7b2801..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/CudGenerator.java +++ /dev/null @@ -1,64 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.Collection; - -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.impl.DeleteCommandImpl; -import org.apache.tuscany.das.rdb.impl.InsertCommandImpl; -import org.apache.tuscany.das.rdb.impl.WriteCommandImpl; - -import commonj.sdo.DataObject; - -public class CudGenerator { - - private static final UpdateGenerator updateGenerator = UpdateGenerator.instance; - - private static final InsertGenerator insertGenerator = InsertGenerator.instance; - - private static final DeleteGenerator deleteGenerator = DeleteGenerator.instance; - - public DeleteCommandImpl getDeleteCommand(Table t) { - return deleteGenerator.getDeleteCommand(t); - } - - public Collection getDeleteParameters(Table table) { - return deleteGenerator.getDeleteParameters(table); - } - - public Collection getCreateParameters(MappingWrapper mapping, DataObject changedObject, Table table) { - return insertGenerator.getInsertParameters(mapping, changedObject, table); - } - - public InsertCommandImpl getInsertCommand(MappingWrapper mapping, DataObject changedObject, - Table table) { - return insertGenerator.getInsertCommand(mapping, changedObject, table); - } - - public WriteCommandImpl getUpdateCommand(MappingWrapper mapping, - DataObject changedObject, Table table) { - return updateGenerator.getUpdateCommand(mapping, changedObject, table); - } - - public Collection getUpdateParameters(DataObject changedObject, Table table) { - return updateGenerator.getUpdateParameters(changedObject, table); - } - -} - diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/DeleteGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/DeleteGenerator.java deleted file mode 100644 index c2d312b56d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/DeleteGenerator.java +++ /dev/null @@ -1,98 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.impl.DeleteCommandImpl; -import org.apache.tuscany.das.rdb.impl.ParameterImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -public class DeleteGenerator { - - public static final DeleteGenerator instance = new DeleteGenerator(); - - private static final boolean debug = false; - - public DeleteGenerator() { - super(); - } - - public String getDeleteStatement(Table t) { - TableWrapper table = new TableWrapper(t); - - StringBuffer statement = new StringBuffer(); - statement.append("delete from "); - statement.append(t.getName()); - statement.append(" where "); - - Iterator names = table.getPrimaryKeyNames().iterator(); - Iterator properties = table.getPrimaryKeyProperties().iterator(); - while (names.hasNext() && properties.hasNext()) { - String name = (String) names.next(); - statement.append(name); - statement.append(" = ?"); - if (names.hasNext() && properties.hasNext()) - statement.append(" and "); - } - - DebugUtil.debugln(getClass(), debug, statement.toString()); - return statement.toString(); - } - - public Collection getDeleteParameters(Table table) { - TableWrapper wrapper = new TableWrapper(table); - return wrapper.getPrimaryKeyProperties(); - } - - public DeleteCommandImpl getDeleteCommand(Table t) { - DeleteCommandImpl deleteCommand = new DeleteCommandImpl(getDeleteStatement(t)); - - Iterator i = getDeleteParameters(t).iterator(); - for(int idx=1; i.hasNext(); idx++) { - String property = (String) i.next(); - Parameter p = new ParameterImpl(); - p.setName(property); - p.setType(SDODataTypes.OBJECT); - p.setConverter(getConverter(t, property)); - p.setIndex(idx); - deleteCommand.addParameter(p); - } - return deleteCommand; - } - - private Converter getConverter(Table t, String name) { - TableWrapper tw = new TableWrapper(t); - String converter = tw.getConverter(name); - if ( converter != null ) { - try { - return (Converter) Class.forName(converter).newInstance(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - return null; - } - -} - diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java deleted file mode 100644 index 9e324e2dd3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java +++ /dev/null @@ -1,164 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.RelationshipWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.impl.InsertCommandImpl; -import org.apache.tuscany.das.rdb.impl.ParameterImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -public class InsertGenerator { - - public static final InsertGenerator instance = new InsertGenerator(); - - private static final boolean debug = false; - - public InsertGenerator() { - super(); - } - - public InsertCommandImpl getInsertCommand(MappingWrapper config, - DataObject changedObject, Table t) { - ArrayList parameters = new ArrayList(); - TableWrapper table = new TableWrapper(t); - StringBuffer statement = new StringBuffer("insert into "); - statement.append(t.getName()); - - Iterator i = getAttributeProperties(changedObject, config).iterator(); - - ArrayList attributes = new ArrayList(); - while (i.hasNext()) { - Property attr = (Property) i.next(); - if (!table.isGeneratedColumnProperty(attr.getName())) { - attributes.add(attr.getName()); - parameters.add(changedObject.getType().getProperty( - attr.getName())); - } - } - - statement.append("("); - Iterator attrs = attributes.iterator(); - while (attrs.hasNext()) { - String name = (String) attrs.next(); - statement.append(""); - statement.append(name); - if (attrs.hasNext()) - statement.append(", "); - else - statement.append(")"); - } - - statement.append(" values ("); - for (int idx = 1; idx <= attributes.size(); idx++) { - statement.append('?'); - if (idx < attributes.size()) - statement.append(", "); - else - statement.append(")"); - } - - InsertCommandImpl cmd = new InsertCommandImpl(statement.toString()); - Iterator params = parameters.iterator(); - for (int idx = 1; params.hasNext(); idx++) { - Property property = (Property) params.next(); - Parameter p = new ParameterImpl(); - p.setName(property.getName()); - p.setType(property.getType()); - p.setConverter(getConverter(table, property.getName())); - p.setIndex(idx); - cmd.addParameter(p); - - } - DebugUtil.debugln(getClass(), debug, statement.toString()); - return cmd; - - } - - private Converter getConverter(TableWrapper tw, String name) { - String converter = tw.getConverter(name); - if ( converter != null ) { - try { - return (Converter) Class.forName(converter).newInstance(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - return null; - } - - private List getAttributeProperties(DataObject obj, MappingWrapper config) { - ArrayList fields = new ArrayList(); - Iterator i = obj.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - if (p.getType().isDataType()) { - if (obj.isSet(p)) - fields.add(p); - } else { - if (!p.isMany() && obj.isSet(p)) { - Relationship relationship = config.getRelationshipByName(p - .getOpposite().getName()); - - RelationshipWrapper r = new RelationshipWrapper( - relationship); - Iterator keys = r.getForeignKeys().iterator(); - while (keys.hasNext()) { - String key = (String) keys.next(); - Property keyProp = obj.getType().getProperty(key); - fields.add(keyProp); - } - - } - } - } - - return fields; - - } - - public Collection getInsertParameters(MappingWrapper config, - DataObject changedObject, Table table) { - ArrayList parameters = new ArrayList(); - TableWrapper wrapper = new TableWrapper(table); - - Iterator i = getAttributeProperties(changedObject, config).iterator(); - - while (i.hasNext()) { - Property attr = (Property) i.next(); - if (!wrapper.isGeneratedColumnProperty(attr.getName())) - parameters.add(changedObject.getType().getProperty( - attr.getName())); - } - - return parameters; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java deleted file mode 100644 index f22b352f51..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java +++ /dev/null @@ -1,206 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.RelationshipWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.impl.OptimisticWriteCommandImpl; -import org.apache.tuscany.das.rdb.impl.ParameterImpl; -import org.apache.tuscany.das.rdb.impl.UpdateCommandImpl; -import org.apache.tuscany.das.rdb.impl.WriteCommandImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; - -public class UpdateGenerator { - - private boolean debug = false; - - public static UpdateGenerator instance = new UpdateGenerator(); - - public UpdateGenerator() { - super(); - } - - public WriteCommandImpl getUpdateCommand(MappingWrapper mapping, DataObject changedObject, Table table) { - ArrayList parameters = new ArrayList(); - Type type = changedObject.getType(); - TableWrapper t = new TableWrapper(table); - StringBuffer statement = new StringBuffer("update "); - statement.append(table.getName()); - statement.append(" set "); - - - ChangeSummary summary = changedObject.getDataGraph().getChangeSummary(); - Iterator i = getChangedFields(mapping, summary, changedObject).iterator(); - - while (i.hasNext()) { - Property attr = (Property) i.next(); - Column c = t.getColumnByPropertyName(attr.getName()); - if ((c != null) && (c.isCollision() || c.isPrimaryKey())) { - // get rid of comma if OCC or PK is last field - if (!i.hasNext()) { - statement - .delete(statement.length() - 2, statement.length()); - } - } else { - parameters.add(attr); - statement.append(c == null ? attr.getName() : c.getName()); - statement.append(" = ?"); - if (i.hasNext()) - statement.append(", "); - } - } - - statement.append(" where "); - - Iterator names = t.getPrimaryKeyNames().iterator(); - Iterator properties = t.getPrimaryKeyProperties().iterator(); - while (names.hasNext() && properties.hasNext()) { - String name = (String) names.next(); - String property = (String) properties.next(); - statement.append(name); - statement.append(" = ?"); - if (names.hasNext() && properties.hasNext()) - statement.append(" and "); - parameters.add(type.getProperty(property)); - } - - if (t.getCollisionColumn() != null) { - statement.append(" and "); - statement.append(t.getCollisionColumn().getName()); - statement.append(" = ?"); - parameters.add(type.getProperty(t.getCollisionColumnPropertyName())); - } - - - WriteCommandImpl updateCommand; - if ( t.getCollisionColumn() != null ) - updateCommand = new OptimisticWriteCommandImpl(statement.toString()); - else - updateCommand = new UpdateCommandImpl(statement.toString()); - - Iterator params = parameters.iterator(); - for (int idx = 1; params.hasNext(); idx++ ) { - Property p = (Property)params.next(); - Parameter param = new ParameterImpl(); - param.setName(p.getName()); - param.setType(p.getType()); - param.setConverter(getConverter(t, p.getName())); - param.setIndex(idx); - updateCommand.addParameter(param); - } - DebugUtil.debugln(getClass(), debug, statement.toString()); - return updateCommand; - } - - private List getAttributeProperties(DataObject obj) { - ArrayList fields = new ArrayList(); - Iterator i = obj.getType().getProperties().iterator(); - while ( i.hasNext() ) { - Property p = (Property) i.next(); - if ( p.getType().isDataType()) - fields.add(p); - } - return fields; - } - - - private List getChangedFields(MappingWrapper mapping, ChangeSummary summary, DataObject obj) { - ArrayList changes = new ArrayList(); - Iterator i = summary.getOldValues(obj).iterator(); - while (i.hasNext()) { - ChangeSummary.Setting setting = (ChangeSummary.Setting) i.next(); - if (setting.getProperty().getType().isDataType()) { - changes.add(setting.getProperty()); - } else { - Property ref = setting.getProperty(); - if ( !ref.isMany() ) { - RelationshipWrapper r = new RelationshipWrapper(mapping.getRelationshipByName(ref.getOpposite().getName())); - Iterator keys = r.getForeignKeys().iterator(); - while ( keys.hasNext()) { - String key = (String) keys.next(); - Property p = obj.getType().getProperty(key); - changes.add(p); - } - } - - } - } - return changes; - } - - - private Converter getConverter(TableWrapper tw, String name) { - String converter = tw.getConverter(name); - if ( converter != null ) { - try { - return (Converter) Class.forName(converter).newInstance(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - return null; - } - - public Collection getUpdateParameters(DataObject changedObject, Table table) { - Type type = changedObject.getType(); - TableWrapper wrapper = new TableWrapper(table); - Collection pkNames = wrapper.getPrimaryKeyProperties(); - ArrayList parameters = new ArrayList(); - ArrayList pkParams = new ArrayList(); - - Iterator i = getAttributeProperties(changedObject).iterator(); - while (i.hasNext()) { - Property attr = (Property) i.next(); - String field = attr.getName(); - - Parameter p = getParameter(wrapper, type.getProperty(field)); - if (pkNames.contains(field)) { - pkParams.add(p); - } else { - parameters.add(p); - } - } - parameters.addAll(pkParams); - return parameters; - - } - - private Parameter getParameter(TableWrapper wrapper, Property property) { - Parameter param = new ParameterImpl(); - param.setName(property.getName()); - param.setType(property.getType()); - param.setConverter(getConverter(wrapper, property.getName())); - - return param; - } -} - diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java deleted file mode 100644 index 2d58c0f269..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; - -public class DataObjectMaker { - - private final DataObject rootObject; - - private boolean debug = false; - - public DataObjectMaker(DataObject root) { - this.rootObject = root; - } - - /** - * @param tableData - * @return - */ - public DataObject createAndAddDataObject(TableData tableData, - ResultMetadata resultMetadata) { - // Get a Type from the package and create a standalone DataObject - - DebugUtil.debugln(getClass(), this.debug, "Looking for Type for " - + tableData.getTableName()); - - Type tableClass = findTableTypeByPropertyName(tableData.getTableName()); - - if (tableClass == null) - throw new RuntimeException("An SDO Type with name " - + tableData.getTableName() + " was not found"); - - DataObject obj = DataFactory.INSTANCE.create(tableClass); - - // Now, check to see if the root data object has a containment reference - // to this EClass. If so, add it to the graph. If not, it will be taken - // care - // of when we process relationships - - Iterator i = this.rootObject.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - - if (p.isContainment() && p.getType().equals(tableClass)) { - if (p.isMany()) - rootObject.getList(p).add(obj); - // TODO This was a performance optimization for EMF in SDO 1.1, - // check to see if there is - // something equivalent in SDO 2.0 - // ((InternalEList) this.dataGraph.eGet(ref)).addUnique(obj); - else - this.rootObject.set(p, obj); - } - - } - - Iterator columnNames = resultMetadata.getColumnNames( - tableData.getTableName()).iterator(); - while (columnNames.hasNext()) { - String columnName = (String) columnNames.next(); - DataObject dataObject = (DataObject) obj; - Property p = findProperty(dataObject.getType(), columnName); - Object value = tableData.getColumnData(columnName); - - dataObject.set(p, value); - } - - return obj; - } - - // temporary, ignoring case - private Property findProperty(Type type, String columnName) { - Iterator properties = type.getProperties().iterator(); - while (properties.hasNext()) { - Property p = (Property) properties.next(); - if (columnName.equalsIgnoreCase(p.getName())) - return p; - } - return null; - } - - private Type findTableTypeByPropertyName(String tableName) { - Iterator i = rootObject.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - // System.out.println(p.getType().getName()); - if (tableName.equals(p.getType().getName())) - return p.getType(); - } - - return null; - } - - private Type findTableTypeByRootReference(String refName) { - return rootObject.getProperty(refName).getType(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DefaultConverter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DefaultConverter.java deleted file mode 100644 index 54c536d95c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DefaultConverter.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.Blob; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.Converter; - - -public class DefaultConverter implements Converter { - - public DefaultConverter() { - super(); - } - - public Object getColumnValue(Object data) { - return data; - } - - public Object getPropertyValue(Object data) { -// if (type.isInstance(data)) -// return data; -// -// if ( data == null ) -// return null; -// -// String name = type.getInstanceClass().getName(); -// if (name == "java.lang.Byte" || name == "byte") { -// return new Byte(data.toString()); -// } -// -// else if (name == "java.lang.Double" || name == "double") { -// return new Double(data.toString()); -// } -// -// else if (name == "java.lang.Float" || name == "float") { -// return new Float(data.toString()); -// } -// -// else if (name == "java.lang.Integer" || name == "int") { -// return new Integer(data.toString()); -// } -// -// else if (name == "java.lang.Long" || name == "long") { -// return new Long(data.toString()); -// } -// -// else if (name == "java.lang.Short" || name == "short") { -// return new Short(data.toString()); -// } -// -// else if (name == "java.lang.String") { -// return String.valueOf(data.toString()); -// } - - if ( data instanceof Blob ) { - Blob b = (Blob) data; - try { - return b.getBytes(1, (int)b.length()); - } catch (SQLException e) { - throw new RuntimeException(e); - } - } else { - return data; - } - - - -// else { -// -// throw new IllegalArgumentException("The database value of type " -// + data.getClass().getName() + " must be converted to type " -// + type.getInstanceClass().getName()); -// } - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java deleted file mode 100644 index e869c31bee..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.graphbuilder.schema.ESchemaMaker; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - - -/** - */ -public class GraphBuilderMetadata { - - private Config mappingModel; - private final Collection resultSets = new ArrayList(); - private boolean debug = false; - private Type schema; - - - public GraphBuilderMetadata(Collection results, Type schema, Config model, ResultSetShape shape) throws SQLException { - this.mappingModel = model; - this.schema = schema; - - Iterator i = results.iterator(); - while (i.hasNext()) { - ResultSet rs = (ResultSet) i.next(); - ResultMetadata resultMetadata = new ResultMetadata(rs, mappingModel, shape); - resultSets.add(resultMetadata); - } - - DebugUtil.debugln(getClass(), debug, "Mapping model: " + mappingModel); - } - - - public Collection getResultMetadata() { - return this.resultSets; - } - - - public boolean hasMappingModel() { - return mappingModel == null ? false : true; - } - - - /** - * @return - */ - - public Collection getRelationships() { - if (!hasMappingModel()) { - DebugUtil.debugln(getClass(), debug, "No relationships to return"); - return Collections.EMPTY_LIST; - } - - return mappingModel.getRelationship(); - } - - - /** - * @return - */ - public Type getSchema() { - if ( this.schema == null ) { - ESchemaMaker schemaMaker = new ESchemaMaker(this); - return schemaMaker.createESchema(); - } else { - return this.schema; - } - } - - public Config getMapping() { - return this.mappingModel; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java deleted file mode 100644 index 142aee5c60..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - - - -/** - * - * Used to store and look up table objects based on primary key - * This could be a lot more efficient if we could use LinkedHashMap from JDK 1.4 - */ -public class MultiTableRegistry implements TableRegistry { - - private HashMap tableNameMap; - private HashMap tableValueMap; - private boolean debug = false; - - - public MultiTableRegistry() { - tableNameMap = new HashMap(); - tableValueMap = new HashMap(); - } - - - - /** - * Get the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @return EDataObject - */ - public DataObject get(String tableName, List primaryKey) { - if ( debug ) { - DebugUtil.debugln(getClass(), debug, "Looking for table " + tableName + " with PK " + primaryKey); - DebugUtil.debugln(getClass(), debug, ("\tReturning " + getPkMap(tableName).get(primaryKey))); - } - return (DataObject) getPkMap(tableName).get(primaryKey); - } - - /** - * Add the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @param value - */ - public void put(String tableName, List primaryKey, DataObject value) { - if ( getPkMap(tableName).put(primaryKey, value) == null ) - getCreateValueList(tableName).add(value); - } - - /** - * Get the HashMap that contains the primary key to table object - * mappings. - * @param tableName - * @return HashMap - */ - private HashMap getPkMap(String tableName) { - HashMap pkMap = (HashMap)tableNameMap.get(tableName); - if ( pkMap == null ) { - pkMap = new HashMap(); - tableNameMap.put(tableName, pkMap); - } - return pkMap; - } - - private List getCreateValueList(String tableName) { - List values = (List) tableValueMap.get(tableName); - if ( values == null ) { - values = new ArrayList(); - tableValueMap.put(tableName, values); - } - return values; - } - - - - public boolean contains(String tableName, List primaryKey) { - return get(tableName,primaryKey) == null ? false : true; - - } - - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java deleted file mode 100644 index 42ac10eef6..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - -public class ResultMetadata { - - private HashMap tableToColumnMap = new HashMap(); - - private ArrayList tablePropertyNames = new ArrayList(); - - private ArrayList columnPropertyNames = new ArrayList(); - - private final ResultSet resultSet; - - private final ResultSetShape resultSetShape; - - private final MappingWrapper mappingWrapper; - - private Converter[] converters; - - private static boolean debug = false; - - public ResultMetadata(ResultSet rs, Config model, ResultSetShape shape) - throws SQLException { - debug("Creating new ResultMetadata with mapping model " + model); - this.resultSet = rs; - this.mappingWrapper = new MappingWrapper(model); - - if (shape == null) - this.resultSetShape = new ResultSetShape(rs.getMetaData()); - else - this.resultSetShape = shape; - - this.converters = new Converter[resultSetShape.getColumnCount()]; - - for (int i = 1; i <= resultSetShape.getColumnCount(); i++) { - String tableName = resultSetShape.getTableName(i); - - String tableProperty = mappingWrapper - .getTablePropertyName(tableName); - String columnProperty = mappingWrapper.getColumnPropertyName( - tableName, resultSetShape.getColumnName(i)); - String converter = mappingWrapper.getConverter(tableName, - resultSetShape.getColumnName(i)); - if (converter != null) { - try { - Converter convInstance = (Converter) Class.forName( - converter).newInstance(); - converters[i - 1] = convInstance; - } catch (Exception ex) { - throw new RuntimeException(ex); - } - - } else { - // TODO make static - converters[i - 1] = new DefaultConverter(); - } - DebugUtil.debugln(getClass(), debug, "Adding table/column: " - + tableProperty + "/" + columnProperty); - tablePropertyNames.add(tableProperty); - columnPropertyNames.add(columnProperty); - - Collection columns = (Collection) tableToColumnMap - .get(tableProperty); - if (columns == null) - columns = new ArrayList(); - columns.add(columnProperty); - tableToColumnMap.put(tableProperty, columns); - } - - // Add any tables defined in the model but not included in the ResultSet - // to the list of propertyNames - if (model != null) { - Iterator tablesFromModel = model.getTable().iterator(); - while (tablesFromModel.hasNext()) { - TableWrapper t = new TableWrapper((Table) tablesFromModel - .next()); - if (tableToColumnMap.get(t.getPropertyName()) == null) - tableToColumnMap.put(t.getPropertyName(), - Collections.EMPTY_LIST); - } - } - - if (debug) { - DebugUtil.debugln(getClass(), debug, toString()); - DebugUtil - .debugln(getClass(), debug, this.resultSetShape.toString()); - } - - } - - private void debug(Object string) { - if (debug) - DebugUtil.debugln(getClass(), debug, string); - } - - public Collection getColumnNames() { - return columnPropertyNames; - } - - public String getColumnPropertyName(int i) { - return (String) columnPropertyNames.get(i - 1); - } - - public String getDatabaseColumnName(int i) { - return resultSetShape.getColumnName(i); - } - - public String getTableName(String columnName) { - return (String) tablePropertyNames.get(columnPropertyNames - .indexOf(columnName)); - } - - public int getTableSize(String tableName) { - return ((Collection) tableToColumnMap.get(tableName)).size(); - } - - public Type getDataType(String columnName) { - return resultSetShape.getColumnType(columnPropertyNames - .indexOf(columnName)); - } - - public String getTablePropertyName(int i) { - return (String) tablePropertyNames.get(i - 1); - } - - public Collection getAllTablePropertyNames() { - return tableToColumnMap.keySet(); - } - - public String toString() { - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (Table Names: "); - Iterator i = tablePropertyNames.iterator(); - while (i.hasNext()) { - String tableName = (String) i.next(); - result.append(' '); - result.append(tableName); - result.append(','); - } - - result.append(" columnNames: "); - - i = columnPropertyNames.iterator(); - while (i.hasNext()) { - String columnName = (String) i.next(); - result.append(' '); - result.append(columnName); - result.append(','); - } - - result.append(" mappingModel: "); - result.append(this.mappingWrapper.getConfig()); - - result.append(" resultSet: "); - result.append(resultSet); - - result.append(" resultSetSize: "); - result.append(resultSetShape.getColumnCount()); - result.append(')'); - return result.toString(); - - } - - /** - * @return - */ - public int getNumberOfTables() { - return tableToColumnMap.keySet().size(); - } - - /** - * Return whether the column at the given position is part of a primary key. - * If we don't have this information, we assume every column is a primary - * key. This results in uniqueness checks using all columns in a table. - * - * @param i - * @return - */ - public boolean isPKColumn(int i) { - if (debug) { - DebugUtil.debugln(getClass(), debug, "Checking to see if " - + getColumnPropertyName(i) + " is a PK column in " - + getTablePropertyName(i)); - } - if (!hasMappingModel()) { - if (debug) - DebugUtil - .debugln(getClass(), debug, - "No mapping model exists, all columns will be considered PK columns"); - return true; - } else { - Table t = mappingWrapper.getTable(getTablePropertyName(i)); - if (t == null) - return true; - Column c = mappingWrapper.getColumn(t, getDatabaseColumnName(i)); - - if (c == null) - return false; - - if (c.isPrimaryKey()) - return true; - } - return false; - } - - public boolean hasMappingModel() { - return mappingWrapper.getConfig() == null ? false : true; - } - - /** - * @param i - * @return - */ - public Type getDataType(int i) { - return resultSetShape.getColumnType(i); - } - - /** - * @param tableName - * @return - */ - public Collection getColumnNames(String tableName) { - return (Collection) tableToColumnMap.get(tableName); - } - - public ResultSet getResultSet() { - return this.resultSet; - } - - public int getResultSetSize() { - return resultSetShape.getColumnCount(); - } - - public boolean isRecursive() { - return mappingWrapper.hasRecursiveRelationships(); - } - - public Converter getConverter(int i) { - return converters[i - 1]; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java deleted file mode 100644 index 8ccc0aee12..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - -/** - * - * A ResultSetProcessor is used to transform the data in a ResultSet into a set - * of inter-related EDataObjects. - */ -public class ResultSetProcessor { - - private TableRegistry registry; - - private GraphBuilderMetadata metadata; - - private boolean debug = false; - - private final DataObjectMaker doMaker; - - public ResultSetProcessor(DataObject g, GraphBuilderMetadata gbmd) { - - this.metadata = gbmd; - if (metadata.getRelationships().size() == 0) - registry = new SingleTableRegistry(); - else - registry = new MultiTableRegistry(); - - doMaker = new DataObjectMaker(g); - - debug(metadata); - - } - - private void debug(Object output) { - DebugUtil.debugln(getClass(), debug, output); - } - - /** - * Process the ResultSet. For each row in the ResultSet, a - * - * @link ResultSetRow object will be created to represent the row as a set - * of EDataObjects. Then, the relevant relationships will be - * constructed between each object in the - * @link ResultSetRow. - * - * @param rs - * The ResultSet - */ - public void processResults(int start, int end) throws SQLException { - - Iterator i = metadata.getResultMetadata().iterator(); - while ( i.hasNext()) { - ResultMetadata resultMetadata = (ResultMetadata)i.next(); - ResultSet results = resultMetadata.getResultSet(); - - processResultSet(results, resultMetadata, start, end); - - //TODO These statements HAVE to be closed or we will have major problems - //results.getStatement().close(); - results.close(); - } - - } - - - private void processResultSet(ResultSet rs, ResultMetadata rsMetadata, - int start, int end) throws SQLException { - - if ( rs.getType() == ResultSet.TYPE_FORWARD_ONLY) { - while (rs.next() && start < end) { - ResultSetRow rsr = new ResultSetRow(rs, rsMetadata); - addRowToGraph(rsr, rsMetadata); - ++start; - } - } else { - while (rs.absolute(start) && start < end) { - ResultSetRow rsr = new ResultSetRow(rs, rsMetadata); - addRowToGraph(rsr, rsMetadata); - ++start; - } - } - } - - /** - * @param row - * @param resultMetadata - */ - private void addRowToGraph(ResultSetRow row, ResultMetadata resultMetadata) { - RowObjects tableObjects = new RowObjects(metadata, registry); - Iterator tables = row.getAllTableData().iterator(); - while (tables.hasNext()) { - TableData rawDataFromRow = (TableData) tables.next(); - - if ( (resultMetadata.hasMappingModel()) && (!rawDataFromRow.hasValidPrimaryKey() ) ) - continue; - - String tableName = rawDataFromRow.getTableName(); - DataObject tableObject = registry.get(tableName, rawDataFromRow - .getPrimaryKeyValues()); - if (tableObject == null) { - tableObject = doMaker.createAndAddDataObject(rawDataFromRow, resultMetadata); - - debug("Putting table " + tableName + " with PK " + rawDataFromRow.getPrimaryKeyValues() + " into registry"); - - registry.put(tableName, rawDataFromRow.getPrimaryKeyValues(), - tableObject); - } - tableObjects.put(tableName, tableObject); - } - - tableObjects.processRelationships(); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetRow.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetRow.java deleted file mode 100644 index f68f48fc06..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetRow.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -/** - * - * A ResultSetRow is used to transform a single row of a ResultSet into a set of - * EDataObjects. - */ -public class ResultSetRow { - - private final ResultMetadata metadata; - - private HashMap tableMap = new HashMap(); - - private ArrayList allTableData; - - private boolean debug = false; - - /** - * Method ResultSetRow. - * - * @param rs - * A ResultSet positioned on the desired row - * @param ePackage - * The package used to create EDataObjects - */ - public ResultSetRow(ResultSet rs, ResultMetadata m) throws SQLException { - this.metadata = m; - if (m.isRecursive()) - processRecursiveRow(rs); - else - processRow(rs); - } - - /** - * Processes a single row in the ResultSet Method processRow. - * - * @param rs - */ - private void processRow(ResultSet rs) throws SQLException { - - DebugUtil.debugln(getClass(), debug, ""); - for (int i = 1; i <= metadata.getResultSetSize(); i++) { - Object data = getObject(rs, i); - - TableData table = getRawData(metadata.getTablePropertyName(i)); - DebugUtil.debugln(getClass(), debug, "Adding column: " - + metadata.getColumnPropertyName(i) + "\tValue: " + data - + "\tTable: " + metadata.getTablePropertyName(i)); - table.addData(metadata.getColumnPropertyName(i), metadata - .isPKColumn(i), data); - } - - } - - public void processRecursiveRow(ResultSet rs) throws SQLException { - this.allTableData = new ArrayList(); - int i = 1; - DebugUtil.debugln(getClass(), debug, ""); - while (i <= metadata.getResultSetSize()) { - DebugUtil.debugln(getClass(), debug, ""); - TableData table = new TableData(metadata.getTablePropertyName(i)); - this.allTableData.add(table); - - while ( (i <= metadata.getResultSetSize()) && (metadata.isPKColumn(i))) { - Object data = getObject(rs, i); - DebugUtil.debugln(getClass(), debug, "Adding column: " - + metadata.getColumnPropertyName(i) + "\tValue: " + data - + "\tTable: " + metadata.getTablePropertyName(i)); - table.addData(metadata.getColumnPropertyName(i), true, data); - i++; - } - - while ( (i <= metadata.getResultSetSize()) && - (!metadata.isPKColumn(i))) { - Object data = getObject(rs, i); - DebugUtil.debugln(getClass(), debug, "Adding column: " - + metadata.getColumnPropertyName(i) + "\tValue: " + data - + "\tTable: " + metadata.getTablePropertyName(i)); - table.addData(metadata.getColumnPropertyName(i), false, data); - i++; - } - } - } - - /** - * @param rs - * @param metadata - * @param i - * @return - */ - private Object getObject(ResultSet rs, int i) - throws SQLException { - - Object data = rs.getObject(i); - - if (rs.wasNull()) - return null; - else - return metadata.getConverter(i).getPropertyValue(data); - } - - /** - * Returns a HashMap that holds data for the specified table - * - * @param tableName - * The name of the table - * @return HashMap - */ - public TableData getTable(String tableName) { - return (TableData) tableMap.get(tableName); - } - - /** - * Returns a HashMap that holds data for the specified table If the HashMap - * doesn't exist, it will be created. This is used internally to build the - * ResultSetRow, whereas getTable is used externally to retrieve existing - * table data. - * - * @param tableName - * The name of the table - * @return HashMap - */ - private TableData getRawData(String tableName) { - - TableData table = (TableData) tableMap.get(tableName); - - if (table == null) { - table = new TableData(tableName); - tableMap.put(tableName, table); - } - - return table; - } - - public ArrayList getAllTableData() { - if ( this.allTableData == null ) { - this.allTableData = new ArrayList(); - this.allTableData.addAll(tableMap.values()); - } - DebugUtil.debugln(getClass(), debug, allTableData); - - return this.allTableData; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java deleted file mode 100644 index f0df0ab7c3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java +++ /dev/null @@ -1,140 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - - -public class RowObjects { - - private HashMap objectsByTableName; - - private ArrayList tableObjects; - - private static final boolean debug = false; - - private final GraphBuilderMetadata metadata; - - private final TableRegistry registry; - - public RowObjects(GraphBuilderMetadata metadata, TableRegistry registry) { - objectsByTableName = new HashMap(); - tableObjects = new ArrayList(); - this.metadata = metadata; - this.registry = registry; - } - - public void put(String key, DataObject value) { - objectsByTableName.put(key, value); - tableObjects.add(value); - } - - public DataObject get(String tablePropertyName) { - return (DataObject) objectsByTableName.get(tablePropertyName); - } - - void processRelationships() { - MappingWrapper wrapper = new MappingWrapper(metadata.getMapping()); - if (wrapper.hasRecursiveRelationships()) { - processRecursiveRelationships(wrapper); - return; - } - - Iterator i = metadata.getRelationships().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - - - DataObject parentTable = get(wrapper - .getTablePropertyName(r.getPrimaryKeyTable())); - DataObject childTable = get(wrapper - .getTablePropertyName(r.getForeignKeyTable())); - - DebugUtil.debugln(getClass(), debug, "Parent table: " + parentTable); - DebugUtil.debugln(getClass(), debug, "Child table: " + childTable); - - if ((parentTable == null) || (childTable == null)) - continue; - - Property p = parentTable.getType().getProperty(r.getName()); - setOrAdd(parentTable, childTable, p); - - } - } - - - - private void processRecursiveRelationships(MappingWrapper wrapper) { - Iterator i = tableObjects.iterator(); - while (i.hasNext()) { - DataObject table = (DataObject) i.next(); - - Iterator relationships = wrapper.getRelationshipsByChildTable(table.getType().getName()).iterator(); - while ( relationships.hasNext() ) { - Relationship r = (Relationship) relationships.next(); - - DataObject parentTable = findParentTable(table, r, wrapper); - - if (parentTable == null) - continue; - - Property p = parentTable.getType().getProperty(r.getName()); - setOrAdd(parentTable, table, p); - } - - } - } - - private void setOrAdd(DataObject parent, DataObject child, Property p) { - if (p.isMany()) { - parent.getList(p).add(child); - } else { - parent.set(p, child); - } - } - - private DataObject findParentTable(DataObject childTable, - Relationship r, MappingWrapper wrapper) { - - ArrayList fkValue = new ArrayList(); - Iterator keyPairs = r.getKeyPair().iterator(); - while (keyPairs.hasNext()) { - KeyPair pair = (KeyPair) keyPairs.next(); - String childProperty = wrapper.getColumnPropertyName(r.getPrimaryKeyTable(), pair.getForeignKeyColumn()); - - Property p = childTable.getType().getProperty(childProperty); - fkValue.add(childTable.get(p)); - } - - DebugUtil.debugln(getClass(), debug, "Trying to find parent of " + r.getForeignKeyTable() + " with FK " - + fkValue); - DataObject parentTable = registry.get(r.getPrimaryKeyTable(), fkValue); - DebugUtil.debugln(getClass(), debug, "Parent table from registry: " + parentTable); - return parentTable; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java deleted file mode 100644 index f00ef2770d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.List; - -import commonj.sdo.DataObject; - -/** - */ -public class SingleTableRegistry implements TableRegistry { - - //private HashMap<List,DataObject> values = new HashMap<List,DataObject>(); - - public SingleTableRegistry() { - // Empty Constructor - } - - /* (non-Javadoc) - * @see com.ibm.ws.sdo.mediator.jdbc.graphbuilder.impl.TableRegistry#get(java.lang.String, java.util.List) - */ - public DataObject get(String tableName, List primaryKey) { - return null; - } - - /* (non-Javadoc) - * @see com.ibm.ws.sdo.mediator.jdbc.graphbuilder.impl.TableRegistry#put(java.lang.String, java.util.List, java.lang.Object) - */ - public void put(String tableName, List primaryKey, DataObject value) { - // do nothing - - } - - public boolean contains(String name, List list) { - return false; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableData.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableData.java deleted file mode 100644 index 48b6dc0187..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableData.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -/** - * - */ -public class TableData { - - private HashMap columnData = new HashMap(); - private ArrayList primaryKey = new ArrayList(); - private final String name; - private boolean hasValidPrimaryKey = true; - private static final boolean debug = false; - - public TableData(String tableName) { - DebugUtil.debugln(getClass(), debug, "Creating TableData for table " + tableName); - this.name = tableName; - } - - - public void addData(String columnName, boolean isPrimaryKeyColumn, Object data) { - DebugUtil.debugln(getClass(), debug, "Adding column " + columnName + " with value " + data); - columnData.put(columnName, data); - if ( isPrimaryKeyColumn ) { - if ( data == null ) { - DebugUtil.debugln(getClass(), debug, "Column " + columnName + " is a primary key column and is null"); - hasValidPrimaryKey = false; - } - primaryKey.add(data); - } - } - - public Object getColumnData(String columnName) { - return columnData.get(columnName); - } - - public String getTableName() { - return this.name; - } - - - /** - * @return - */ - public List getPrimaryKeyValues() { - return primaryKey; - } - - - public boolean hasValidPrimaryKey() { - return hasValidPrimaryKey; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java deleted file mode 100644 index 4b5a3677ae..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.List; - -import commonj.sdo.DataObject; - -/** - */ -public interface TableRegistry { - /** - * Get the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @return EDataObject - */ - public DataObject get(String tableName, List primaryKey); - - /** - * Add the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @param value - */ - public void put(String tableName, List primaryKey, DataObject value); - - public boolean contains(String name, List list); -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java deleted file mode 100644 index bb26ac51c3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.impl.AttributeImpl; -import org.apache.tuscany.sdo.impl.DataTypeImpl; - -import commonj.sdo.Type; - - -/** - * - * A helper used to create new EAttributes - */ -public class EAttributeMaker { - - private static EAttributeMaker maker; - - protected EAttributeMaker() { - // Empty Constructor - } - - /** - * Return an EAttributeMaker singleton - * @return EAttributeMaker - */ - public static EAttributeMaker singleton() { - if (maker == null) - maker = new EAttributeMaker(); - return maker; - } - - /** - * Create a new EAttribute with the specified name and type - * @param name The name of the new EAttribute - * @param type The type of the new EAttribute - * @return EAttribute - */ - public AttributeImpl createEAttribute(String name, Type type) { - - AttributeImpl attr = (AttributeImpl) getFactory().createAttribute(); - attr.setName(name); - attr.setEType((DataTypeImpl)type); - attr.setUnique(false); - - return attr; - } - - private SDOFactory getFactory() { - return SDOFactory.eINSTANCE; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java deleted file mode 100644 index 480f5d1bdd..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java +++ /dev/null @@ -1,131 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.impl.ClassImpl; -import org.apache.tuscany.sdo.impl.ReferenceImpl; - -import commonj.sdo.Type; - -/** - * A helper used to create EReferences - */ -public class EReferenceMaker { - - public EReferenceMaker() { - // Empty Constructor - } - - /** - * Create an EReference with the specified name, type, lower bound, upper bound - * and containment. - * @param name - * @param type - * @param lowerBound - * @param upperBound - * @param containment - * @return EReference - */ - public ReferenceImpl createReference(String name, Type type, int lowerBound, int upperBound, boolean containment, boolean changeable) { - ReferenceImpl ref = (ReferenceImpl) getFactory().createReference(); - ref.setName(name); - ref.setEType((ClassImpl)type); - ref.setLowerBound(lowerBound); - ref.setUpperBound(upperBound); - ref.setContainment(containment); - ref.setResolveProxies(false); - ref.setChangeable(changeable); - - return ref; - } - - public ReferenceImpl createReference(String name, Type type, int lowerBound, int upperBound, boolean containment) { - return createReference(name, type, lowerBound, upperBound, containment, true); - } - /** - * Create a one to many reference with the specified name, type, and containment - * @param name - * @param type - * @param containment - * @return - */ - public ReferenceImpl createOneToManyReference(String name, Type type, boolean containment) { - return createReference(name, type, 0, -1, containment); - } - - /** - * Create a one to many reference with the specified name and type - * @param name - * @param type - * @return EReference - */ - public ReferenceImpl createOneToManyReference(String name, Type type) { - return createOneToManyReference(name, type, false); - } - - /** - * Create a one to one reference with the specified name and type - * @param name - * @param type - * @return EReference - */ - public ReferenceImpl createOneToOneReference(String name, Type type) { - ReferenceImpl ref = createReference(name, type,0,1,false); - return ref; - } - - /** - * Create a many to one reference with the specified name and type - * @param name - * @param type - * @return EReference - */ - public ReferenceImpl createManyToOneReference(String name, Type type) { - return createReference(name,type,0,1,false); - } - - private SDOFactory getFactory() { - return SDOFactory.eINSTANCE; - } - - - /** - * @param r - * @param parent - * @param child - * @return - */ - public ReferenceImpl createReference(Relationship r, Type parent, Type child) { - if ( !r.isMany() ) { - ReferenceImpl ref = createOneToOneReference(r.getName(), child); - ReferenceImpl opp = createOneToOneReference(r.getName() + "_opposite", parent); - ref.setEOpposite(opp); - opp.setEOpposite(ref); - return ref; - } else { - ReferenceImpl ref = createOneToManyReference(r.getName(), child); - ReferenceImpl opp = createManyToOneReference(r.getName() + "_opposite", parent); - ref.setEOpposite(opp); - opp.setEOpposite(ref); - return ref; - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java deleted file mode 100644 index 5b1a300736..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java +++ /dev/null @@ -1,261 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.graphbuilder.impl.GraphBuilderMetadata; -import org.apache.tuscany.das.rdb.graphbuilder.impl.ResultMetadata; -import org.apache.tuscany.das.rdb.util.DebugUtil; -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.impl.AttributeImpl; -import org.apache.tuscany.sdo.impl.ClassImpl; -import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl; -import org.apache.tuscany.sdo.impl.ReferenceImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - -/** - * - * An ESchemaMaker is used to create an EMF Schema from an instance of JDBC - * Mediator Metadata. - * - */ -public class ESchemaMaker { - - private final GraphBuilderMetadata metadata; - - private EPackage dataGraphPackage; - - private final String nsPrefix; - - private final String pkgName; - - private boolean debug = false; - - /** - * Constructor for ESchemaMaker. Creates an EMF Schema based on the metadata - * passed in. - * - * @param metadata - */ - public ESchemaMaker(GraphBuilderMetadata metadata) { - this(metadata, null, null); - } - - /** - * Constructor for ESshemaMaker. Creates an EMF Schema based on the supplied - * metadata, namespace prefix, and package name - * - * @param metadata - * the metadata - * @param nsPrefix - * the namespace prefix - this affects the generated - * Factory/Package name - defaults to datagraph - * @param pkgName - * the package name - determines package name for generated code - - * defaults to datagraph - */ - public ESchemaMaker(GraphBuilderMetadata metadata, String nsPrefix, - String pkgName) { - if (nsPrefix == null) - nsPrefix = "datagraph"; - if (pkgName == null) - pkgName = "datagraph"; - - this.metadata = metadata; - this.nsPrefix = nsPrefix; - this.pkgName = pkgName; - - TypeHelper helper = TypeHelper.INSTANCE; - } - - /** - * Creates an EMF Schema by using the - * - * @link TableMaker and - * @link RelationshipMaker to transform - * @link Metadata elements into EMF Schema elements. - */ - - public Type createESchema() { - TypeHelper.INSTANCE.getType("commonj.sdo", "Integer"); - DataObjectUtil.initRuntime(); - SDOUtil.createDataGraph(); - - ClassImpl rootClass = (ClassImpl) SDOFactory.eINSTANCE.createClass(); - Type rootType = (Type) rootClass; - - rootClass.setName("DataGraphRoot"); - getEPackage().getEClassifiers().add(rootClass); - - EReferenceMaker refMaker = new EReferenceMaker(); - - Iterator iter = metadata.getResultMetadata().iterator(); - while (iter.hasNext()) { - - ResultMetadata resultMetadata = (ResultMetadata) iter.next(); - - Iterator names = resultMetadata.getAllTablePropertyNames() - .iterator(); - while (names.hasNext()) { - String tableName = (String) names.next(); - if (rootClass.getEStructuralFeature(tableName) == null) { - Type clazz = createType(tableName); - getEPackage().getEClassifiers().add(clazz); - ReferenceImpl ref = refMaker.createOneToManyReference( - tableName, clazz, true); - rootClass.getEStructuralFeatures().add(ref); - } - } - - for (int i = 1; i <= resultMetadata.getColumnNames().size(); i++) { - - ReferenceImpl ref = (ReferenceImpl) rootType - .getProperty(resultMetadata.getTablePropertyName(i)); - - if (ref == null) - throw new RuntimeException("Could not find table " - + resultMetadata.getTablePropertyName(i) - + " in the SDO model"); - EClass clazz = ref.getEReferenceType(); - String columnName = resultMetadata.getColumnPropertyName(i); - - if (clazz.getEStructuralFeature(columnName) == null) { - Type atype = (Type) resultMetadata.getDataType(i); - - // EDataType type = (EDataType) atype.getEClassifier(); - - AttributeImpl attr = getAttributeMaker().createEAttribute( - columnName, atype); - - DebugUtil.debugln(getClass(), debug, "Adding column " - + columnName + " to " - + resultMetadata.getTablePropertyName(i)); - clazz.getEStructuralFeatures().add(attr); - } - } - } - - if (metadata.hasMappingModel()) { - MappingWrapper wrapper = new MappingWrapper(metadata.getMapping()); - Iterator i = metadata.getRelationships().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - - EClass parent = (EClass) getEPackage().getEClassifier( - wrapper.getTablePropertyName(r.getPrimaryKeyTable())); - EClass child = (EClass) getEPackage().getEClassifier( - wrapper.getTablePropertyName(r.getForeignKeyTable())); - if (parent == null) { - throw new RuntimeException("The parent table (" - + r.getPrimaryKeyTable() + ") in relationship " - + r.getName() - + " was not found in the mapping information."); - } else if (child == null) { - throw new RuntimeException("The child table (" - + r.getForeignKeyTable() + ") in relationship " - + r.getName() - + " was not found in the mapping information."); - } - - ReferenceImpl ref = refMaker.createReference(r, (Type)parent, (Type)child); - - DebugUtil.debugln(getClass(), debug, "Adding reference: " - + ref.getName() + " to " + parent.getName()); - if (parent.getEStructuralFeature(ref.getName()) == null) - parent.getEStructuralFeatures().add(ref); - - if (child.getEStructuralFeature(ref.getEOpposite().getName()) == null) - child.getEStructuralFeatures().add(ref.getEOpposite()); - - } - - } - - // EcoreUtil.freeze(rootObject.getEPackage()); - - return (Type) rootClass; - } - - /** - * Create an EClass with the specified name - * - * @param name - * @return EClass - */ - protected Type createType(String name) { - ClassImpl ecl = (ClassImpl) SDOFactory.eINSTANCE.createClass(); - ecl.setName(name); - - return ecl; - } - - /** - * Get an EAttributeMaker singleton - * - * @return EAttributeMaker - */ - private EAttributeMaker getAttributeMaker() { - return EAttributeMaker.singleton(); - } - - - /** - * @return the EPackage for this schema - */ - public EPackage getEPackage() { - if (this.dataGraphPackage == null) - this.dataGraphPackage = createEPackage(); - return this.dataGraphPackage; - } - - /** - * Create the EPackage for this schema Uses the packageName and nsPrefix - * values set in the constructors The EPackage overrides the default - * EFactory so that DataObjects will be created using MapDataObjectImpl. - * - * @return the new EPackage - */ - protected EPackage createEPackage() { - - EPackage pkg = EcoreFactory.eINSTANCE.createEPackage(); - pkg.setName(pkgName); - pkg.setNsPrefix(nsPrefix); - pkg.setNsURI("datagraph.ecore"); - - pkg.setEFactoryInstance(new EFactoryImpl() { - public EObject basicCreate(EClass cls) { - EObject result = new DynamicDataObjectImpl(cls); - return result; - } - }); - - return pkg; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java deleted file mode 100644 index 3fcccf6fca..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import java.sql.Types; - -import org.apache.tuscany.sdo.SDOPackage; - -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - -/** - */ -public class ResultSetTypeMap { - - public static ResultSetTypeMap instance = new ResultSetTypeMap(); - - /** - * Constructor for ResultSetTypeMap. - */ - protected ResultSetTypeMap() { - // Empty Constructor - } - - /** - * These mappings taken primarily from "JDBC API and Tutorial and Reference" by - * Fisher, Ellis and Bruce. - * - * @param type - * @param isNullable - * @return - */ - public Type getEDataType(int type, boolean isNullable) { - - TypeHelper helper = TypeHelper.INSTANCE; - SDOPackage.eINSTANCE.eClass(); - switch (type) { - - case Types.CHAR: - case Types.VARCHAR: - case Types.LONGVARCHAR: - return helper.getType("commonj.sdo", "String"); - - case Types.NUMERIC: - case Types.DECIMAL: - return helper.getType("commonj.sdo", "Decimal"); - - case Types.BIT: - case Types.BOOLEAN: - if (isNullable) - return helper.getType("commonj.sdo", "Boolean"); - else - return helper.getType("commonj.sdo", "boolean"); - - case Types.TINYINT: - case Types.SMALLINT: - case Types.INTEGER: - if (isNullable) { - return helper.getType("commonj.sdo", "IntObject"); - } else - return helper.getType("commonj.sdo", "Int"); - - case Types.BIGINT: - if (isNullable) - return helper.getType("commonj.sdo", "Long"); - else - return helper.getType("commonj.sdo", "long"); - - case Types.REAL: - if (isNullable) - return helper.getType("commonj.sdo", "Real"); - else - return helper.getType("commonj.sdo", "real"); - - case Types.FLOAT: - case Types.DOUBLE: - if (isNullable) - return helper.getType("commonj.sdo", "Double"); - else - return helper.getType("commonj.sdo", "double"); - - case Types.BINARY: - case Types.VARBINARY: - case Types.LONGVARBINARY: - return helper.getType("commonj.sdo", "ByteArray"); - - case Types.DATE: - case Types.TIME: - case Types.TIMESTAMP: - return helper.getType("commonj.sdo", "Date"); - - case Types.CLOB: - return helper.getType("commonj.sdo", "Clob"); - - case Types.BLOB: - return helper.getType("commonj.sdo", "Blob"); - - case Types.ARRAY: - return helper.getType("commonj.sdo", "Array"); - - case Types.DISTINCT: - case Types.STRUCT: - case Types.REF: - case Types.DATALINK: - case Types.JAVA_OBJECT: - return helper.getType("commonj.sdo", "Object"); - - default: - return helper.getType("commonj.sdo", "Object"); - } - - } - - - public Type getType(int columnType, boolean b) { - return getEDataType(columnType, b); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ApplyChangesCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ApplyChangesCommandImpl.java deleted file mode 100644 index 6e92a5e6a2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ApplyChangesCommandImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; - -/** - * - */ -public class ApplyChangesCommandImpl implements ApplyChangesCommand { - - private ConnectionImpl dasConnection; - - private static final boolean debug = false; - - private ChangeSummarizer summarizer = new ChangeSummarizer(); - - public ApplyChangesCommandImpl() { - // Empty Constructor - } - - // IOException is recoverable, needs to be thrown - public ApplyChangesCommandImpl(InputStream mappingModel) throws IOException { - setMapping(mappingModel); - } - - public ApplyChangesCommandImpl(Config mappingModel){ - summarizer.setMapping(mappingModel); -//TODO - Really need to refactor the Command framework. ReadCommand and ApplychangesCommand should -// be using the same approach to set connection and should probably share the same initialization. -// if (mappingModel.getConnectionProperties() != null) -// setConnection(mappingModel.getConnectionProperties()); - } - - public void setConnection(Connection connection) { - setConnection(new ConnectionImpl(connection)); - } - - public void setConnection(Connection connection, boolean manageTransaction) { - ConnectionImpl c = new ConnectionImpl(connection); - c.setManageTransactions(manageTransaction); - setConnection(c); - } - - public void setConnection(ConnectionImpl connection) { - dasConnection = connection; - summarizer.setConnection(connection); - } - - public void setConnection(ConnectionProperties c) { - try { - Connection connection = null; - Class.forName(c.getDriverClassName()); - if (c.getDriverUserName() == null) - connection = DriverManager.getConnection(c.getDriverURL()); - else - connection = DriverManager.getConnection(c.getDriverURL(), c.getDriverUserName(), c.getDriverPassword()); - connection.setAutoCommit(false); - setConnection(connection); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - public void addCreateCommand(Type type, Command cmd) { - summarizer.addCreateCommand(type, cmd); - ((CommandImpl) cmd).setConnection(dasConnection); - } - - public void addUpdateCommand(Type type, Command cmd) { - // DebugUtil.debugln(getClass(), debug, "Adding update command for type - // " + type.getName()); - summarizer.addUpdateCommand(type, cmd); - ((CommandImpl) cmd).setConnection(dasConnection); - } - - public void addDeleteCommand(Type type, Command cmd) { - summarizer.addDeleteCommand(type, cmd); - ((CommandImpl) cmd).setConnection(dasConnection); - } - - public void execute(DataObject root) { - DebugUtil.debugln(getClass(), debug, "Executing ApplyChangesCmd"); - - if (dasConnection == null) - throw new RuntimeException("A connection must be provided"); - - if (!root.equals(root.getDataGraph().getRootObject())) - throw new RuntimeException("'root' argument must be the root of the datagraph"); - - Changes changes = summarizer.loadChanges(root); - - boolean success = false; - try { - changes.execute(); - success = true; - } finally { - if (success) - dasConnection.cleanUp(); - else - dasConnection.errorCleanUp(); - } - } - - public void setMapping(InputStream stream) throws IOException { - XMLHelper helper = XMLHelper.INSTANCE; - - ConfigPackageImpl impl = ConfigPackageImpl.eINSTANCE; - XMLDocument doc = helper.load(stream); - Config mapping = (Config) doc.getRootObject(); - - summarizer.setMapping(mapping); - if (mapping.getConnectionProperties() != null) - setConnection(mapping.getConnectionProperties()); - - } - - public void addRelationship(String parent, String child) { - summarizer.addRelationship(parent, child); - } - - public void addPrimaryKey(String columnName) { - summarizer.addPrimaryKey(columnName); - } - - public void addCollisionColumn(String columnName) { - summarizer.addCollisionColumn(columnName); - } - - public void addRelationship(Key parentKey, Key childKey) { - throw new RuntimeException("Not Implemented"); - } - - public void addPrimaryKey(Key key) { - summarizer.addPrimarykey(key); - } - - public void addGeneratedPrimaryKey(String columnName) { - summarizer.addGeneratedPrimaryKey(columnName); - } - - public void addConverter(String name, String converterName) { - summarizer.addConverter(name, converterName); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeFactory.java deleted file mode 100644 index 8e668c04ee..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.generator.impl.CudGenerator; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; - -public class ChangeFactory { - - private final Type type; - - private InsertCommandImpl createCommand; - - private WriteCommandImpl updateCommand; - - private WriteCommandImpl deleteCommand; - - private static final boolean debug = false; - - private CudGenerator cudGenerator; - - private final MappingWrapper mapping; - - private final ConnectionImpl connection; - - public ChangeFactory(Type type, MappingWrapper mapping, ConnectionImpl connection) { - this.type = type; - this.mapping = mapping; - this.connection = connection; - } - - public Type getType() { - return this.type; - } - - public void setCreateCommand(InsertCommandImpl cmd) { - createCommand = cmd; - } - - public void setUpdateCommand(WriteCommandImpl cmd) { - DebugUtil.debugln(getClass(), debug, "Setting Update Command to " + cmd); - updateCommand = cmd; - } - - public void setDeleteCommand(WriteCommandImpl cmd) { - deleteCommand = cmd; - } - - private CudGenerator getCudGenerator() { - if (this.cudGenerator == null) - this.cudGenerator = new CudGenerator(); - return this.cudGenerator; - } - - ChangeOperation createUpdateOperation(DataObject changedObject, String propagatedID) { - return new UpdateOperation(getUpdateCommand(changedObject), changedObject, propagatedID); - } - ChangeOperation createUpdateOperation(DataObject changedObject) { - return createUpdateOperation(changedObject, null); - } - - ChangeOperation createDeleteOperation(DataObject changedObject) { - return new DeleteOperation(getDeleteCommand(changedObject), changedObject); - } - - ChangeOperation createInsertOperation(DataObject changedObject, String propagatedID) { - return new CreateOperation(getCreateCommand(changedObject), changedObject, propagatedID); - } - - ChangeOperation createInsertOperation(DataObject changedObject) { - return createInsertOperation(changedObject, null); - } - - - private InsertCommandImpl getCreateCommand(DataObject changedObject) { - - if ( createCommand == null ) { - Table table = mapping.getTable(changedObject.getType().getName()); - if (table == null ) - throw new RuntimeException("Table " + table + " was changed in the DataGraph but is not present in the Config"); - - String createStatement = table.getCreate(); - if ( createStatement == null ) { - createCommand = getCudGenerator().getInsertCommand(mapping, changedObject, table); - } else { - createCommand = new InsertCommandImpl(createStatement); - Iterator i = getCudGenerator().getCreateParameters(mapping, changedObject, table).iterator(); - while (i.hasNext()) { - Property p = (Property)i.next(); - createCommand.addParameter(p.getName(), p.getType()); - } - } - createCommand.setConnection(connection); - createCommand.mappingModel = mapping; - } - return createCommand; - } - - private WriteCommandImpl getDeleteCommand(DataObject changedObject) { - - if ( deleteCommand == null ) { - Table table = mapping.getTable(changedObject.getType().getName()); - if (table == null ) - throw new RuntimeException("Table " + table + " was changed in the DataGraph but is not present in the Config"); - String deleteStatement = table.getDelete(); - if ( deleteStatement == null ) { - deleteCommand = getCudGenerator().getDeleteCommand(table); - } else { - deleteCommand = new DeleteCommandImpl(deleteStatement); - Iterator i = getCudGenerator().getDeleteParameters(table).iterator(); - while (i.hasNext()) { - deleteCommand.addParameter((String)i.next(), SDODataTypes.OBJECT); - } - } - deleteCommand.setConnection(connection); - } - return deleteCommand; - } - - private WriteCommandImpl getUpdateCommand(DataObject changedObject) { - - if ( updateCommand == null ) { - Table table = mapping.getTableByPropertyName(changedObject.getType().getName()); - if (table == null ) - throw new RuntimeException("Table " + table + " was changed in the DataGraph but is not present in the Config"); - String updateStatement = table.getUpdate(); - if ( updateStatement == null ) { - updateCommand = getCudGenerator().getUpdateCommand(mapping, changedObject,table); - } else { - TableWrapper t = new TableWrapper(table); - if ( t.getCollisionColumn() != null ) - updateCommand = new OptimisticWriteCommandImpl(updateStatement); - else - updateCommand = new UpdateCommandImpl(updateStatement); - - - updateCommand.addParameters(getCudGenerator().getUpdateParameters(changedObject, table)); - - } - updateCommand.setConnection(connection); - updateCommand.mappingModel = mapping; - } - DebugUtil.debugln(getClass(), debug, "Returning updateCommand: " + updateCommand); - return updateCommand; - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeOperation.java deleted file mode 100644 index 0e8acac35b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeOperation.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - -/** - */ -public abstract class ChangeOperation { - - private final WriteCommandImpl writeCommand; - - protected DatabaseObject dObject; - - private static final boolean debug = false; - - protected String propagatedID = null; - - public ChangeOperation(WriteCommandImpl command) { - writeCommand = command; - } - - public ChangeOperation(WriteCommandImpl command, DataObject changedObject) { - writeCommand = command; - dObject = new DatabaseObject(command.getMappingModel(), changedObject); - } - - public void execute() { - DebugUtil.debugln(getClass(), debug, "Executing change operation"); - - Iterator i = writeCommand.getParameters().iterator(); - while (i.hasNext()) { - Parameter parm = (Parameter) i.next(); - DebugUtil.debugln(getClass(), debug, "setting " + parm.getName() + " to " + dObject.get(parm.getName())); - parm.setValue(dObject.get(parm.getName())); - } - - writeCommand.execute(); - //TODO - Added this instanceof hack. Brent to verify - if (( propagatedID != null ) && (writeCommand instanceof InsertCommandImpl)){ - DebugUtil.debugln(getClass(), debug, "Propagating key " + propagatedID); - int id = writeCommand.getGeneratedKey(); - dObject.setPropagatedID(propagatedID, id); - } - } - - public String getTableName() { - return dObject.getTableName(); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java deleted file mode 100644 index a30a146f53..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java +++ /dev/null @@ -1,225 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.QualifiedColumn; -import org.apache.tuscany.das.rdb.util.DebugUtil; -import org.apache.tuscany.sdo.impl.AttributeImpl; -import org.apache.tuscany.sdo.impl.ChangeSummaryImpl; -import org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl; -import org.apache.tuscany.sdo.impl.ReferenceImpl; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -public class ChangeSummarizer { - - private static final boolean debug = false; - - private Changes changes = new Changes(); - - private FactoryRegistry registry; - - private MappingWrapper mapping = new MappingWrapper(); - - private ConnectionImpl connection; - - private HashMap generatedKeys = new HashMap(); - - public ChangeSummarizer() { - // Empty Constructor - } - - public Changes loadChanges(DataObject root) { - ChangeSummary changeSummary = root.getDataGraph().getChangeSummary(); - if (changeSummary.isLogging()) - ((ChangeSummaryImpl) changeSummary).summarize(); - - List changedObjects = changeSummary.getChangedDataObjects(); - DebugUtil.debugln(getClass(), debug, - "List of changed objects contains " + changedObjects.size() - + " object(s)"); - - changes.setInsertOrder(mapping.getInsertOrder()); - changes.setDeleteOrder(mapping.getDeleteOrder()); - - Iterator i = changedObjects.iterator(); - while (i.hasNext()) { - DataObject o = (DataObject) i.next(); - - if (!(o.equals(root))) { - createChange(changeSummary, o); - } - } - - return changes; - } - - public void createChange(ChangeSummary changeSummary, - DataObject changedObject) { - - if (changeSummary.isCreated(changedObject)) { - DebugUtil.debugln(getClass(), debug, "Change is a create"); - if (!changeSummary.isDeleted(changedObject)) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - String propagatedID = (String) generatedKeys.get(changedObject - .getType().getName()); - changes.addInsert(factory.createInsertOperation(changedObject, - propagatedID)); - } - } else if (changeSummary.isDeleted(changedObject)) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - DebugUtil.debugln(getClass(), debug, "Change is a delete"); - changes.addDelete(factory.createDeleteOperation(changedObject)); - } else { - // bumpCollisionField(changedObject); - DebugUtil.debugln(getClass(), debug, "Change is a modify"); - List attrList = changeSummary.getOldValues(changedObject); - if (hasAttributeChange(attrList)) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - DebugUtil.debugln(getClass(), debug, "Attribute Change for " - + changedObject.getType().getName()); - String propagatedID = (String) generatedKeys.get(changedObject - .getType().getName()); - changes.addUpdate(factory.createUpdateOperation(changedObject, - propagatedID)); - } else { - // Reference change - List values = changeSummary.getOldValues(changedObject); - Iterator i = values.iterator(); - while (i.hasNext()) { - ChangeSummarySettingImpl setting = (ChangeSummarySettingImpl) i - .next(); - - if (setting.getFeature() instanceof ReferenceImpl) { - DebugUtil.debugln(getClass(), debug, - "Reference change for " - + changedObject.getType().getName()); - - ReferenceImpl ref = (ReferenceImpl) setting.getFeature(); - - DebugUtil.debugln(getClass(), debug, ref.getName()); - if (ref.getEOpposite().isMany()) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - changes.addUpdate(factory - .createUpdateOperation(changedObject)); - } - - } - } - } - } - - } - - private boolean hasAttributeChange(List theChanges) { - Iterator i = theChanges.iterator(); - while (i.hasNext()) { - ChangeSummarySettingImpl setting = (ChangeSummarySettingImpl) i.next(); - if (setting.getFeature() instanceof AttributeImpl) - return true; - } - return false; - } - - public void addCreateCommand(Type type, Command cmd) { - ChangeFactory cf = getRegistry().getFactory(type); - cf.setCreateCommand((InsertCommandImpl) cmd); - } - - public void addUpdateCommand(Type type, Command cmd) { - ChangeFactory cf = getRegistry().getFactory(type); - cf.setUpdateCommand((WriteCommandImpl) cmd); - } - - public void addDeleteCommand(Type type, Command cmd) { - ChangeFactory cf = getRegistry().getFactory(type); - cf.setDeleteCommand((WriteCommandImpl) cmd); - - } - - private FactoryRegistry getRegistry() { - if (this.registry == null) { - this.registry = new FactoryRegistry(mapping, connection); - } - return this.registry; - } - - public void setConnection(ConnectionImpl connection) { - this.connection = connection; - } - - public void setMapping(Config map) { - this.mapping = new MappingWrapper(map); - Iterator i = mapping.getConfig().getTable().iterator(); - while (i.hasNext()) { - Table t = (Table) i.next(); - Iterator columns = t.getColumn().iterator(); - while ( columns.hasNext()) { - Column c = (Column) columns.next(); - if ( c.isPrimaryKey() && c.isGenerated()) { - DebugUtil.debugln(getClass(), debug, "adding generated key " - + t.getName() + "." - + c.getName()); - generatedKeys.put(t.getName(), c.getName()); - } - } - } - } - - public void addRelationship(String parentName, String childName) { - mapping.addRelationship(parentName, childName); - } - - public void addPrimaryKey(String columnName) { - mapping.addPrimaryKey(columnName); - } - - public void addCollisionColumn(String columnName) { - mapping.addCollisionColumn(columnName); - } - - public void addPrimarykey(Key key) { - mapping.addPrimaryKey(key); - } - - public void addGeneratedPrimaryKey(String columnName) { - QualifiedColumn col = new QualifiedColumn(columnName); - generatedKeys.put(col.getTableName(), col.getColumnName()); - mapping.addGeneratedPrimaryKey(columnName); - } - - public void addConverter(String name, String converterName) { - mapping.addConverter(name, converterName); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Changes.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Changes.java deleted file mode 100644 index 364007d8cf..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Changes.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Iterator; - -/** - * Mangages a set of graph-change operations. This simple implementaiton can be - * replaced with a version that provides R/I sorting - * - */ -public class Changes { - - private InsertList inserts = new InsertList(); - private UpdateList updates = new UpdateList(); - private DeleteList deletes = new DeleteList(); - -// private static final boolean debug = false; - - public void addInsert(ChangeOperation c) { - inserts.add(c); - } - - public void addUpdate(ChangeOperation c) { - updates.add(c); - } - - public void addDelete(ChangeOperation c) { - deletes.add(c); - } - - /** - * Execute all my change - */ - public void execute() { - - Iterator i = inserts.getSortedList().iterator(); - while ( i.hasNext() ) { - ChangeOperation c = (ChangeOperation) i.next(); - c.execute(); - } - - i = updates.getSortedList().iterator(); - while ( i.hasNext() ) { - ChangeOperation c = (ChangeOperation) i.next(); - c.execute(); - } - - - i = deletes.getSortedList().iterator(); - while (i.hasNext() ) { - ChangeOperation c = (ChangeOperation) i.next(); - c.execute(); - } - - } - - public void setInsertOrder(ArrayList insertOrder) { - inserts.setOrder(insertOrder); - } - - public void setDeleteOrder(ArrayList deleteOrder) { - deletes.setOrder(deleteOrder); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandFactoryImpl.java deleted file mode 100644 index 6d719e6254..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandFactoryImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandFactory; - - -public class CommandFactoryImpl implements CommandFactory { - - protected Map namedCommands = new HashMap(); - - public Command createCommand(String sql) { - return createCommand(sql, null); - } - - public Command createCommand(String sql, InputStream model) { - - sql = sql.trim(); //Remove leading white space - char firstChar = Character.toUpperCase(sql.charAt(0)); - switch (firstChar) { - case 'S': - return new ReadCommandImpl(sql, model); - case 'I': - return new InsertCommandImpl(sql); - case 'U': - return new UpdateCommandImpl(sql); - case 'D': - return new DeleteCommandImpl(sql); - case '{': - return new SPCommandImpl(sql); - default: - throw new Error("SQL => " + sql + " is not valid"); - } - - } - - public Command createReadCommand(String sql) { - return new ReadCommandImpl(sql); - } - - public Command createReadCommand(String sql, InputStream model) { - return new ReadCommandImpl(sql, model); - } - - public ApplyChangesCommand createApplyChangesCommand() { - return new ApplyChangesCommandImpl(); - } - - public ApplyChangesCommand createApplyChangesCommand( - InputStream mappingModel) throws IOException { - return new ApplyChangesCommandImpl(mappingModel); - } - - public Command getCommand (String name) { - return (Command) namedCommands.get(name); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupFactoryImpl.java deleted file mode 100644 index 766a63de7c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupFactoryImpl.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.apache.tuscany.das.rdb.impl; - -import java.io.InputStream; - -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.CommandGroupFactory; - -public class CommandGroupFactoryImpl implements CommandGroupFactory { - - - public CommandGroup createCommandGroup(InputStream configStream) { - return new CommandGroupImpl(configStream); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupImpl.java deleted file mode 100644 index 35f77fb934..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.sql.DataSource; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl; - -import commonj.sdo.helper.XMLHelper; - -/** - * An ConfiguredCommandFactory produces instances of Command and - * ApplyChangesCommand. This factory is initialized with a configuration that - * defines the commands it produces. - * - * <p> - * TODO - This is still underdevelopment and is likely to replace CommandFactory - * as the preferred mechanism to set commands at runtime. - * - * - */ -public class CommandGroupImpl implements CommandGroup { - - private Config config; - - private Connection connection; - - private Map commands = new HashMap(); - - public CommandGroupImpl(InputStream stream) { - super(); - setConfig(stream); - initialize(); - } - - private void initialize() { - - Iterator i = config.getCommand().iterator(); - while (i.hasNext()) { - org.apache.tuscany.das.rdb.config.Command commandConfig = (org.apache.tuscany.das.rdb.config.Command) i - .next(); - String kind = commandConfig.getKind(); - if (kind.equalsIgnoreCase("select")) - commands.put(commandConfig.getName(), new ReadCommandImpl(commandConfig.getSQL(), config)); - else if (kind.equalsIgnoreCase("update")) - commands.put(commandConfig.getName(), new UpdateCommandImpl(commandConfig.getSQL())); - else if (kind.equalsIgnoreCase("insert")) - commands.put(commandConfig.getName(), new InsertCommandImpl(commandConfig.getSQL())); - else if (kind.equalsIgnoreCase("delete")) - commands.put(commandConfig.getName(), new DeleteCommandImpl(commandConfig.getSQL())); - else - throw new Error("Invalid kind of command: " + kind); - - } - - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.das.rdb.CommandGroup#getApplyChangesCommand() - */ - public ApplyChangesCommand getApplyChangesCommand() { - ApplyChangesCommand cmd = new ApplyChangesCommandImpl(config); - cmd.setConnection(getConnection()); - return cmd; - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.das.rdb.CommandGroup#getCommand(java.lang.String) - */ - public Command getCommand(String name) { - if (!commands.containsKey(name)) - throw new RuntimeException("CommandGroup has no command named: " + name); - Command cmd = (Command) commands.get(name); - cmd.setConnection(getConnection()); - return cmd; - } - - // Private - - private void setConfig(InputStream stream) { - XMLHelper helper = XMLHelper.INSTANCE; - - ConfigPackageImpl impl = ConfigPackageImpl.eINSTANCE; - - try { - config = (Config) helper.load(stream).getRootObject(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - } - - public void setConnection(Connection connection) { - this.connection = connection; - } - - public Connection getConnection() { - if (connection == null) - initializeConnection(); - return connection; - } - - private void initializeConnection() { - - ConnectionProperties cp = config.getConnectionProperties(); - if (cp == null) - throw new Error( - "No connection properties have been configured and no connection has been provided"); - - if (cp.getDataSource() != null) - initViaDataSource(cp); - else - initViaDriverManager(cp); - - } - - private void initViaDriverManager(ConnectionProperties cp) { - Connection connection = null; - - try { - Class.forName(cp.getDriverClassName()); - if (cp.getDriverUserName() == null) - connection = DriverManager.getConnection(cp.getDriverURL()); - else - connection = DriverManager.getConnection(cp.getDriverURL(), cp.getDriverUserName(), cp - .getDriverPassword()); - connection.setAutoCommit(false); - setConnection(connection); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - - } - - //TODO - Refactor to eliminate common initialization code after connection is got - private void initViaDataSource(ConnectionProperties cp) { - - Connection connection = null; - - InitialContext ctx; - try { - ctx = new InitialContext(); - } catch (NamingException e) { - throw new Error(e); - } - try { - //TODO - I think we should rename this getDataSourceURL? - DataSource ds = (DataSource) ctx.lookup(cp.getDataSource()); - try { - connection = ds.getConnection(); - connection.setAutoCommit(false); - setConnection(connection); - } catch (SQLException e) { - throw new Error (e); - } - } catch (NamingException e) { - throw new Error(e); - } - - } -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java deleted file mode 100644 index 5272a0b911..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.sql.Connection; -import java.util.List; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XSDHelper; - -public abstract class CommandImpl implements Command { - - protected Statement statement; - - protected Parameters parameters = new Parameters(); - - protected MappingWrapper mappingModel = new MappingWrapper(); - - protected static final boolean debug = false; - - protected ResultSetShape resultSetShape; - - public CommandImpl(String sqlString) { - statement = new Statement(sqlString); - - try { - URL url = getClass().getResource("/xml/sdoJava.xsd"); - if (url == null) - throw new RuntimeException( - "Could not find resource: xml/sdoJava.xsd"); - - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } catch ( IOException ex ) { - throw new RuntimeException(ex); - } - - } - - public abstract void execute(); - - public abstract DataObject executeQuery(); - - public void setParameterValue(String name, Object value) { - parameters.setParameter(name, value); - } - - public void setParameterValue(int index, Object value) { - parameters.setParameter(index, value); - } - - public void setParameterType(String name, Type dataType) { - parameters.setParameterWithType(name, dataType); - } - - public void setParameterType(int index, Type dataType) { - parameters.setParameterWithType(index, dataType); - } - - public void addParameter(int index, Type sdoType) { - addParameter(index, Parameter.IN, sdoType); - } - - public void addParameter(int index, int direction, Type sdoType) { - parameters.findOrCreateParameterWithIndex(index, direction, sdoType); - } - - public void addParameter(String name, Type sdoType) { - addParameter(name, Parameter.IN, sdoType); - } - - public void addParameter(String name, int direction, Type sdoType) { - parameters.setParameterWithType(name, sdoType); - } - - public void addParameter(Parameter param) { - parameters.add(param); - } - - public Parameter getParameter(String name) { - return parameters.get(name); - } - - public Parameter getParameter(int index) { - return parameters.get(index); - - } - - public List getParameters() { - return parameters.parameterList(); - } - - public Object getParameterValue(String name) { - Parameter p = parameters.get(name); - if (p == null) - throw new RuntimeException("Parameter with name " + name - + " not found"); - - return p; - } - - public Object getParameterValue(int index) { - return parameters.parameterWithIndex(index).getValue(); - } - - public void setConnection(Connection connection) { - setConnection(new ConnectionImpl(connection)); - } - - public void setConnection(Connection connection, boolean manageTransaction) { - ConnectionImpl c = new ConnectionImpl(connection); - c.setManageTransactions(manageTransaction); - setConnection(c); - } - - public void setConnection(ConnectionImpl connection) { - statement.setConnection(connection); - } - - protected ConnectionImpl getConnection() { - return statement.getConnection(); - } - - public void addRelationship(String parentName, String childName) { - mappingModel.addRelationship(parentName, childName); - } - - public void addRelationship(Key parentKey, Key childKey) { - mappingModel.addRelationship(parentKey, childKey); - } - - public void addPrimaryKey(String pk) { - mappingModel.addPrimaryKey(pk); - } - - public void addPrimaryKey(Key pk) { - mappingModel.addPrimaryKey(pk); - } - - public void setResultSetShape(ResultSetShape shape) { - this.resultSetShape = shape; - } - - public void addConverter(String name, String converter) { - mappingModel.addConverter(name, converter); - } - - public void close() { - statement.close(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ConnectionImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ConnectionImpl.java deleted file mode 100644 index 2da21bf930..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ConnectionImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.CallableStatement; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public class ConnectionImpl { - - private Connection connection; - private static final boolean debug = false; - - private boolean managingTransaction = true; - - public ConnectionImpl(Connection connection) { - this.connection = connection; - - try { - if (connection.getAutoCommit()) - throw new RuntimeException("AutoCommit must be off!"); - } catch (SQLException e) { - throw new RuntimeException(e); - } - - } - - public Connection getJDBCConnection() { - return connection; - } - - public void cleanUp() { - try { - if (managingTransaction) { - DebugUtil.debugln(getClass(), debug, "Committing Transaction"); - connection.commit(); - } - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - public void errorCleanUp() { - try { - if (managingTransaction) { - DebugUtil.debugln(getClass(), debug, "Rolling back Transaction"); - connection.rollback(); - } - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - public PreparedStatement prepareStatement(QueryString queryString) - throws SQLException { - DebugUtil.debugln(getClass(), debug, "Preparing Statement: " + queryString.getPreparedString()); - return connection.prepareStatement(queryString.getPreparedString(), java.sql.Statement.RETURN_GENERATED_KEYS); - } - - public PreparedStatement preparePagedStatement(QueryString queryString) throws SQLException { - DebugUtil.debugln(getClass(), debug, "Preparing Statement: " + queryString.getPreparedString()); - return connection.prepareStatement(queryString.getPreparedString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); - } - - public void setManageTransactions(boolean manageTransactions) { - managingTransaction = manageTransactions; - - } - - public CallableStatement prepareCall(QueryString queryString) throws SQLException { - return connection.prepareCall(queryString.getPreparedString()); - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CreateOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CreateOperation.java deleted file mode 100644 index 87e6e063d7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CreateOperation.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - - -import commonj.sdo.DataObject; - -public class CreateOperation extends ChangeOperation { - - public CreateOperation(WriteCommandImpl command, DataObject changedObject, String ID) { - super(command, changedObject); - this.propagatedID = ID; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DatabaseObject.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DatabaseObject.java deleted file mode 100644 index d3b00b2e7b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DatabaseObject.java +++ /dev/null @@ -1,130 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -/** - * DatabaseObject wraps DataObject. If a field is an FK field, it will return - * the value from the parent. - * - * - */ -public class DatabaseObject { - - private final MappingWrapper mappingWrapper; - - private final DataObject dataObject; - - private Property parentReference; - - private static final boolean debug = false; - - private HashMap keyMappings = new HashMap(); - - public DatabaseObject(Config model, DataObject changedObject) { - this.mappingWrapper = new MappingWrapper(model); - this.dataObject = changedObject; - initialize(); - } - - // Initialize Key Mappings - private void initialize() { - if (mappingWrapper.getConfig() != null) { - List relationships = mappingWrapper.getConfig().getRelationship(); - Iterator i = relationships.iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - DebugUtil.debugln(getClass(), debug, - "Initializing relationship: " + r.getName()); - if (r.getForeignKeyTable().equals(getTypeName())) { - List pairs = r.getKeyPair(); - Iterator iter = pairs.iterator(); - while (iter.hasNext()) { - KeyPair pair = (KeyPair) iter.next(); - keyMappings.put(pair.getForeignKeyColumn(), r); - } - } - } - } - } - - public Object get(String parameter) { - Relationship r = (Relationship) keyMappings.get(parameter); - if (r == null) - return dataObject.get(parameter); - - Property parentRef = getParentReference(r.getPrimaryKeyTable()); - DataObject parent = dataObject.getDataObject(parentRef); - String parentKey = getParentKey(r, parameter); - return parent.get(parentKey); - - } - - private String getParentKey(Relationship r, String parameter) { - List keyPairs = r.getKeyPair(); - Iterator i = keyPairs.iterator(); - while (i.hasNext()) { - KeyPair pair = (KeyPair) i.next(); - if (pair.getForeignKeyColumn().equals(parameter)) - return pair.getPrimaryKeyColumn(); - } - return null; - } - - public Property getParentReference(String parentName) { - if (this.parentReference == null) { - - Iterator i = dataObject.getType().getProperties().iterator(); - while (i.hasNext()) { - Property ref = (Property) i.next(); - if ((!ref.getType().isDataType()) && - (ref.getType().getName().equals(parentName))) { - this.parentReference = ref; - } - } - } - return this.parentReference; - } - - public String getTableName() { - if (mappingWrapper.getConfig() != null) - return mappingWrapper.getTableByPropertyName(getTypeName()) - .getName(); - else - return null; - } - - public String getTypeName() { - return dataObject.getType().getName(); - } - - public void setPropagatedID(String propagatedID, int id) { - dataObject.setInt(propagatedID, id); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteCommandImpl.java deleted file mode 100644 index 3502784b6f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteCommandImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -public class DeleteCommandImpl extends WriteCommandImpl { - - public DeleteCommandImpl(String sqlString) { - super(sqlString); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteList.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteList.java deleted file mode 100644 index 8650c6119c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteList.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -/** - * DeleteList will sort delete operations so that child objects are deleted - * before their parents - * - * - */ -public class DeleteList { - - private HashMap opsByTableName = new HashMap(); - - private ArrayList order; - - private ArrayList deleteOperations = new ArrayList(); - - public DeleteList() { - super(); - } - - public void add(ChangeOperation op) { - if (( order == null ) || ( op.getTableName() == null ) ) { - deleteOperations.add(op); - } else { - String name = op.getTableName(); - ArrayList ops = (ArrayList) opsByTableName.get(name); - if (ops == null) - ops = new ArrayList(); - - ops.add(op); - opsByTableName.put(name, ops); - } - } - - public Collection getSortedList() { - if (( order != null ) && ( opsByTableName.keySet().size() > 0) ) { - Iterator i = this.order.iterator(); - while (i.hasNext()) { - String name = (String) i.next(); - deleteOperations.addAll((Collection) opsByTableName.get(name)); - } - } - - return deleteOperations; - } - - public void setOrder(ArrayList deleteOrder) { - this.order = deleteOrder; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteOperation.java deleted file mode 100644 index 100cc15d7b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteOperation.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import org.apache.tuscany.das.rdb.util.DataObjectUtil; - -import commonj.sdo.DataObject; - -public class DeleteOperation extends ChangeOperation { - - - /** - * @param command - * @param changedObject - * Objects deleted from the graph have lost their "settings" and must - * be restored - */ - public DeleteOperation(WriteCommandImpl command, DataObject changedObject) { - super(command); - this.dObject = new DatabaseObject(command.getMappingModel(),DataObjectUtil.getRestoredCopy(changedObject)); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/FactoryRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/FactoryRegistry.java deleted file mode 100644 index ce09c748f4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/FactoryRegistry.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; - -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - -public class FactoryRegistry { - - private HashMap registry = new HashMap(); - private static final boolean debug = false; - private final MappingWrapper mapping; - private final ConnectionImpl connection; - - public FactoryRegistry(MappingWrapper mapping, ConnectionImpl connection) { - this.mapping = mapping; - this.connection = connection; - } - - public ChangeFactory getFactory(Type type) { - ChangeFactory factory = (ChangeFactory)registry.get(type); - if ( factory == null ) { - DebugUtil.debugln(getClass(), debug, "Creating new ChangeFactory for type " + type.getName()); - factory = new ChangeFactory(type, mapping, connection); - registry.put(type, factory); - } - return factory; - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertCommandImpl.java deleted file mode 100644 index 9c890c7106..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertCommandImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.SQLException; - -public class InsertCommandImpl extends WriteCommandImpl { - - private int generatedKey; - - private boolean hasGeneratedKey = false; - - public InsertCommandImpl(String sqlString) { - super(sqlString); - } - - protected boolean isInsert() { - return true; - } - - public int getGeneratedKey() { - - if (hasGeneratedKey) - return generatedKey; - - throw new RuntimeException("No generated key is available"); - } - - public Object getParameterValue(String name) { - - if (name.equals("generated_key")) - if (hasGeneratedKey) - return new Integer(generatedKey); - else - throw new RuntimeException("No generated key available"); - - return super.getParameterValue(name); - } - - protected void subtypeProcessing() throws SQLException { - loadGeneratedKey(); - } - - private void loadGeneratedKey() throws SQLException { - Integer key = statement.getGeneratedKey(); - if (key != null) { - hasGeneratedKey = true; - generatedKey = key.intValue(); - } - - } - - public String toString() { - - String superString = super.toString(); - StringBuffer buffer = new StringBuffer(superString); - - buffer.append("\nGenerating key: " + hasGeneratedKey); - if (hasGeneratedKey) - buffer.append("\nGenerated key: " + generatedKey); - - return buffer.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertList.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertList.java deleted file mode 100644 index ba86107247..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertList.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -/** - * InsertList will sort ChangeOperation objects so that parents are inserted - * before children - * - * - */ -public class InsertList { - - private HashMap opsByTableName = new HashMap(); - - private ArrayList insertOperations = new ArrayList(); - - private ArrayList order; - - private static final boolean debug = false; - - public void add(ChangeOperation op) { - DebugUtil.debugln(getClass(), debug, "Adding insert operation "); - if ((order.size() == 0) || (op.getTableName() == null)) { - insertOperations.add(op); - } else { - String name = op.getTableName(); - ArrayList ops = (ArrayList) opsByTableName.get(name); - if (ops == null) - ops = new ArrayList(); - - ops.add(op); - opsByTableName.put(name, ops); - } - } - - public Collection getSortedList() { - DebugUtil.debugln(getClass(), debug, "Getting sorted insert list"); - if ((order.size() > 0) && opsByTableName.keySet().size() > 0) { - Iterator i = this.order.iterator(); - while (i.hasNext()) { - String name = (String) i.next(); - DebugUtil.debugln(getClass(), debug, - "Adding operations for table " + name); - // TODO - KJW added null check ... Brent to verify. - if (opsByTableName.get(name) != null) - insertOperations.addAll((Collection) opsByTableName - .get(name)); - } - } - DebugUtil.debugln(getClass(), debug, "Returning " - + insertOperations.size() + " insert operations"); - return insertOperations; - } - - public void setOrder(ArrayList insertOrder) { - this.order = insertOrder; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/OptimisticWriteCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/OptimisticWriteCommandImpl.java deleted file mode 100644 index ffdd1499ac..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/OptimisticWriteCommandImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.SQLException; - -public class OptimisticWriteCommandImpl extends WriteCommandImpl { - - public OptimisticWriteCommandImpl(String sqlString) { - super(sqlString); - } - - public void execute() { - - boolean success = false; - try { - int rowsAffected = statement.executeUpdate(parameters); - success = true; - if ( rowsAffected == 0 ) - throw new RuntimeException("OCC Exception"); - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/PagerImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/PagerImpl.java deleted file mode 100644 index 32b17ef3e7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/PagerImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Pager; - -import commonj.sdo.DataObject; - -public class PagerImpl implements Pager { - - private final ReadCommandImpl command; - private final int size; - private int idx = 1; - - public PagerImpl(Command command, int size) { - this.command = (ReadCommandImpl)command; - this.command.enablePaging(); - this.size = size; - } - - public DataObject next() { - int start = idx; - int end = idx + size; - idx += size; - command.setStartRow(start); - command.setEndRow(end); - return command.executeQuery(); - } - - public DataObject getPage(int page) { - int end = (page * size) + 1; - int start = end - size; - idx = end; - command.setStartRow(start); - command.setEndRow(end); - return command.executeQuery(); - } - - public DataObject previous() { - int start = idx - (2 * size); - if ( start < 1 ) - start = 1; - int end = start + size; - idx = end; - command.setStartRow(start); - command.setEndRow(end); - return command.executeQuery(); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ParameterImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ParameterImpl.java deleted file mode 100644 index 4528661b2c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ParameterImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; - -import commonj.sdo.Type; - -public class ParameterImpl implements Parameter { - - private int index; - private Type type; - private String name; - private Object value; - private int direction = IN; - private Converter converter; - - public ParameterImpl() { - super(); - } - - public ParameterImpl(String name) { - this.name = name; - } - - public ParameterImpl(int index) { - this.index = index; - } - - public void setType(Type type) { - this.type = type; - } - - public void setIndex(int index) { - if ( index == 0 ) - throw new RuntimeException("Index of zero not allowed"); - this.index = index; - } - - public void setName(String name) { - this.name = name; - } - - public void setValue(Object value) { - this.value = value; - } - - public void setDirection(int direction) { - this.direction = direction; - } - - public Type getType() { - return this.type; - } - - public int getIndex() { - return this.index; - } - - public String getName() { - return this.name; - } - - public Object getValue() { - if ( getConverter() != null ) { - return getConverter().getColumnValue(this.value); - } else { - return this.value; - } - } - - public int getDirection() { - return this.direction; - } - - public void setConverter(Converter converter) { - this.converter = converter; - } - - public Converter getConverter() { - return this.converter; - } - - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("Index: " + getIndex()); - buffer.append("\nName: " + getName()); - buffer.append("\nValue: " + getValue()); - return buffer.toString(); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Parameters.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Parameters.java deleted file mode 100644 index 4ea42f41b2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Parameters.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - -public class Parameters { - - private ArrayList parameters = new ArrayList(); - - private ArrayList inParams = new ArrayList(); - - private ArrayList outParams = new ArrayList(); - - private HashMap parametersByName = new HashMap(); - - private static boolean debug = false; - - public Parameters() { - super(); - } - - public Parameter get(String name) { - return (Parameter) parametersByName.get(name); - } - - public Parameter get(int index) { - return (Parameter) parameters.get(index); - } - - public List outParams() { - return outParams; - } - - public List inParams() { - return inParams; - } - - private void addParameter(Parameter param) { - if (param.getDirection() == Parameter.IN) - inParams.add(param); - else if ((param.getDirection() == Parameter.OUT) - || (param.getDirection() == Parameter.IN_OUT)) - outParams.add(param); - - this.parameters.add(param); - parametersByName.put(param.getName(), param); - } - - public void add(Parameter param) { - addParameter(param); - } - - public Parameter findOrCreateParameterNamed(String name) { - Parameter param = get(name); - if (param == null) { - param = new ParameterImpl(name); - addParameter(param); - } - return param; - } - - public Parameter findOrCreateParameterWithIndex(int index, int direction, - Type sdoType) { - Iterator i = parameters.iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - - if (param.getIndex() == index) - return param; - } - DebugUtil.debugln(getClass(), debug, - "Creating new parameter with index " + index); - Parameter newParam = new ParameterImpl(index); - newParam.setDirection(direction); - newParam.setType(sdoType); - addParameter(newParam); - return newParam; - } - - public List parameterList() { - return parameters; - } - - public Parameter findOrCreateParameterWithIndex(int index) { - return findOrCreateParameterWithIndex(index, Parameter.IN, - SDODataTypes.OBJECT); - } - - public void setParameter(int index, Object value) { - Parameter param = findOrCreateParameterWithIndex(index); - param.setValue(value); - } - - public void setParameter(String name, Object value) { - if (name == null) - throw new RuntimeException("Null parameter name not allowed"); - Parameter param = findOrCreateParameterNamed(name); - param.setValue(value); - } - - public void setParameterWithType(String name, Type sdoType) { - if (name == null) - throw new RuntimeException("Null parameter name not allowed"); - Parameter p = findOrCreateParameterNamed(name); - p.setType(sdoType); - } - - public void setParameterWithType(int index, Type sdoType) { - if (index == 0) - throw new RuntimeException("Null parameter index not allowed"); - Parameter p = findOrCreateParameterWithIndex(index); - p.setType(sdoType); - } - - public Parameter parameterWithIndex(int index) { - Iterator i = parameters.iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - - if (param.getIndex() == index) - return param; - } - return null; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/QueryString.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/QueryString.java deleted file mode 100644 index 8304457a72..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/QueryString.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public class QueryString { - - private final String unmodifiedQueryString; - private final String preparedString; - private HashMap parameters = new HashMap(); - private static final boolean debug = false; - - public QueryString(String originalString) { - this.unmodifiedQueryString = originalString; - this.preparedString = replaceNamesAndSetIndexes(originalString); - } - - public String getPreparedString() { - return this.preparedString; - } - - public String getUnmodifiedString() { - return this.unmodifiedQueryString; - } - - public int getParameterIndex(String name) { - DebugUtil.debugln(getClass(), debug, "Looking for parameter index for: " + name); - //System.out.println(toString()); - return ((Integer)parameters.get(name)).intValue(); - } - - private String replaceNamesAndSetIndexes(String query) { - DebugUtil.debugln(getClass(), debug, "Parameterizing query: " + query); - Pattern p = Pattern.compile(":[\\S&&[^,()]]*"); - Matcher m = p.matcher(query); - - int index = 1; - while (m.find()) { - parameters.put(m.group().substring(1), new Integer(index)); - query = m.replaceFirst("?"); - m = p.matcher(query); - index++; - } - - DebugUtil.debugln(getClass(), debug, "Parameterized query: " + query); - return query; - } - - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("\nOriginal SQL: "); - buffer.append(unmodifiedQueryString); - buffer.append("\nPrepared SQL: "); - buffer.append(preparedString); - buffer.append("\nParameters: "); - Iterator i = parameters.keySet().iterator(); - while ( i.hasNext() ) { - String key = (String)i.next(); - buffer.append("\n"); - buffer.append(key); - } - return buffer.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java deleted file mode 100644 index dd58c98e5b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java +++ /dev/null @@ -1,204 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.graphbuilder.impl.GraphBuilderMetadata; -import org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XMLHelper; - -public class ReadCommandImpl extends CommandImpl { - - private Type schema; - - private int startRow = 1; - - private int endRow = Integer.MAX_VALUE; - - public ReadCommandImpl(String sqlString) { - super(sqlString); - } - - public ReadCommandImpl(String sqlString, InputStream modelStream) { - this(sqlString); - if (modelStream != null) - setMappingModel(modelStream); - } - - public ReadCommandImpl(String sqlString, Config mapping) { - this(sqlString); - if (mapping != null) - setMappingModel(mapping); - } - - public void execute() { - throw new UnsupportedOperationException(); - } - - public DataObject executeQuery() { - - if (statement.getConnection() == null) - throw new RuntimeException( - "A DASConnection object must be specified before executing the query."); - - boolean success = false; - try { - ResultSet rs = statement.executeQuery(parameters); - success = true; - return buildGraph(rs); - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - } - - protected DataObject buildGraph(ResultSet result) throws SQLException { - - List results = new ArrayList(); - results.add(result); - - // Before we use the mappingModel, do some checking/updating. If - // inferrable information - // isn't specified, add it in. - - - GraphBuilderMetadata gbmd = new GraphBuilderMetadata(results, - getSchema(), mappingModel.getConfig(), resultSetShape); - - DataGraph g = createEDataGraph(gbmd.getSchema()); - ChangeSummary summary = g.getChangeSummary(); - - ResultSetProcessor rsp = new ResultSetProcessor(g.getRootObject(), gbmd); - rsp.processResults(getStartRow(), getEndRow()); - - summary.beginLogging(); - - return g.getRootObject(); - } - - private Type getSchema() { - return (Type) schema; - } - - protected int getStartRow() { - return startRow; - } - - protected int getEndRow() { - return endRow; - } - - protected void setStartRow(int startRow) { - this.startRow = startRow; - } - - protected void setEndRow(int endRow) { - this.endRow = endRow; - } - - private DataGraph createEDataGraph(Type type) { - - DataGraph g = SDOUtil.createDataGraph(); - - // Create a ResourceSet to contain the DataGraph - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - - // Create a Resource to hold the schema - - Resource r = resourceSet.createResource(URI.createURI(type.getURI())); - r.getContents().add(g); - - // Create the root object - g.createRootObject(type); - - return g; - } - - private void setMappingModel(Config mapping) { - mappingModel = new MappingWrapper(mapping); - } - - public void setMappingModel(InputStream stream) { - - XMLHelper helper = XMLHelper.INSTANCE; - -// ExtendedMetaData metadata = ExtendedMetaData.INSTANCE; -// metadata.putPackage(null, ConfigPackageImpl.eINSTANCE); - - try { - Config config = (Config) helper.load(stream).getRootObject(); - mappingModel = new MappingWrapper(config); - } catch (IOException e) { - throw new RuntimeException(e); - } - - - if (mappingModel.getConfig().getConnectionProperties() != null) - setConnection(mappingModel.getConfig().getConnectionProperties()); - - } - - public void setConnection(ConnectionProperties c) { - try { - Connection connection = null; - Class.forName(c.getDriverClassName()); - if (c.getDriverUserName() == null) - connection = DriverManager.getConnection(c.getDriverURL()); - else - connection = DriverManager.getConnection(c.getDriverURL(), c - .getDriverUserName(), c.getDriverPassword()); - connection.setAutoCommit(false); - setConnection(connection); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - public void setDataObjectModel(Type schema) { - this.schema = schema; - } - - protected void enablePaging() { - statement.enablePaging(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java deleted file mode 100644 index 7afa3b8563..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.Types; - -import org.apache.tuscany.das.rdb.SDODataTypes; - -import commonj.sdo.Type; - -public class SDODataTypeHelper { - - static public int sqlTypeFor(Type sdoType) { - if ( sdoType == SDODataTypes.BOOLEAN) - return Types.BOOLEAN; - else if ( sdoType == SDODataTypes.STRING) - return Types.VARCHAR; - else if ( sdoType == SDODataTypes.BYTE) - return Types.TINYINT; - else if ( sdoType == SDODataTypes.BYTES) - return Types.BINARY; - else if ( sdoType == SDODataTypes.CHARACTER) - return Types.CHAR; - else if ( sdoType == SDODataTypes.DATE) - return Types.DATE; - else if ( sdoType == SDODataTypes.DATETIME) - return Types.DATE; - else if ( sdoType == SDODataTypes.DAY ) - return java.sql.Types.BINARY; - else if ( sdoType == SDODataTypes.DECIMAL ) - return java.sql.Types.DECIMAL; - else if ( sdoType == SDODataTypes.DOUBLE ) - return java.sql.Types.DOUBLE; - else if ( sdoType == SDODataTypes.DURATION ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.FLOAT ) - return java.sql.Types.REAL; - else if ( sdoType == SDODataTypes.INT ) - return java.sql.Types.INTEGER; - else if ( sdoType == SDODataTypes.INTEGER ) - return java.sql.Types.INTEGER; - else if ( sdoType == SDODataTypes.LONG ) - return java.sql.Types.BIGINT; - else if ( sdoType == SDODataTypes.MONTH ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.MONTHDAY ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.OBJECT ) - return java.sql.Types.JAVA_OBJECT; - else if ( sdoType == SDODataTypes.SHORT ) - return java.sql.Types.SMALLINT; - else if ( sdoType == SDODataTypes.STRING ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.STRINGS ) - return java.sql.Types.OTHER; - else if ( sdoType == SDODataTypes.TIME ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.URI ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.YEAR ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.YEARMONTH ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.YEARMONTHDAY ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.BOOLEANOBJECT ) - return java.sql.Types.BOOLEAN; - else if ( sdoType == SDODataTypes.BYTEOBJECT ) - return java.sql.Types.TINYINT; - else if ( sdoType == SDODataTypes.CHARACTEROBJECT ) - return java.sql.Types.CHAR; - else if ( sdoType == SDODataTypes.DOUBLEOBJECT ) - return java.sql.Types.DOUBLE; - else if ( sdoType == SDODataTypes.FLOATOBJECT ) - return java.sql.Types.REAL; - else if ( sdoType == SDODataTypes.INTEGEROBJECT ) - return java.sql.Types.INTEGER; - else if ( sdoType == SDODataTypes.LONGOBJECT ) - return java.sql.Types.BIGINT; - else if ( sdoType == SDODataTypes.SHORTOBJECT ) - return java.sql.Types.SMALLINT; - else - throw new RuntimeException("Not a valid SDO Type " + sdoType); - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SPCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SPCommandImpl.java deleted file mode 100644 index 8308ee4397..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SPCommandImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.InputStream; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - -public class SPCommandImpl extends ReadCommandImpl { - - public SPCommandImpl(String sqlString) { - super(sqlString); - } - - public SPCommandImpl(String sqlString, InputStream modelStream) { - super(sqlString, modelStream); - } - - public DataObject executeQuery() { - - boolean success = false; - try { - ResultSet rs = statement.executeCall(parameters); - success = true; - - return buildGraph(rs); - } catch (SQLException e) { - DebugUtil.debugln(getClass(), debug, e); - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - } - - public void execute() { - - boolean success = false; - try { - statement.executeUpdateCall(parameters); - success = true; - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java deleted file mode 100644 index 6bc18dc229..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java +++ /dev/null @@ -1,206 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.CallableStatement; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -//TODO - Can use some refactoring. Much code is duplicated in "execute" methods -public class Statement { - - protected final QueryString queryString; - - protected ConnectionImpl jdbcConnection; - - private static final boolean debug = false; - - private PreparedStatement preparedStatement; - - private boolean isPaging = false; - - public Statement(String sqlString) { - this.queryString = new QueryString(sqlString); - } - - public ResultSet executeQuery(Parameters parameters) throws SQLException { - - PreparedStatement ps = getPreparedStatement(); - ps = setParameters(ps, parameters); - ResultSet rs = ps.executeQuery(); - - return rs; - } - - public ResultSet executeCall(Parameters parameters) throws SQLException { - try { - CallableStatement cs = jdbcConnection.prepareCall(queryString); - - Iterator inParams = parameters.inParams().iterator(); - while (inParams.hasNext()) { - Parameter param = (Parameter) inParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - cs.setObject(param.getIndex(), param.getValue()); - } - - // register out parameters - Iterator outParams = parameters.outParams().iterator(); - while (outParams.hasNext()) { - Parameter param = (Parameter) outParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - DebugUtil.debugln(getClass(), debug, "Registering parameter " + param.getName()); - cs.registerOutParameter(param.getIndex(), SDODataTypeHelper.sqlTypeFor(param.getType())); - } - - // Using execute because Derby does not currenlty support - // executeQuery - // for SP - cs.execute(); - ResultSet results = cs.getResultSet(); - - Iterator i = parameters.outParams().iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - param.setValue(cs.getObject(param.getIndex())); - } - - return results; - } catch (SQLException ex) { - ex.printStackTrace(); - throw ex; - } - - } - - public void executeUpdateCall(Parameters parameters) throws SQLException { - CallableStatement cs = jdbcConnection.prepareCall(queryString); - - Iterator inParams = parameters.inParams().iterator(); - while (inParams.hasNext()) { - Parameter param = (Parameter) inParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - cs.setObject(param.getIndex(), param.getValue()); - } - - // register out parameters - Iterator outParams = parameters.outParams().iterator(); - while (outParams.hasNext()) { - Parameter param = (Parameter) outParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - DebugUtil.debugln(getClass(), debug, "Registering parameter " + param.getName()); - cs.registerOutParameter(param.getIndex(), SDODataTypeHelper.sqlTypeFor(param.getType())); - } - - cs.execute(); - - Iterator out = parameters.outParams().iterator(); - while (out.hasNext()) { - Parameter param = (Parameter) out.next(); - param.setValue(cs.getObject(param.getIndex())); - } - - } - - /** - * TODO - We need to look at using specific ps.setXXX methods when a type - * has been specified and try setObject otherwise. - */ - public int executeUpdate(Parameters parameters) throws SQLException { - DebugUtil.debugln(getClass(), debug, "Executing statement " + queryString.getPreparedString()); - PreparedStatement ps = getPreparedStatement(); - Iterator i = parameters.inParams().iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - Object value = param.getValue(); - DebugUtil.debugln(getClass(), debug, "Setting parameter " + param.getIndex() + " to " + value); - if (value == null) { - ps.setNull(param.getIndex(), SDODataTypeHelper.sqlTypeFor(param.getType())); - } else { - ps.setObject(param.getIndex(), value); - } - } - return ps.executeUpdate(); - } - - protected PreparedStatement setParameters(PreparedStatement ps, Parameters parameters) - throws SQLException { - Iterator i = parameters.inParams().iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - ps.setObject(param.getIndex(), param.getValue()); - } - return ps; - } - - public void setConnection(ConnectionImpl jdbcConnection) { - this.jdbcConnection = jdbcConnection; - } - - public ConnectionImpl getConnection() { - return this.jdbcConnection; - } - - private PreparedStatement getPreparedStatement() throws SQLException { - DebugUtil.debugln(getClass(), debug, "Getting prepared statement"); - if (preparedStatement == null) - if (isPaging) - preparedStatement = jdbcConnection.preparePagedStatement(queryString); - else - preparedStatement = jdbcConnection.prepareStatement(queryString); - - return preparedStatement; - } - - public Integer getGeneratedKey() throws SQLException { - - ResultSet rs = getPreparedStatement().getGeneratedKeys(); - if (rs.next()) - return new Integer(rs.getInt(1)); - - return null; - } - - protected void enablePaging() { - isPaging = true; - } - - public void close() { - - if (this.preparedStatement != null) { - try { - preparedStatement.close(); - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateCommandImpl.java deleted file mode 100644 index 7fffe97d5d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateCommandImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -public class UpdateCommandImpl extends WriteCommandImpl { - - public UpdateCommandImpl(String sqlString) { - super(sqlString); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateList.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateList.java deleted file mode 100644 index 1ab2f16fca..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateList.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * Updates don't have to be sorted, so this class is a simple wrapper of ArrayList. - * - */ -public class UpdateList { - - private ArrayList updates = new ArrayList(); - - public UpdateList() { - super(); - } - - public void add(ChangeOperation c) { - updates .add(c); - } - - public Collection getSortedList() { - return updates; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateOperation.java deleted file mode 100644 index 94bb20be1d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateOperation.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.impl; - - -import commonj.sdo.DataObject; - - -public class UpdateOperation extends ChangeOperation { - - public UpdateOperation(WriteCommandImpl command, DataObject changedObject, String id) { - super(command, changedObject); - this.propagatedID = id; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/WriteCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/WriteCommandImpl.java deleted file mode 100644 index c08ddda495..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/WriteCommandImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.SQLException; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.config.Config; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -public abstract class WriteCommandImpl extends CommandImpl { - - - public WriteCommandImpl(String sqlString) { - super(sqlString); - } - - public void execute() { - - boolean success = false; - try { - statement.executeUpdate(parameters); - subtypeProcessing(); - success = true; - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - - } - - public DataObject executeQuery() { - throw new UnsupportedOperationException(); - } - - public Config getMappingModel() { - return this.mappingModel.getConfig(); - } - - - /** - * Subclasses add specific bahavior - * Default is to do nothing - */ - protected void subtypeProcessing() throws SQLException { - if ( false ) - throw new SQLException(); - } - - public void setDataObjectModel(Type schema) { - // don't really care what the model is here - } - - public String toString() { - - StringBuffer buffer = new StringBuffer(); - buffer.append("\nSQL: " + statement.queryString.getUnmodifiedString()); - buffer.append("\nModified SQL: " + statement.queryString.getPreparedString()); - return buffer.toString(); - } - - public int getGeneratedKey() { - throw new RuntimeException("No generated key is available"); - } - - public void addParameters(Collection updateParameters) { - Iterator i = updateParameters.iterator(); - while ( i.hasNext()) { - Parameter p = (Parameter) i.next(); - addParameter(p); - } - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java deleted file mode 100644 index 15943da067..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.merge.impl; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.logging.Logger; - -import org.apache.tuscany.das.rdb.config.wrapper.QualifiedColumn; -import org.apache.tuscany.das.rdb.graphbuilder.impl.MultiTableRegistry; -import org.apache.tuscany.das.rdb.graphbuilder.impl.TableRegistry; -import org.apache.tuscany.sdo.impl.ChangeSummaryImpl; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -public class GraphMerger { - - private HashMap keys = new HashMap(); - - private TableRegistry registry = new MultiTableRegistry(); - - private static Logger logger = Logger.getLogger("GraphMerger"); - - //TODO lots of cleanup/design - public GraphMerger() { - // Empty Constructor - } - - public DataObject merge(List graphs) { - DataObject primaryGraph = (DataObject) graphs.get(0); - - Iterator i = graphs.iterator(); - if (i.hasNext()) - i.next(); - while (i.hasNext()) { - primaryGraph = merge(primaryGraph, (DataObject) i.next()); - } - - return primaryGraph; - } - - public DataObject merge(DataObject primary, DataObject secondary) { - addGraphToRegistry(primary); - - ChangeSummary summary = primary - .getDataGraph().getChangeSummary(); - summary.endLogging(); - Iterator i = secondary.getType().getProperties().iterator(); - - while (i.hasNext()) { - Property p = (Property) i.next(); - - Iterator objects = secondary.getList(p.getName()).iterator(); - while (objects.hasNext()) { - DataObject object = (DataObject) objects.next(); - createObjectWithSubtree(primary, p, object); - } - } - ((ChangeSummaryImpl)summary).resumeLogging(); - return primary; - } - - private void createObjectWithSubtree(DataObject root, Property p, - DataObject object) { - Object pk = getPrimaryKey(object); - - if (!registry.contains(object.getType().getName(), Collections - .singletonList(pk))) { - // logger.info("creating " + object.getType().getName() + " with pk " + pk); - DataObject newObject = root.createDataObject(p.getName()); - - - - Iterator attrs = object.getType().getProperties().iterator(); - while (attrs.hasNext()) { - Property attr = (Property) attrs.next(); - if ( attr.getType().isDataType()) { - newObject.set(attr.getName(), object.get(attr)); - } - } - registry.put(object.getType().getName(), Collections - .singletonList(pk), newObject); - - Iterator refs = object.getType().getProperties().iterator(); - while (refs.hasNext()) { - Property ref = (Property) refs.next(); - if ( !ref.getType().isDataType()) { - List refObjects; - if (!ref.isMany()) { - refObjects = Collections.singletonList(object.get(ref)); - } else { - refObjects = (List) object.get(ref); - } - - Iterator iter = refObjects.iterator(); - while (iter.hasNext()) { - DataObject refObject = (DataObject) iter.next(); - createObjectWithSubtree(root, refObject - .getContainmentProperty(), refObject); - - refObject = (DataObject) registry.get(refObject.getType().getName(), Collections.singletonList(getPrimaryKey(refObject))); - if (ref.isMany()) { - newObject.getList( - newObject.getType().getProperty(ref.getName())) - .add(refObject); - } else - newObject.set(newObject.getType().getProperty( - ref.getName()), refObject); - } - } - - } - - } - - } - - private void addGraphToRegistry(DataObject graph1) { - Iterator i = graph1.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - Iterator objects = graph1.getList(p).iterator(); - while (objects.hasNext()) { - DataObject object = (DataObject) objects.next(); - Object pk = object.get(getPrimaryKeyName(object)); - logger.finest("Adding object with pk " + pk + " to registry"); - registry.put(object.getType().getName(), Collections - .singletonList(pk), object); - } - } - } - - private Object getPrimaryKey(DataObject object) { - String pkName = getPrimaryKeyName(object); - return object.get(pkName); - } - - private String getPrimaryKeyName(DataObject object) { - return (String) keys.get(object.getType().getName()); - } - - public void addPrimaryKey(String key) { - QualifiedColumn column = new QualifiedColumn(key); - logger.finest("Adding " + column.getTableName() + " " - + column.getColumnName() + " to keys"); - keys.put(column.getTableName(), column.getColumnName()); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java deleted file mode 100644 index 7f96f9aef4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.util; - -import java.util.Iterator; -import java.util.List; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.ChangeSummary.Setting; -import commonj.sdo.helper.DataFactory; - -/** - */ -public class DataObjectUtil { - - //Utilities - public static DataObject getRestoredCopy(DataObject changedDO) { - DataObject changedCopy = getCopy(changedDO); - restoreAttributeValues(changedCopy, changedDO); - return changedCopy; - } - - public static DataObject getCopy(DataObject original) { - - DataObject copy = DataFactory.INSTANCE.create(original.getType()); - - //Fill in values - Iterator i = original.getType().getProperties().iterator(); - while (i.hasNext()) { - Property feature = (Property) i.next(); - copy.set(feature, original.get(feature)); - } - return copy; - } - - /** - * @param changedCopy - * @return - */ - private static void restoreAttributeValues(DataObject changedCopy, DataObject changedDO) { - - ChangeSummary changeSummary = changedDO.getDataGraph().getChangeSummary(); - List changes = changeSummary.getOldValues(changedDO); - if ( changes == null ) - return; - - Iterator i = changes.iterator(); - while (i.hasNext()) { - Setting s = (Setting) i.next(); - if ( s.getProperty().getType().isDataType() ) - changedCopy.set(s.getProperty(), s.getValue()); - } - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugFormatter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugFormatter.java deleted file mode 100644 index ed2e1063d6..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugFormatter.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.util; - -import java.util.logging.Formatter; -import java.util.logging.LogRecord; - -public class DebugFormatter extends Formatter { - - public String format(LogRecord record) { - StringBuffer message = new StringBuffer(); - message.append("["); - message.append(record.getSourceClassName()); - message.append("] "); - message.append(record.getMessage()); - message.append("\n"); - return message.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugUtil.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugUtil.java deleted file mode 100644 index 745fe8cb7e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugUtil.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.util; - -import java.util.logging.ConsoleHandler; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.Logger; - -//TODO Restructure Logging -public class DebugUtil { - - private static StringBuffer buffer = new StringBuffer(); - private static final Logger logger = Logger.getAnonymousLogger(); - - static { - logger.setUseParentHandlers(false); - Handler h = new ConsoleHandler(); - h.setFormatter(new DebugFormatter()); - logger.addHandler(h); - } - public static void debugln(Class c, boolean flag, Object obj) { - - if ( flag ) { - logger.logp(Level.INFO, getClassName(c), null, obj.toString() ); - } - } - - public static void debug(Class c, boolean flag, Object obj) { - if ( flag ) { - System.out.print("[" + getClassName(c) + "] " + obj ); - } - } - - public static void buffer(boolean flag, Object obj) { - if ( flag ) - buffer.append(obj); - } - - public static void flushBuffer(Class c, boolean flag) { - if ( flag ) { - System.out.println("[" + getClassName(c) + "] " + buffer.toString()); - buffer = new StringBuffer(); - } - } - - private static String getClassName(Class c) { - String className = c.getName(); - return className.substring(className.lastIndexOf(".") + 1); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/resources/META-INF/MANIFEST.MF b/tags/java-stable-20060304/das/rdb/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index cb460db0f0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: rdbdas -Bundle-SymbolicName: rdbdas -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Require-Bundle: org.junit,
- org.eclipse.emf.ecore.sdo diff --git a/tags/java-stable-20060304/das/rdb/src/main/resources/config.xsd b/tags/java-stable-20060304/das/rdb/src/main/resources/config.xsd deleted file mode 100644 index a7211727dc..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/resources/config.xsd +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xsd:schema xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.apache.tuscany.das.rdb.config="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ecore:nsPrefix="org.apache.tuscany.das.rdb.config" ecore:package="org.apache.tuscany.das.rdb.config" targetNamespace="http:///org.apache.tuscany.das.rdb/config.xsd"> - <xsd:import namespace="http://www.eclipse.org/emf/2002/Ecore" schemaLocation="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.xsd"/> - <xsd:element ecore:ignore="true" name="Config" type="org.apache.tuscany.das.rdb.config:Config"/> - <xsd:element ecore:ignore="true" name="Command" type="org.apache.tuscany.das.rdb.config:Command"/> - <xsd:element ecore:ignore="true" name="ConnectionProperties" type="org.apache.tuscany.das.rdb.config:ConnectionProperties"/> - <xsd:element ecore:ignore="true" name="Parameter" type="org.apache.tuscany.das.rdb.config:Parameter"/> - <xsd:element ecore:ignore="true" name="Relationship" type="org.apache.tuscany.das.rdb.config:Relationship"/> - <xsd:element ecore:ignore="true" name="Table" type="org.apache.tuscany.das.rdb.config:Table"/> - <xsd:element ecore:ignore="true" name="KeyPair" type="org.apache.tuscany.das.rdb.config:KeyPair"/> - <xsd:element ecore:ignore="true" name="Column" type="org.apache.tuscany.das.rdb.config:Column"/> - <xsd:element ecore:ignore="true" name="ResultDescriptor" type="org.apache.tuscany.das.rdb.config:ResultDescriptor"/> - <xsd:complexType name="Config"> - <xsd:sequence> - <xsd:element ecore:opposite="Config" ecore:resolveProxies="true" maxOccurs="unbounded" minOccurs="0" name="Command" type="org.apache.tuscany.das.rdb.config:Command"/> - <xsd:element ecore:opposite="Config" ecore:resolveProxies="true" minOccurs="0" name="ConnectionProperties" type="org.apache.tuscany.das.rdb.config:ConnectionProperties"/> - <xsd:element ecore:opposite="Config" ecore:resolveProxies="true" maxOccurs="unbounded" minOccurs="0" name="Table" type="org.apache.tuscany.das.rdb.config:Table"/> - <xsd:element ecore:opposite="Config" ecore:resolveProxies="true" maxOccurs="unbounded" minOccurs="0" name="Relationship" type="org.apache.tuscany.das.rdb.config:Relationship"/> - </xsd:sequence> - <xsd:attribute name="uri" type="xsd:string"/> - </xsd:complexType> - <xsd:complexType name="Command"> - <xsd:sequence> - <xsd:element ecore:opposite="Command" ecore:resolveProxies="true" maxOccurs="unbounded" minOccurs="0" name="Parameter" type="org.apache.tuscany.das.rdb.config:Parameter"/> - <xsd:element ecore:opposite="Command" ecore:resolveProxies="true" maxOccurs="unbounded" minOccurs="0" name="ResultDescriptor" type="org.apache.tuscany.das.rdb.config:ResultDescriptor"/> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="SQL" type="xsd:string"/> - <xsd:attribute name="kind" type="xsd:string"/> - <xsd:attribute ecore:opposite="Command" ecore:reference="org.apache.tuscany.das.rdb.config:Config" ecore:transient="true" name="Config" type="xsd:anyURI"/> - </xsd:complexType> - <xsd:complexType name="ConnectionProperties"> - <xsd:attribute name="dataSource" type="xsd:string"/> - <xsd:attribute name="driverClassName" type="xsd:string"/> - <xsd:attribute name="driverURL" type="xsd:string"/> - <xsd:attribute name="driverPassword" type="xsd:string"/> - <xsd:attribute name="driverUserName" type="xsd:string"/> - <xsd:attribute ecore:opposite="ConnectionProperties" ecore:reference="org.apache.tuscany.das.rdb.config:Config" ecore:transient="true" name="Config" type="xsd:anyURI"/> - </xsd:complexType> - <xsd:complexType name="Parameter"> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="columnType" type="xsd:string"/> - <xsd:attribute ecore:opposite="Parameter" ecore:reference="org.apache.tuscany.das.rdb.config:Command" ecore:transient="true" name="Command" type="xsd:anyURI"/> - </xsd:complexType> - <xsd:complexType name="Relationship"> - <xsd:sequence> - <xsd:element ecore:opposite="Relationship" ecore:resolveProxies="true" maxOccurs="unbounded" minOccurs="0" name="KeyPair" type="org.apache.tuscany.das.rdb.config:KeyPair"/> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="primaryKeyTable" type="xsd:string"/> - <xsd:attribute name="foreignKeyTable" type="xsd:string"/> - <xsd:attribute name="many" type="xsd:boolean"/> - <xsd:attribute ecore:opposite="Relationship" ecore:reference="org.apache.tuscany.das.rdb.config:Config" ecore:transient="true" name="Config" type="xsd:anyURI"/> - </xsd:complexType> - <xsd:complexType name="Table"> - <xsd:sequence> - <xsd:element ecore:opposite="Table" ecore:resolveProxies="true" maxOccurs="unbounded" minOccurs="0" name="Column" type="org.apache.tuscany.das.rdb.config:Column"/> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="propertyName" type="xsd:string"/> - <xsd:attribute name="create" type="xsd:string"/> - <xsd:attribute name="update" type="xsd:string"/> - <xsd:attribute name="delete" type="xsd:string"/> - <xsd:attribute ecore:opposite="Table" ecore:reference="org.apache.tuscany.das.rdb.config:Config" ecore:transient="true" name="Config" type="xsd:anyURI"/> - </xsd:complexType> - <xsd:complexType name="KeyPair"> - <xsd:attribute name="primaryKeyColumn" type="xsd:string"/> - <xsd:attribute name="foreignKeyColumn" type="xsd:string"/> - <xsd:attribute ecore:opposite="KeyPair" ecore:reference="org.apache.tuscany.das.rdb.config:Relationship" ecore:transient="true" name="Relationship" type="xsd:anyURI"/> - </xsd:complexType> - <xsd:complexType name="Column"> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="propertyName" type="xsd:string"/> - <xsd:attribute name="converterClassName" type="xsd:string"/> - <xsd:attribute name="columnType" type="xsd:string"/> - <xsd:attribute name="primaryKey" type="xsd:boolean"/> - <xsd:attribute name="generated" type="xsd:boolean"/> - <xsd:attribute name="collision" type="xsd:boolean"/> - <xsd:attribute ecore:opposite="Column" ecore:reference="org.apache.tuscany.das.rdb.config:Table" ecore:transient="true" name="Table" type="xsd:anyURI"/> - </xsd:complexType> - <xsd:complexType name="ResultDescriptor"> - <xsd:attribute name="columnName" type="xsd:string"/> - <xsd:attribute name="tableName" type="xsd:string"/> - <xsd:attribute name="columnType" type="xsd:string"/> - <xsd:attribute name="converter" type="xsd:string"/> - <xsd:attribute ecore:opposite="ResultDescriptor" ecore:reference="org.apache.tuscany.das.rdb.config:Command" ecore:transient="true" name="Command" type="xsd:anyURI"/> - </xsd:complexType> -</xsd:schema>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/resources/dasmodel4.mdl b/tags/java-stable-20060304/das/rdb/src/main/resources/dasmodel4.mdl deleted file mode 100644 index 1de7601cab..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/resources/dasmodel4.mdl +++ /dev/null @@ -1,4645 +0,0 @@ -
-(object Petal
- version 42
- _written "Rose 4.5.8163.3"
- charSet 0)
-
-(object Design "Logical View"
- is_unit TRUE
- is_loaded TRUE
- defaults (object defaults
- rightMargin 0.250000
- leftMargin 0.250000
- topMargin 0.250000
- bottomMargin 0.500000
- pageOverlap 0.250000
- clipIconLabels TRUE
- autoResize TRUE
- snapToGrid TRUE
- gridX 31
- gridY 31
- defaultFont (object Font
- size 10
- face "Arial"
- bold FALSE
- italics FALSE
- underline FALSE
- strike FALSE
- color 0
- default_color TRUE)
- showMessageNum 3
- showClassOfObject TRUE
- notation "Unified")
- root_usecase_package (object Class_Category "Use Case View"
- quid "4362A29901BA"
- exportControl "Public"
- global TRUE
- logical_models (list unit_reference_list)
- logical_presentations (list unit_reference_list
- (object UseCaseDiagram "Main"
- quid "4362A2990259"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- root_category (object Class_Category "Logical View"
- quid "4362A29901B9"
- exportControl "Public"
- global TRUE
- subsystem "Component View"
- quidu "4362A29901BB"
- logical_models (list unit_reference_list
- (object Class_Category "config"
- attributes (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "nsURI"
- value "http:///org.apache.tuscany.das.rdb/config.xsd")
- (object Attribute
- tool "Ecore"
- name "basePackage"
- value "org.apache.tuscany.das.rdb"))
- quid "4362A2A10169"
- exportControl "Public"
- logical_models (list unit_reference_list
- (object Class "Config"
- quid "4362A2DE0045"
- class_attributes (list class_attribute_list
- (object ClassAttribute "uri"
- quid "4362A337006B"
- type "String")))
- (object Class "Command"
- quid "4362A2EC01FE"
- class_attributes (list class_attribute_list
- (object ClassAttribute "name"
- quid "4362A3EC02EC"
- type "String")
- (object ClassAttribute "SQL"
- quid "4362A3EF0246"
- type "String")
- (object ClassAttribute "kind"
- quid "437903E60321"
- type "String")))
- (object Class "ConnectionProperties"
- quid "4362A2FD0085"
- class_attributes (list class_attribute_list
- (object ClassAttribute "dataSource"
- quid "4362A35A035A"
- type "String")
- (object ClassAttribute "driverClassName"
- quid "4362A36D0203"
- type "String")
- (object ClassAttribute "driverURL"
- quid "4362A3740330"
- type "String")
- (object ClassAttribute "driverPassword"
- quid "4362A384022E"
- type "String")
- (object ClassAttribute "driverUserName"
- quid "4378E1B303C2"
- type "String")))
- (object Class "Parameter"
- quid "4362A3C902BA"
- class_attributes (list class_attribute_list
- (object ClassAttribute "name"
- quid "4362A40600D7"
- type "String")
- (object ClassAttribute "columnType"
- quid "4362A4090280"
- type "String")))
- (object Class "Relationship"
- quid "4362A42E03A5"
- class_attributes (list class_attribute_list
- (object ClassAttribute "name"
- quid "4362A73A0216"
- type "String")
- (object ClassAttribute "primaryKeyTable"
- quid "4362A73D0329"
- type "String")
- (object ClassAttribute "foreignKeyTable"
- quid "4362A74002FB"
- type "String")
- (object ClassAttribute "many"
- quid "4362A7430241"
- type "boolean")))
- (object Class "Table"
- quid "4362A43C0002"
- class_attributes (list class_attribute_list
- (object ClassAttribute "name"
- quid "4362A7B2031D"
- type "String")
- (object ClassAttribute "propertyName"
- quid "4362A7C203A2"
- type "String")
- (object ClassAttribute "create"
- quid "4362A7D0024E"
- type "String")
- (object ClassAttribute "update"
- quid "4362A7D30220"
- type "String")
- (object ClassAttribute "delete"
- quid "4362A7E1031B"
- type "String")))
- (object Class "KeyPair"
- quid "4362A72E0010"
- class_attributes (list class_attribute_list
- (object ClassAttribute "primaryKeyColumn"
- quid "4362A8E702A9"
- type "String")
- (object ClassAttribute "foreignKeyColumn"
- quid "4362A8ED01AE"
- type "String")))
- (object Class "Column"
- quid "4362A75C016B"
- class_attributes (list class_attribute_list
- (object ClassAttribute "name"
- quid "4362A8BD02E5"
- type "String")
- (object ClassAttribute "propertyName"
- quid "4362A8C001C7"
- type "String")
- (object ClassAttribute "converterClassName"
- quid "4362A8C303A2"
- type "String")
- (object ClassAttribute "columnType"
- quid "4362A8C903A0"
- type "String")
- (object ClassAttribute "primaryKey"
- quid "437907F200F9"
- type "boolean")
- (object ClassAttribute "generated"
- quid "4379083900BF"
- type "boolean")
- (object ClassAttribute "collision"
- quid "437908E5012B"
- type "boolean")))
- (object Class "ResultDescriptor"
- quid "437B57EF0008"
- class_attributes (list class_attribute_list
- (object ClassAttribute "columnName"
- quid "437B5A6503BB"
- type "String")
- (object ClassAttribute "tableName"
- quid "437B5A6B016B"
- type "String")
- (object ClassAttribute "columnType"
- quid "437B5A6D033A"
- type "String")
- (object ClassAttribute "converter"
- quid "437B5A6F0153"
- type "String"))
- language "Java")
- (object Association "$UNNAMED$0"
- quid "4362A3030323"
- roles (list role_list
- (object Role "$UNNAMED$1"
- quid "4362A3040108"
- supplier "Logical View::config::Config"
- quidu "4362A2DE0045"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$2"
- quid "4362A3040109"
- supplier "Logical View::config::Command"
- quidu "4362A2EC01FE"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$3"
- quid "4362A308010D"
- roles (list role_list
- (object Role "$UNNAMED$4"
- quid "4362A3090015"
- supplier "Logical View::config::Config"
- quidu "4362A2DE0045"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$5"
- quid "4362A3090016"
- supplier "Logical View::config::ConnectionProperties"
- quidu "4362A2FD0085"
- client_cardinality (value cardinality "0..1")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$6"
- quid "4362A3D302FA"
- roles (list role_list
- (object Role "$UNNAMED$7"
- quid "4362A3D40143"
- supplier "Logical View::config::Command"
- quidu "4362A2EC01FE"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$8"
- quid "4362A3D40144"
- supplier "Logical View::config::Parameter"
- quidu "4362A3C902BA"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$9"
- quid "4362A448026C"
- roles (list role_list
- (object Role "$UNNAMED$10"
- quid "4362A4490105"
- supplier "Logical View::config::Config"
- quidu "4362A2DE0045"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$11"
- quid "4362A4490106"
- supplier "Logical View::config::Table"
- quidu "4362A43C0002"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$12"
- quid "4362A44B0298"
- roles (list role_list
- (object Role "$UNNAMED$13"
- quid "4362A44C01AA"
- supplier "Logical View::config::Config"
- quidu "4362A2DE0045"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$14"
- quid "4362A44C01AB"
- supplier "Logical View::config::Relationship"
- quidu "4362A42E03A5"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$15"
- quid "4362A76302A1"
- roles (list role_list
- (object Role "$UNNAMED$16"
- quid "4362A7640090"
- supplier "Logical View::config::Table"
- quidu "4362A43C0002"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$17"
- quid "4362A7640091"
- supplier "Logical View::config::Column"
- quidu "4362A75C016B"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$18"
- quid "4362A771032E"
- roles (list role_list
- (object Role "$UNNAMED$19"
- quid "4362A7720108"
- supplier "Logical View::config::Relationship"
- quidu "4362A42E03A5"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$20"
- quid "4362A7720109"
- supplier "Logical View::config::KeyPair"
- quidu "4362A72E0010"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE)))
- (object Association "$UNNAMED$21"
- quid "437B59A10066"
- roles (list role_list
- (object Role "$UNNAMED$22"
- quid "437B59A30145"
- supplier "Logical View::config::Command"
- quidu "4362A2EC01FE"
- Containment "By Value"
- is_navigable TRUE
- is_aggregate TRUE)
- (object Role "$UNNAMED$23"
- quid "437B59A30146"
- supplier "Logical View::config::ResultDescriptor"
- quidu "437B57EF0008"
- client_cardinality (value cardinality "0..n")
- Containment "By Value"
- is_navigable TRUE))))
- logical_presentations (list unit_reference_list
- (object ClassDiagram "Main"
- quid "4362A2A900AD"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list
- (object ClassView "Class" "Logical View::config::KeyPair" @1
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1054, 1333)
- label (object ItemLabel
- Parent_View @1
- location (809, 1227)
- fill_color 13434879
- nlines 1
- max_width 490
- justify 0
- label "KeyPair")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A72E0010"
- width 508
- height 236
- autoResize TRUE)
- (object ClassView "Class" "Logical View::config::Column" @2
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (2015, 1519)
- label (object ItemLabel
- Parent_View @2
- location (1756, 1288)
- fill_color 13434879
- nlines 1
- max_width 518
- justify 0
- label "Column")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A75C016B"
- width 536
- height 486
- autoResize TRUE)
- (object ClassView "Class" "Logical View::config::ConnectionProperties" @3
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (2542, 248)
- label (object ItemLabel
- Parent_View @3
- location (2317, 67)
- fill_color 13434879
- nlines 1
- max_width 450
- justify 0
- label "ConnectionProperties")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A2FD0085"
- width 468
- height 386
- autoResize TRUE)
- (object ClassView "Class" "Logical View::config::Relationship" @4
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1054, 744)
- label (object ItemLabel
- Parent_View @4
- location (829, 588)
- fill_color 13434879
- nlines 1
- max_width 450
- justify 0
- label "Relationship")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A42E03A5"
- width 468
- height 336
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$18" @5
- location (1081, 1063)
- stereotype TRUE
- line_color 3342489
- quidu "4362A771032E"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$19" @6
- Parent_View @5
- location (-97, -84)
- stereotype TRUE
- line_color 3342489
- quidu "4362A7720108"
- client @5
- supplier @4
- line_style 3
- origin_attachment (1080, 1063)
- terminal_attachment (1080, 912))
- (object RoleView "$UNNAMED$20" @7
- Parent_View @5
- location (-97, -84)
- stereotype TRUE
- line_color 3342489
- quidu "4362A7720109"
- client @5
- supplier @1
- line_style 3
- origin_attachment (1080, 1063)
- terminal_attachment (1080, 1215)
- label (object SegLabel @8
- Parent_View @7
- location (1135, 1112)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.327273
- height 55
- orientation 0))))
- (object ClassView "Class" "Logical View::config::Table" @9
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1984, 837)
- label (object ItemLabel
- Parent_View @9
- location (1784, 656)
- fill_color 13434879
- nlines 1
- max_width 400
- justify 0
- label "Table")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A43C0002"
- width 418
- height 386
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$15" @10
- location (1778, 1153)
- stereotype TRUE
- line_color 3342489
- quidu "4362A76302A1"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$16" @11
- Parent_View @10
- location (1003, 6)
- stereotype TRUE
- line_color 3342489
- quidu "4362A7640090"
- client @10
- supplier @9
- line_style 3
- origin_attachment (1778, 1153)
- terminal_attachment (1778, 1030))
- (object RoleView "$UNNAMED$17" @12
- Parent_View @10
- location (1003, 6)
- stereotype TRUE
- line_color 3342489
- quidu "4362A7640091"
- client @10
- supplier @2
- line_style 3
- origin_attachment (1778, 1153)
- terminal_attachment (1778, 1276)
- label (object SegLabel @13
- Parent_View @12
- location (1832, 1166)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.109091
- height 54
- orientation 0))))
- (object ClassView "Class" "Logical View::config::Parameter" @14
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (186, 806)
- label (object ItemLabel
- Parent_View @14
- location (4, 700)
- fill_color 13434879
- nlines 1
- max_width 364
- justify 0
- label "Parameter")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A3C902BA"
- width 382
- height 236
- autoResize TRUE)
- (object ClassView "Class" "Logical View::config::Config" @15
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (1054, 155)
- label (object ItemLabel
- Parent_View @15
- location (959, 74)
- fill_color 13434879
- nlines 1
- max_width 190
- justify 0
- label "Config")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A2DE0045"
- width 208
- height 186
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$3" @16
- location (1733, 184)
- stereotype TRUE
- line_color 3342489
- quidu "4362A308010D"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$4" @17
- Parent_View @16
- location (307, -498)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3090015"
- client @16
- supplier @15
- line_style 3
- origin_attachment (1733, 184)
- terminal_attachment (1158, 184))
- (object RoleView "$UNNAMED$5" @18
- Parent_View @16
- location (307, -498)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3090016"
- client @16
- supplier @3
- line_style 3
- origin_attachment (1733, 184)
- terminal_attachment (2308, 184)
- label (object SegLabel @19
- Parent_View @18
- location (2194, 126)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..1"
- pctDist 0.801805
- height 59
- orientation 0))))
- (object AssociationViewNew "$UNNAMED$12" @20
- location (1054, 411)
- label (object SegLabel @21
- Parent_View @20
- location (1054, 352)
- font (object Font
- italics TRUE)
- hidden TRUE
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 600
- justify 0
- label ""
- pctDist 0.500000
- height 60
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "4362A44B0298"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$13" @22
- Parent_View @20
- location (-93, -395)
- label (object SegLabel @23
- Parent_View @22
- location (1013, 281)
- hidden TRUE
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 252
- justify 0
- label ""
- pctDist 0.800000
- height 42
- orientation 0)
- stereotype TRUE
- line_color 3342489
- quidu "4362A44C01AA"
- client @20
- supplier @15
- line_style 0)
- (object RoleView "$UNNAMED$14" @24
- Parent_View @20
- location (-93, -395)
- label (object SegLabel @25
- Parent_View @24
- location (1013, 509)
- hidden TRUE
- anchor 1
- anchor_loc 1
- nlines 1
- max_width 252
- justify 0
- label ""
- pctDist 0.597561
- height 42
- orientation 1)
- stereotype TRUE
- line_color 3342489
- quidu "4362A44C01AB"
- client @20
- supplier @4
- line_style 0
- label (object SegLabel @26
- Parent_View @24
- location (1011, 558)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.899471
- height 44
- orientation 1))))
- (object AssociationViewNew "$UNNAMED$9" @27
- location (1666, 248)
- stereotype TRUE
- line_color 3342489
- quidu "4362A448026C"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$10" @28
- Parent_View @27
- location (860, -558)
- stereotype TRUE
- line_color 3342489
- quidu "4362A4490105"
- client @27
- supplier @15
- line_style 3
- origin_attachment (1667, 247)
- terminal_attachment (1158, 247))
- (object RoleView "$UNNAMED$11" @29
- Parent_View @27
- location (860, -558)
- stereotype TRUE
- line_color 3342489
- quidu "4362A4490106"
- client @27
- supplier @9
- vertices (list Points
- (1667, 247)
- (1972, 247)
- (1972, 644))
- line_style 3
- origin_attachment (1667, 247)
- terminal_attachment (1972, 644)
- label (object SegLabel @30
- Parent_View @29
- location (2031, 380)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.625538
- height 59
- orientation 0))))
- (object ClassView "Class" "Logical View::config::Command" @31
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (186, 217)
- label (object ItemLabel
- Parent_View @31
- location (63, 86)
- fill_color 13434879
- nlines 1
- max_width 246
- justify 0
- label "Command")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A2EC01FE"
- width 264
- height 286
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$6" @32
- location (186, 523)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3D302FA"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$7" @33
- Parent_View @32
- location (-279, -500)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3D40143"
- client @32
- supplier @31
- line_style 0)
- (object RoleView "$UNNAMED$8" @34
- Parent_View @32
- location (-279, -500)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3D40144"
- client @32
- supplier @14
- line_style 0
- label (object SegLabel @35
- Parent_View @34
- location (241, 600)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.473684
- height 55
- orientation 0))))
- (object AssociationViewNew "$UNNAMED$0" @36
- location (634, 212)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3030323"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$1" @37
- Parent_View @36
- location (200, -470)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3040108"
- client @36
- supplier @15
- line_style 3
- origin_attachment (634, 212)
- terminal_attachment (950, 212))
- (object RoleView "$UNNAMED$2" @38
- Parent_View @36
- location (200, -470)
- stereotype TRUE
- line_color 3342489
- quidu "4362A3040109"
- client @36
- supplier @31
- line_style 3
- origin_attachment (634, 212)
- terminal_attachment (318, 212)
- label (object SegLabel @39
- Parent_View @38
- location (371, 260)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.831858
- height 48
- orientation 0))))
- (object ClassView "Class" "Logical View::config::ResultDescriptor" @40
- ShowCompartmentStereotypes TRUE
- IncludeAttribute TRUE
- IncludeOperation TRUE
- location (465, 1240)
- label (object ItemLabel
- Parent_View @40
- location (248, 1084)
- fill_color 13434879
- nlines 1
- max_width 434
- justify 0
- label "ResultDescriptor")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "437B57EF0008"
- width 452
- height 336
- annotation 8
- autoResize TRUE)
- (object AssociationViewNew "$UNNAMED$21" @41
- location (484, 626)
- stereotype TRUE
- line_color 3342489
- quidu "437B59A10066"
- roleview_list (list RoleViews
- (object RoleView "$UNNAMED$22" @42
- Parent_View @41
- location (50, -614)
- stereotype TRUE
- line_color 3342489
- quidu "437B59A30145"
- client @41
- supplier @31
- vertices (list Points
- (484, 626)
- (484, 347)
- (318, 347))
- line_style 3
- origin_attachment (484, 626)
- terminal_attachment (318, 347))
- (object RoleView "$UNNAMED$23" @43
- Parent_View @41
- location (50, -614)
- stereotype TRUE
- line_color 3342489
- quidu "437B59A30146"
- client @41
- supplier @40
- line_style 3
- origin_attachment (484, 626)
- terminal_attachment (484, 1072)
- label (object SegLabel @44
- Parent_View @43
- location (538, 1027)
- anchor 2
- anchor_loc 1
- nlines 1
- max_width 15
- justify 0
- label "0..*"
- pctDist 0.900000
- height 54
- orientation 0)))))))))
- logical_presentations (list unit_reference_list
- (object ClassDiagram "Main"
- quid "4362A299025A"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list
- (object CategoryView "Logical View::config" @45
- location (682, 589)
- label (object ItemLabel
- Parent_View @45
- location (538, 505)
- fill_color 13434879
- nlines 2
- max_width 288
- justify 0
- label "config")
- icon_style "Icon"
- line_color 3342489
- fill_color 13434879
- quidu "4362A2A10169"
- width 300
- height 180)))))
- root_subsystem (object SubSystem "Component View"
- quid "4362A29901BB"
- physical_models (list unit_reference_list)
- physical_presentations (list unit_reference_list
- (object Module_Diagram "Main"
- quid "4362A2990258"
- title "Main"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- process_structure (object Processes
- quid "4362A29901BC"
- ProcsNDevs (list
- (object Process_Diagram "Deployment View"
- quid "4362A29901BE"
- title "Deployment View"
- zoom 100
- max_height 28350
- max_width 21600
- origin_x 0
- origin_y 0
- items (list diagram_item_list))))
- properties (object Properties
- attributes (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "propertyId"
- value "809135969")
- (object Attribute
- tool "Ecore"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "packageName"
- value "")
- (object Attribute
- tool "Ecore"
- name "nsPrefix"
- value "")
- (object Attribute
- tool "Ecore"
- name "nsURI"
- value "")
- (object Attribute
- tool "Ecore"
- name "basePackage"
- value "")
- (object Attribute
- tool "Ecore"
- name "prefix"
- value "")
- (object Attribute
- tool "Ecore"
- name "annotation"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "classifierName"
- value "")
- (object Attribute
- tool "Ecore"
- name "constraints"
- value "")
- (object Attribute
- tool "Ecore"
- name "xmlName"
- value "")
- (object Attribute
- tool "Ecore"
- name "xmlContentKind"
- value ("ContentKind" 0))
- (object Attribute
- tool "Ecore"
- name "ContentKind"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "Unspecified"
- value 0)
- (object Attribute
- tool "Ecore"
- name "Empty"
- value 1)
- (object Attribute
- tool "Ecore"
- name "Simple"
- value 2)
- (object Attribute
- tool "Ecore"
- name "Mixed"
- value 3)
- (object Attribute
- tool "Ecore"
- name "ElementOnly"
- value 4)))
- (object Attribute
- tool "Ecore"
- name "annotation"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "operationName"
- value "")
- (object Attribute
- tool "Ecore"
- name "isUnique"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "annotation"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "attributeName"
- value "")
- (object Attribute
- tool "Ecore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isChangeable"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isUnsettable"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isUnique"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isID"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "visibility"
- value ("VisibilityKind" 0))
- (object Attribute
- tool "Ecore"
- name "VisibilityKind"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "Unspecified"
- value 0)
- (object Attribute
- tool "Ecore"
- name "None"
- value 1)
- (object Attribute
- tool "Ecore"
- name "Read-only"
- value 2)
- (object Attribute
- tool "Ecore"
- name "Read-write"
- value 3)
- (object Attribute
- tool "Ecore"
- name "Read-only unsettable"
- value 4)
- (object Attribute
- tool "Ecore"
- name "Read-write unsettable"
- value 5)))
- (object Attribute
- tool "Ecore"
- name "xmlName"
- value "")
- (object Attribute
- tool "Ecore"
- name "xmlNamespace"
- value "")
- (object Attribute
- tool "Ecore"
- name "xmlFeatureKind"
- value ("FeatureKind" 0))
- (object Attribute
- tool "Ecore"
- name "FeatureKind"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "Unspecified"
- value 0)
- (object Attribute
- tool "Ecore"
- name "Simple"
- value 1)
- (object Attribute
- tool "Ecore"
- name "Attribute"
- value 2)
- (object Attribute
- tool "Ecore"
- name "Element"
- value 4)))
- (object Attribute
- tool "Ecore"
- name "annotation"
- value "")))
- (object Attribute
- tool "Ecore"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "referenceName"
- value "")
- (object Attribute
- tool "Ecore"
- name "isTransient"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isVolatile"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isChangeable"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "isUnsettable"
- value FALSE)
- (object Attribute
- tool "Ecore"
- name "isResolveProxies"
- value TRUE)
- (object Attribute
- tool "Ecore"
- name "visibility"
- value ("VisibilityKind" 0))
- (object Attribute
- tool "Ecore"
- name "VisibilityKind"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "Unspecified"
- value 0)
- (object Attribute
- tool "Ecore"
- name "None"
- value 1)
- (object Attribute
- tool "Ecore"
- name "Read-only"
- value 2)
- (object Attribute
- tool "Ecore"
- name "Read-write"
- value 3)
- (object Attribute
- tool "Ecore"
- name "Read-only unsettable"
- value 4)
- (object Attribute
- tool "Ecore"
- name "Read-write unsettable"
- value 5)))
- (object Attribute
- tool "Ecore"
- name "xmlName"
- value "")
- (object Attribute
- tool "Ecore"
- name "xmlNamespace"
- value "")
- (object Attribute
- tool "Ecore"
- name "xmlFeatureKind"
- value ("FeatureKind" 0))
- (object Attribute
- tool "Ecore"
- name "FeatureKind"
- value (list Attribute_Set
- (object Attribute
- tool "Ecore"
- name "Unspecified"
- value 0)
- (object Attribute
- tool "Ecore"
- name "Simple"
- value 1)
- (object Attribute
- tool "Ecore"
- name "Attribute"
- value 2)
- (object Attribute
- tool "Ecore"
- name "Element"
- value 4)))
- (object Attribute
- tool "Ecore"
- name "annotation"
- value "")))
- (object Attribute
- tool "DDL"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "DDL"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "DDL"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "DDL"
- name "DataBase"
- value ("DataBaseSet" 800))
- (object Attribute
- tool "DDL"
- name "DataBaseSet"
- value (list Attribute_Set
- (object Attribute
- tool "DDL"
- name "ANSI"
- value 800)
- (object Attribute
- tool "DDL"
- name "Oracle"
- value 801)
- (object Attribute
- tool "DDL"
- name "SQLServer"
- value 802)
- (object Attribute
- tool "DDL"
- name "Sybase"
- value 803)
- (object Attribute
- tool "DDL"
- name "Watcom"
- value 804)))
- (object Attribute
- tool "DDL"
- name "PrimaryKeyColumnName"
- value "Id")
- (object Attribute
- tool "DDL"
- name "PrimaryKeyColumnType"
- value "NUMBER(5)")
- (object Attribute
- tool "DDL"
- name "ViewName"
- value "V_")
- (object Attribute
- tool "DDL"
- name "TableName"
- value "T_")
- (object Attribute
- tool "DDL"
- name "InheritSuffix"
- value "_V")
- (object Attribute
- tool "DDL"
- name "DropClause"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "BaseViews"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "DDLScriptFilename"
- value "DDL1.SQL")))
- (object Attribute
- tool "DDL"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "DDL"
- name "ColumnType"
- value "VARCHAR")
- (object Attribute
- tool "DDL"
- name "Length"
- value "")
- (object Attribute
- tool "DDL"
- name "NullsOK"
- value TRUE)
- (object Attribute
- tool "DDL"
- name "PrimaryKey"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "Unique"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "CompositeUnique"
- value FALSE)
- (object Attribute
- tool "DDL"
- name "CheckConstraint"
- value "")))
- (object Attribute
- tool "DDL"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "framework"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "IDL"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "StopOnError"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "GeneratePreserveRegions"
- value TRUE)))
- (object Attribute
- tool "IDL"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "ImplementationType"
- value "")
- (object Attribute
- tool "IDL"
- name "ConstValue"
- value "")
- (object Attribute
- tool "IDL"
- name "GenerateDefaultSpecifier"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "DefaultSpecifier"
- value "")
- (object Attribute
- tool "IDL"
- name "IDLElement"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "IDLSpecificationType"
- value ("IDLSpecSet" 22))
- (object Attribute
- tool "IDL"
- name "IDLSpecSet"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Interface"
- value 22)
- (object Attribute
- tool "IDL"
- name "Typedef"
- value 54)
- (object Attribute
- tool "IDL"
- name "Enumeration"
- value 8)
- (object Attribute
- tool "IDL"
- name "Const"
- value 71)
- (object Attribute
- tool "IDL"
- name "Exception"
- value 61)
- (object Attribute
- tool "IDL"
- name "Struct"
- value 51)
- (object Attribute
- tool "IDL"
- name "Union"
- value 81)))))
- (object Attribute
- tool "IDL"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "IDL"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "GenerateIDLModule"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "IncludeBySimpleName"
- value FALSE)))
- (object Attribute
- tool "IDL"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "IDL"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "IDL"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "IDL"
- name "IncludeBySimpleName"
- value FALSE)))
- (object Attribute
- tool "IDL"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "OperationIsOneWay"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "Context"
- value "")
- (object Attribute
- tool "IDL"
- name "Raises"
- value "")))
- (object Attribute
- tool "IDL"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "CaseSpecifier"
- value "")
- (object Attribute
- tool "IDL"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "IDL"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "IsConst"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "ConstValue"
- value "")))
- (object Attribute
- tool "IDL"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "NameIfUnlabeled"
- value "the_$supplier")
- (object Attribute
- tool "IDL"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "IDL"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "BoundedHasRelType"
- value ("HasRelTypeSet" 47))
- (object Attribute
- tool "IDL"
- name "HasRelTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Array"
- value 24)
- (object Attribute
- tool "IDL"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "IDL"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "NameIfUnlabeled"
- value "the_$supplier")
- (object Attribute
- tool "IDL"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "IDL"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "IDL"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "IDL"
- name "BoundedRoleType"
- value ("AssocTypeSet" 47))
- (object Attribute
- tool "IDL"
- name "AssocTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Array"
- value 24)
- (object Attribute
- tool "IDL"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "IDL"
- name "default__Uses"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "GenerateForwardReference"
- value FALSE)))
- (object Attribute
- tool "IDL"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "IDL"
- name "Directory"
- value "AUTO GENERATE")))
- (object Attribute
- tool "IDL"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Java"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "Java"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "Java"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "Java"
- name "UsePrefixes"
- value FALSE)
- (object Attribute
- tool "Java"
- name "InstanceVariablePrefix"
- value "m_")
- (object Attribute
- tool "Java"
- name "ClassVariablePrefix"
- value "s_")
- (object Attribute
- tool "Java"
- name "DefaultAttributeDataType"
- value "int")
- (object Attribute
- tool "Java"
- name "DefaultOperationReturnType"
- value "void")))
- (object Attribute
- tool "Java"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateDefaultConstructor"
- value TRUE)
- (object Attribute
- tool "Java"
- name "ConstructorIs"
- value ("Ctor_Set" 62))
- (object Attribute
- tool "Java"
- name "Ctor_Set"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Public"
- value 62)
- (object Attribute
- tool "Java"
- name "Protected"
- value 63)
- (object Attribute
- tool "Java"
- name "Private"
- value 64)))
- (object Attribute
- tool "Java"
- name "GenerateFinalizer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateStaticInitializer"
- value FALSE)
- (object Attribute
- tool "Java"
- name "GenerateInstanceInitializer"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Java"
- name "CmIdentification"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "AdditionalImports"
- value (value Text ""))))
- (object Attribute
- tool "Java"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "Java"
- name "CmIdentification"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "Java"
- name "AdditionalImports"
- value (value Text ""))))
- (object Attribute
- tool "Java"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "Abstract"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Static"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Native"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Synchronized"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Transient"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Volatile"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Java"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "Java"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "Java"
- name "InitialValue"
- value "")
- (object Attribute
- tool "Java"
- name "Final"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Transient"
- value FALSE)
- (object Attribute
- tool "Java"
- name "Volatile"
- value FALSE)))
- (object Attribute
- tool "Java"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "propertyId"
- value "360000002")
- (object Attribute
- tool "Oracle8"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "DDLScriptFilename"
- value "DDL1.SQL")
- (object Attribute
- tool "Oracle8"
- name "DropClause"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "PrimaryKeyColumnName"
- value "_ID")
- (object Attribute
- tool "Oracle8"
- name "PrimaryKeyColumnType"
- value "NUMBER(5,0)")
- (object Attribute
- tool "Oracle8"
- name "SchemaNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "SchemaNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TableNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TypeNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TypeNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ViewNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ViewNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "VarrayNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "VarrayNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "NestedTableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "NestedTableNameSuffix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ObjectTableNamePrefix"
- value "")
- (object Attribute
- tool "Oracle8"
- name "ObjectTableNameSuffix"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "IsSchema"
- value FALSE)))
- (object Attribute
- tool "Oracle8"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OID"
- value "")
- (object Attribute
- tool "Oracle8"
- name "WhereClause"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CheckConstraint"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypeLength"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypePrecision"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionTypeScale"
- value "")
- (object Attribute
- tool "Oracle8"
- name "CollectionOfREFS"
- value FALSE)))
- (object Attribute
- tool "Oracle8"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "MethodKind"
- value ("MethodKindSet" 1903))
- (object Attribute
- tool "Oracle8"
- name "OverloadID"
- value "")
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")
- (object Attribute
- tool "Oracle8"
- name "IsReadNoDataState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsReadNoProcessState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsWriteNoDataState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsWriteNoProcessState"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsSelfish"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "TriggerType"
- value ("TriggerTypeSet" 1801))
- (object Attribute
- tool "Oracle8"
- name "TriggerEvent"
- value ("TriggerEventSet" 1601))
- (object Attribute
- tool "Oracle8"
- name "TriggerText"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TriggerReferencingNames"
- value "")
- (object Attribute
- tool "Oracle8"
- name "TriggerForEach"
- value ("TriggerForEachSet" 1701))
- (object Attribute
- tool "Oracle8"
- name "TriggerWhenClause"
- value "")
- (object Attribute
- tool "Oracle8"
- name "MethodKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "MapMethod"
- value 1901)
- (object Attribute
- tool "Oracle8"
- name "OrderMethod"
- value 1902)
- (object Attribute
- tool "Oracle8"
- name "Function"
- value 1903)
- (object Attribute
- tool "Oracle8"
- name "Procedure"
- value 1904)
- (object Attribute
- tool "Oracle8"
- name "Operator"
- value 1905)
- (object Attribute
- tool "Oracle8"
- name "Constructor"
- value 1906)
- (object Attribute
- tool "Oracle8"
- name "Destructor"
- value 1907)
- (object Attribute
- tool "Oracle8"
- name "Trigger"
- value 1908)
- (object Attribute
- tool "Oracle8"
- name "Calculated"
- value 1909)))
- (object Attribute
- tool "Oracle8"
- name "TriggerTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "AFTER"
- value 1801)
- (object Attribute
- tool "Oracle8"
- name "BEFORE"
- value 1802)
- (object Attribute
- tool "Oracle8"
- name "INSTEAD OF"
- value 1803)))
- (object Attribute
- tool "Oracle8"
- name "TriggerForEachSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "ROW"
- value 1701)
- (object Attribute
- tool "Oracle8"
- name "STATEMENT"
- value 1702)))
- (object Attribute
- tool "Oracle8"
- name "TriggerEventSet"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "INSERT"
- value 1601)
- (object Attribute
- tool "Oracle8"
- name "UPDATE"
- value 1602)
- (object Attribute
- tool "Oracle8"
- name "DELETE"
- value 1603)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR UPDATE"
- value 1604)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR DELETE"
- value 1605)
- (object Attribute
- tool "Oracle8"
- name "UPDATE OR DELETE"
- value 1606)
- (object Attribute
- tool "Oracle8"
- name "INSERT OR UPDATE OR DELETE"
- value 1607)))))
- (object Attribute
- tool "Oracle8"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Oracle8"
- name "OrderNumber"
- value "")
- (object Attribute
- tool "Oracle8"
- name "IsUnique"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "NullsAllowed"
- value TRUE)
- (object Attribute
- tool "Oracle8"
- name "Length"
- value "")
- (object Attribute
- tool "Oracle8"
- name "Precision"
- value "2")
- (object Attribute
- tool "Oracle8"
- name "Scale"
- value "6")
- (object Attribute
- tool "Oracle8"
- name "IsIndex"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "IsPrimaryKey"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "CompositeUnique"
- value FALSE)
- (object Attribute
- tool "Oracle8"
- name "CheckConstraint"
- value "")))
- (object Attribute
- tool "Oracle8"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Repository"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "cg"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "cg"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "UseMSVC"
- value FALSE)
- (object Attribute
- tool "cg"
- name "HeaderFileExtension"
- value "h")
- (object Attribute
- tool "cg"
- name "HeaderFileBackupExtension"
- value "h~")
- (object Attribute
- tool "cg"
- name "HeaderFileTemporaryExtension"
- value "h#")
- (object Attribute
- tool "cg"
- name "CodeFileExtension"
- value "cpp")
- (object Attribute
- tool "cg"
- name "CodeFileBackupExtension"
- value "cp~")
- (object Attribute
- tool "cg"
- name "CodeFileTemporaryExtension"
- value "cp#")
- (object Attribute
- tool "cg"
- name "CreateMissingDirectories"
- value TRUE)
- (object Attribute
- tool "cg"
- name "StopOnError"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ErrorLimit"
- value 30)
- (object Attribute
- tool "cg"
- name "Directory"
- value "$ROSECPP_SOURCE")
- (object Attribute
- tool "cg"
- name "PathSeparator"
- value "")
- (object Attribute
- tool "cg"
- name "FileNameFormat"
- value "128vx_b")
- (object Attribute
- tool "cg"
- name "BooleanType"
- value "int")
- (object Attribute
- tool "cg"
- name "AllowTemplates"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AllowExplicitInstantiations"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AllowProtectedInheritance"
- value TRUE)
- (object Attribute
- tool "cg"
- name "CommentWidth"
- value 60)
- (object Attribute
- tool "cg"
- name "OneByValueContainer"
- value "$targetClass")
- (object Attribute
- tool "cg"
- name "OneByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "OptionalByValueContainer"
- value "OptionalByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "OptionalByReferenceContainer"
- value "$targetClass *")
- (object Attribute
- tool "cg"
- name "FixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByValueContainer"
- value "$targetClass[$limit]")
- (object Attribute
- tool "cg"
- name "FixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "UnorderedFixedByReferenceContainer"
- value "$targetClass *[$limit]")
- (object Attribute
- tool "cg"
- name "BoundedByValueContainer"
- value "BoundedListByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByValueContainer"
- value "BoundedSetByValue<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "BoundedByReferenceContainer"
- value "BoundedListByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnorderedBoundedByReferenceContainer"
- value "BoundedSetByReference<$targetClass,$limit>")
- (object Attribute
- tool "cg"
- name "UnboundedByValueContainer"
- value "UnboundedListByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByValueContainer"
- value "UnboundedSetByValue<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnboundedByReferenceContainer"
- value "UnboundedListByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "UnorderedUnboundedByReferenceContainer"
- value "UnboundedSetByReference<$targetClass>")
- (object Attribute
- tool "cg"
- name "QualifiedByValueContainer"
- value "AssociationByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByValueContainer"
- value "DictionaryByValue<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "QualifiedByReferenceContainer"
- value "AssociationByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "UnorderedQualifiedByReferenceContainer"
- value "DictionaryByReference<$qualtype, $qualcont>")
- (object Attribute
- tool "cg"
- name "GeneratePreserveRegions"
- value TRUE)))
- (object Attribute
- tool "cg"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "ImplementationType"
- value "")
- (object Attribute
- tool "cg"
- name "ClassKey"
- value "class")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "PutBodiesInSpec"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDefaultConstructor"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "DefaultConstructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ExplicitDefaultConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateCopyConstructor"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "CopyConstructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineCopyConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ExplicitCopyConstructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDestructor"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DestructorVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "DestructorKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineDestructor"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateAssignmentOperation"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "AssignmentVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "AssignmentKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineAssignmentOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateEqualityOperations"
- value ("GenerateSet" 199))
- (object Attribute
- tool "cg"
- name "EqualityVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "EqualityKind"
- value ("FriendKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineEqualityOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateRelationalOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "RelationalVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "RelationalKind"
- value ("FriendKindSet" 200))
- (object Attribute
- tool "cg"
- name "InlineRelationalOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateStorageMgmtOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "StorageMgmtVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineStorageMgmtOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateSubscriptOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "SubscriptVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "SubscriptKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "SubscriptResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineSubscriptOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateDereferenceOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DereferenceVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "DereferenceKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "DereferenceResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineDereferenceOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateIndirectionOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IndirectionVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "IndirectionKind"
- value ("ThreeKindSet" 200))
- (object Attribute
- tool "cg"
- name "IndirectionResultType"
- value "")
- (object Attribute
- tool "cg"
- name "InlineIndirectionOperation"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateStreamOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "StreamVisibility"
- value ("VisibilitySet" 45))
- (object Attribute
- tool "cg"
- name "InlineStreamOperations"
- value FALSE)
- (object Attribute
- tool "cg"
- name "ThreeKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)))
- (object Attribute
- tool "cg"
- name "KindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)))
- (object Attribute
- tool "cg"
- name "FriendKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GenerateSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "DeclareAndDefine"
- value 199)
- (object Attribute
- tool "cg"
- name "DeclareOnly"
- value 205)
- (object Attribute
- tool "cg"
- name "DoNotDeclare"
- value 206)))
- (object Attribute
- tool "cg"
- name "VisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)))
- (object Attribute
- tool "cg"
- name "ConstValue"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateDefaultSpecifier"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DefaultSpecifier"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "cg"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "AllowExtensionlessFileName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InclusionProtectionSymbol"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "IncludeFormat"
- value (value Text
-|// $package
-|#include "$file"
-|
- ))
- (object Attribute
- tool "cg"
- name "IncludeBySimpleName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludePrecompiledHeader"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludeOrder"
- value "AMIR")
- (object Attribute
- tool "cg"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "InliningStyle"
- value ("InliningStyleSet" 207))
- (object Attribute
- tool "cg"
- name "InliningStyleSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InClassDeclaration"
- value 208)
- (object Attribute
- tool "cg"
- name "FollowingClassDeclaration"
- value 207)))
- (object Attribute
- tool "cg"
- name "TypesDefined"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "IncludeClosure"
- value (value Text ""))))
- (object Attribute
- tool "cg"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Generate"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "CmIdentification"
- value (value Text " %X% %Q% %Z% %W%"))
- (object Attribute
- tool "cg"
- name "CopyrightNotice"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "FileName"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "AllowExtensionlessFileName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludeFormat"
- value (value Text
-|// $package
-|#include "$file"
-|
- ))
- (object Attribute
- tool "cg"
- name "IncludeBySimpleName"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IncludePrecompiledHeader"
- value TRUE)
- (object Attribute
- tool "cg"
- name "IncludeOrder"
- value "AMIR")
- (object Attribute
- tool "cg"
- name "AdditionalIncludes"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "InliningStyle"
- value ("InliningStyleSet" 207))
- (object Attribute
- tool "cg"
- name "InliningStyleSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InClassDeclaration"
- value 208)
- (object Attribute
- tool "cg"
- name "FollowingClassDeclaration"
- value 207)))
- (object Attribute
- tool "cg"
- name "TypesDefined"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "IncludeClosure"
- value (value Text ""))))
- (object Attribute
- tool "cg"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "OperationKind"
- value ("OperationKindSet" 200))
- (object Attribute
- tool "cg"
- name "OperationKindSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "OperationIsConst"
- value FALSE)
- (object Attribute
- tool "cg"
- name "OperationIsExplicit"
- value FALSE)
- (object Attribute
- tool "cg"
- name "Inline"
- value FALSE)
- (object Attribute
- tool "cg"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "ExitCode"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))
- (object Attribute
- tool "cg"
- name "BodyAnnotations"
- value "")
- (object Attribute
- tool "cg"
- name "OperationIsOneWay"
- value FALSE)
- (object Attribute
- tool "cg"
- name "Context"
- value "")
- (object Attribute
- tool "cg"
- name "Raises"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "Ordered"
- value TRUE)
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$supplier")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "InitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$relationship")
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$relationship")
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "cg"
- name "SelectorName"
- value "")
- (object Attribute
- tool "cg"
- name "SelectorType"
- value "")
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "BoundedHasRelType"
- value ("HasRelTypeSet" 47))
- (object Attribute
- tool "cg"
- name "HasRelTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Array"
- value 24)
- (object Attribute
- tool "cg"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "cg"
- name "default__Association"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$targetClass")))
- (object Attribute
- tool "cg"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "InstanceArguments"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "NameIfUnlabeled"
- value "the_$targetClass")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$target")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "InitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "ContainerClass"
- value "")
- (object Attribute
- tool "cg"
- name "ContainerGet"
- value "$data.get($keys)")
- (object Attribute
- tool "cg"
- name "ContainerSet"
- value "$data.set($keys,$value)")
- (object Attribute
- tool "cg"
- name "QualifiedContainer"
- value "")
- (object Attribute
- tool "cg"
- name "AssocClassContainer"
- value "$supplier *")
- (object Attribute
- tool "cg"
- name "AssocClassInitialValue"
- value (value Text ""))
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetSetByReference"
- value ("QualifiedGetSetByReferenceSet" 2))
- (object Attribute
- tool "cg"
- name "QualifiedGetSetByReferenceSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_GetSetByReference"
- value 2)))
- (object Attribute
- tool "cg"
- name "GenerateQualifiedGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "QualifiedGetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedGetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "InlineQualifiedGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateQualifiedSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "QualifiedSetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "QualifiedSetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineQualifiedSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateAssocClassDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberName"
- value "$target")
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtRelationshipVisibility"
- value 210)))
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "AssocClassDataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "AssocClassGetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GenerateAssocClassGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassGetName"
- value "get_$target")
- (object Attribute
- tool "cg"
- name "AssocClassGetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassGetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "InlineAssocClassGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateAssocClassSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassSetName"
- value "set_$target")
- (object Attribute
- tool "cg"
- name "AssocClassSetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineAssocClassSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "AssocClassForwardReferenceOnly"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateForwardReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "IsReadOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "BoundedRoleType"
- value ("AssocTypeSet" 47))
- (object Attribute
- tool "cg"
- name "AssocTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Array"
- value 24)
- (object Attribute
- tool "cg"
- name "Sequence"
- value 47)))))
- (object Attribute
- tool "cg"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "cg"
- name "DataMemberName"
- value "$attribute")
- (object Attribute
- tool "cg"
- name "DataMemberVisibility"
- value ("DataMemberVisibilitySet" 14))
- (object Attribute
- tool "cg"
- name "DataMemberVisibilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Public"
- value 45)
- (object Attribute
- tool "cg"
- name "Protected"
- value 44)
- (object Attribute
- tool "cg"
- name "Private"
- value 43)
- (object Attribute
- tool "cg"
- name "Implementation"
- value 14)
- (object Attribute
- tool "cg"
- name "AtAttributeVisibility"
- value 211)))
- (object Attribute
- tool "cg"
- name "DataMemberMutability"
- value ("DataMemberMutabilitySet" 0))
- (object Attribute
- tool "cg"
- name "DataMemberMutabilitySet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Unrestricted"
- value 0)
- (object Attribute
- tool "cg"
- name "Mutable"
- value 1)
- (object Attribute
- tool "cg"
- name "Const"
- value 2)))
- (object Attribute
- tool "cg"
- name "DataMemberIsVolatile"
- value FALSE)
- (object Attribute
- tool "cg"
- name "DataMemberFieldSize"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateGetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GenerateSetOperation"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetName"
- value "get_$attribute")
- (object Attribute
- tool "cg"
- name "SetName"
- value "set_$attribute")
- (object Attribute
- tool "cg"
- name "GetSetKinds"
- value ("GetSetKindsSet" 200))
- (object Attribute
- tool "cg"
- name "GetSetKindsSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Common"
- value 200)
- (object Attribute
- tool "cg"
- name "Virtual"
- value 201)
- (object Attribute
- tool "cg"
- name "Abstract"
- value 202)
- (object Attribute
- tool "cg"
- name "Static"
- value 203)
- (object Attribute
- tool "cg"
- name "Friend"
- value 204)))
- (object Attribute
- tool "cg"
- name "GetIsConst"
- value TRUE)
- (object Attribute
- tool "cg"
- name "GetResultIsConst"
- value ("GetResultIsConstSet" 2))
- (object Attribute
- tool "cg"
- name "GetResultIsConstSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "False"
- value 0)
- (object Attribute
- tool "cg"
- name "True"
- value 1)
- (object Attribute
- tool "cg"
- name "Same_As_Function"
- value 2)))
- (object Attribute
- tool "cg"
- name "GetSetByReference"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineGet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "SetReturnsValue"
- value FALSE)
- (object Attribute
- tool "cg"
- name "InlineSet"
- value TRUE)
- (object Attribute
- tool "cg"
- name "CaseSpecifier"
- value "")
- (object Attribute
- tool "cg"
- name "IsReadOnly"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "default__Uses"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "ForwardReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "BodyReferenceOnly"
- value FALSE)
- (object Attribute
- tool "cg"
- name "GenerateForwardReference"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "default__Subsystem"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "Directory"
- value "AUTO GENERATE")
- (object Attribute
- tool "cg"
- name "DirectoryIsOnSearchList"
- value FALSE)
- (object Attribute
- tool "cg"
- name "PrecompiledHeader"
- value "")))
- (object Attribute
- tool "cg"
- name "default__Category"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "IsNamespace"
- value FALSE)
- (object Attribute
- tool "cg"
- name "Indent"
- value 2)
- (object Attribute
- tool "cg"
- name "CodeName"
- value "")
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegions"
- value ("GenerateEmptyRegionSet" 3))
- (object Attribute
- tool "cg"
- name "GenerateEmptyRegionSet"
- value (list Attribute_Set
- (object Attribute
- tool "cg"
- name "None"
- value 0)
- (object Attribute
- tool "cg"
- name "Preserved"
- value 1)
- (object Attribute
- tool "cg"
- name "Unpreserved"
- value 2)
- (object Attribute
- tool "cg"
- name "All"
- value 3)))))
- (object Attribute
- tool "MSVC"
- name "propertyId"
- value "809135966")
- (object Attribute
- tool "MSVC"
- name "default__Project"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Version"
- value "5.0")))
- (object Attribute
- tool "MSVC"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCClassTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCClassTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Interface_Part"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Connection_Part"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Class_Factory"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "CObjectFunctionality"
- value ("CObjectFunctionalitySet" 0))
- (object Attribute
- tool "MSVC"
- name "CObjectFunctionalitySet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "None"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Dynamic"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Dyncreate"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Serial"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "GenerateOverrideGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "GenerateDataGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DATA_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateFieldGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_FIELD_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateMessageGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "GenerateMessageMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MESSAGE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "OLEFactory"
- value ("OLEFactorySet" 0))
- (object Attribute
- tool "MSVC"
- name "OLEFactorySet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "None"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Built_in"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Simple"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Licensed"
- value 3)))
- (object Attribute
- tool "MSVC"
- name "OLEName"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLEClassID"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateOLECtlType"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLECtlType"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateOLETypeLib"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLETypeLibID"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLETypeLibMajor"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLETypeLibMinor"
- value "")
- (object Attribute
- tool "MSVC"
- name "GeneratePropPageIDs"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "OLEPropPageIDs"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateDispatchMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockProperties"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockFunctions"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DispatchDefValue"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateDispIdEnum"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_DISP_ID_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInterfaceMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "INTERFACE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "InitInterface"
- value "")
- (object Attribute
- tool "MSVC"
- name "GenerateEventMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "StockEvents"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateEventSinkMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "PropNotifySinks"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateConnectionMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "CONNECTION_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "ConnectionPointIID"
- value "")
- (object Attribute
- tool "MSVC"
- name "InheritanceType"
- value "")
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "OLECommands"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MFCDeclares"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MFCImplements"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "ATL_Declares"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateCOMMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "COM_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateConnectionPointMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "CONNECTION_POINT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateMsgMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GeneratePropertyMap"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "PROPERTY_MAP_Entries"
- value (value Text ""))))
- (object Attribute
- tool "MSVC"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCOperationTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCOperationTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Virtual_Override"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Message_Handler"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dispatch_Handler"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Event_Firing_Function"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Event_Sink_Handler"
- value 5)
- (object Attribute
- tool "MSVC"
- name "Std_OLE_Method"
- value 6)
- (object Attribute
- tool "MSVC"
- name "Command_Parser"
- value 7)
- (object Attribute
- tool "MSVC"
- name "Property_Get_Function"
- value 8)
- (object Attribute
- tool "MSVC"
- name "Property_Set_Function"
- value 9)
- (object Attribute
- tool "MSVC"
- name "Property_Notify_Function"
- value 10)
- (object Attribute
- tool "MSVC"
- name "Macro_Generated_Function"
- value 11)))
- (object Attribute
- tool "MSVC"
- name "AFX_MSG_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "MESSAGE_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENT_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "AFX_EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "EVENTSINK_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "BodyImage"
- value (value Text ""))))
- (object Attribute
- tool "MSVC"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Has"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Type"
- value ("MSVCAttributeTypeSet" 0))
- (object Attribute
- tool "MSVC"
- name "MSVCAttributeTypeSet"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "Normal"
- value 0)
- (object Attribute
- tool "MSVC"
- name "Member_Property"
- value 1)
- (object Attribute
- tool "MSVC"
- name "Get_Set_Property"
- value 2)
- (object Attribute
- tool "MSVC"
- name "Dialog_Data"
- value 3)
- (object Attribute
- tool "MSVC"
- name "Field_Data"
- value 4)
- (object Attribute
- tool "MSVC"
- name "Stock_Property"
- value 5)))
- (object Attribute
- tool "MSVC"
- name "AFX_DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DISPATCH_MAP_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "DeclSpec"
- value "")
- (object Attribute
- tool "MSVC"
- name "PointerBase"
- value "")
- (object Attribute
- tool "MSVC"
- name "CallType"
- value "")
- (object Attribute
- tool "MSVC"
- name "StockPropertyImplementation"
- value "")))
- (object Attribute
- tool "MSVC"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "GenerateIncludesGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_INCLUDES_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInsertLocation"
- value FALSE)))
- (object Attribute
- tool "MSVC"
- name "default__Module-Body"
- value (list Attribute_Set
- (object Attribute
- tool "MSVC"
- name "GenerateIncludesGroup"
- value FALSE)
- (object Attribute
- tool "MSVC"
- name "AFX_INCLUDES_Entries"
- value (value Text ""))
- (object Attribute
- tool "MSVC"
- name "GenerateInsertLocation"
- value FALSE)))
- (object Attribute
- tool "cg"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "SCC"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "TypeLibImporter"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "propertyId"
- value "783606378")
- (object Attribute
- tool "Visual Basic"
- name "default__Class"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "CreatableSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "Private"
- value 221)
- (object Attribute
- tool "Visual Basic"
- name "PublicNotCreatable"
- value 213)
- (object Attribute
- tool "Visual Basic"
- name "SingleUse"
- value 214)
- (object Attribute
- tool "Visual Basic"
- name "GlobalSingleUse"
- value 215)
- (object Attribute
- tool "Visual Basic"
- name "MultiUse"
- value 219)
- (object Attribute
- tool "Visual Basic"
- name "GlobalMultiUse"
- value 220)))
- (object Attribute
- tool "Visual Basic"
- name "OptionBase"
- value "0")
- (object Attribute
- tool "Visual Basic"
- name "OptionExplicit"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "OptionCompare"
- value ("CompareSet" 202))
- (object Attribute
- tool "Visual Basic"
- name "Creatable"
- value ("CreatableSet" 221))
- (object Attribute
- tool "Visual Basic"
- name "GenerateInitialization"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "GenerateTermination"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "CollectionClass"
- value "Collection")
- (object Attribute
- tool "Visual Basic"
- name "CompareSet"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "None"
- value 202)
- (object Attribute
- tool "Visual Basic"
- name "Binary"
- value 203)
- (object Attribute
- tool "Visual Basic"
- name "Text"
- value 204)))))
- (object Attribute
- tool "Visual Basic"
- name "default__Operation"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "OperationName"
- value "$operation")
- (object Attribute
- tool "Visual Basic"
- name "LibraryName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "AliasName"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "IsStatic"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "EntryCode"
- value (value Text ""))
- (object Attribute
- tool "Visual Basic"
- name "ExitCode"
- value (value Text ""))))
- (object Attribute
- tool "Visual Basic"
- name "default__Attribute"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "IsConst"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "New"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "WithEvents"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "Subscript"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "NameIfUnlabeled"
- value "the$supplier")
- (object Attribute
- tool "Visual Basic"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "Visual Basic"
- name "GenerateGetOperation"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "GenerateSetOperation"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "GenerateLetOperation"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "default__Role"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "New"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "WithEvents"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "Subscript"
- value "")
- (object Attribute
- tool "Visual Basic"
- name "NameIfUnlabeled"
- value "the$supplier")
- (object Attribute
- tool "Visual Basic"
- name "GenerateDataMember"
- value TRUE)
- (object Attribute
- tool "Visual Basic"
- name "DataMemberName"
- value "$relationship")
- (object Attribute
- tool "Visual Basic"
- name "GenerateGetOperation"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "GenerateSetOperation"
- value FALSE)
- (object Attribute
- tool "Visual Basic"
- name "GenerateLetOperation"
- value FALSE)))
- (object Attribute
- tool "Visual Basic"
- name "default__Inherit"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ImplementsDelegation"
- value TRUE)))
- (object Attribute
- tool "Visual Basic"
- name "default__Module-Spec"
- value (list Attribute_Set
- (object Attribute
- tool "Visual Basic"
- name "ProjectFile"
- value "")))
- (object Attribute
- tool "Visual Basic"
- name "HiddenTool"
- value FALSE)
- (object Attribute
- tool "VisualStudio"
- name "HiddenTool"
- value FALSE))
- quid "4362A29901BD"))
diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/BestPracticeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/BestPracticeTests.java deleted file mode 100644 index e7ef22d79f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/BestPracticeTests.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.List; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.DepEmpData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.EmployeeData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class BestPracticeTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new EmployeeData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - new DepEmpData(getAutoConnection()).refresh(); - - } - - //Read list of companies - public void testReadCompanies() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - Command read = commandGroup.getCommand("all companies"); - DataObject root = read.executeQuery(); - assertEquals(3, root.getList("COMPANY").size()); - - } - - //Read list of companies - public void testReadCompaniesWithDepartments() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - Command read = commandGroup.getCommand("all companies and departments"); - DataObject root = read.executeQuery(); - DataObject firstCompany = root.getDataObject("COMPANY[1]"); - List departments = firstCompany.getList("departments"); - assertEquals(0, departments.size()); - - } - - public void testddDepartmentToFirstCompany() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - Command read = commandGroup.getCommand("all companies and departments"); - DataObject root = read.executeQuery(); - DataObject firstCustomer = root.getDataObject("COMPANY[1]"); - int deptCount = firstCustomer.getList("departments").size(); - - DataObject newDepartment = root.createDataObject("DEPARTMENT"); - firstCustomer.getList("departments").add(newDepartment); - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - //verify - root = read.executeQuery(); - firstCustomer = root.getDataObject("COMPANY[1]"); - assertEquals (deptCount + 1, firstCustomer.getList("departments").size()); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CUDGeneration.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CUDGeneration.java deleted file mode 100644 index cfaed48db2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CUDGeneration.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class CUDGeneration extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - } - - /** - * This tests provides invalid SQL and should fail on Apply.execute. If not - * then the engine is generating CUD and overlooking the provided - * statements. - */ - public void testCUDGeneration1() throws Exception { - - // Read customer with particular ID - Command select = Command.FACTORY - .createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get("CUSTOMER[1]"); - - // Modify customer - customer.set("LASTNAME", "Pavick"); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY - .createApplyChangesCommand(getConfig("basicCustomerMappingWithInvalidCUD.xml")); - apply.setConnection(getConnection()); - - // Flush changes - try { - apply.execute(root); - fail("Should fail with invalid SQL. Provided CUD not used!!"); - } catch (RuntimeException e) { - // Everything OK - } - - } - - public void testInsertCUDGeneration() throws Exception { - Command select = Command.FACTORY - .createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject customer = root.createDataObject("CUSTOMER"); - customer.setInt("ID", 720); - customer.set("LASTNAME", "foobar"); - customer.set("ADDRESS", "asdfasdf"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.setConnection(getConnection()); - apply.execute(root); - - select = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 720"); - select.setConnection(getConnection()); - root = select.executeQuery(); - - assertEquals(1, root.getList("CUSTOMER").size()); - } - - public void testReadModifyApply() throws Exception { - - // Build the select command to read a specific customer and related - // orders - Command select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID", - getConfig("1xM_mapping_no_cud.xml")); - - // Parameterize the command - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - - // Get the graph - DataObject root = select.executeQuery(); - - // Modify a customer - DataObject customer = (DataObject) root.get("Customer[1]"); - customer.set("LASTNAME", "Pavick"); - - // Modify an order - DataObject order = (DataObject) customer.get("orders[1]"); - order.setString("PRODUCT", "Kitchen Sink 001"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.setMapping(getConfig("1xM_mapping_no_cud.xml")); - - // Flush changes - apply.execute(root); - - } - - /** - * Same as previous version but uses explicit model creation - */ - public void testReadModifyApply2() throws Exception { - - // Build the select command - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - - // Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - // Parameterize the command - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - - // Get the graph - DataObject root = select.executeQuery(); - - // Modify a customer - DataObject customer = (DataObject) root.get("CUSTOMER[1]"); - customer.set("LASTNAME", "Pavick"); - - // Modify an order - DataObject order = (DataObject) customer.getList("ANORDER").get(0); - order.setString("PRODUCT", "Kitchen Sink 001"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.addPrimaryKey("ANORDER.ID"); - // Flush changes - apply.execute(root); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CommandGroupTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CommandGroupTests.java deleted file mode 100644 index dcadd27d2f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CommandGroupTests.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This test - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -/** - * - * This tests use of the XML Config file. Tests will utilize the - * customer-orders-orderdetails tables. The plan is for the config file to have - * a section that applies to all commands and another that applies to specific - * commands. - * - * The config file will be used to initialize a command factory that will then - * return named commands. - * - * There will be two read commands: - * - * 1) Return all customers 2) Return a specific customer (by ID) and related - * orders and order details - * - * A test will demonstrate the creation of the factory and then reuse of - * commands created from the same config data file - * - */ -public class CommandGroupTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read - */ - public void testRead() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - - assertEquals(5, root.getList("CUSTOMER").size()); - - } - - /** - * Read an order using parm marker - */ - public void testReadWithParmmarker() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustOrdersConnectionProps.xml")); - - Command read = commandGroup.getCommand("order by id with ?"); - read.setParameterValue(1, new Integer(1)); - DataObject root = read.executeQuery(); - - assertEquals("recombobulator", root.getString("ANORDER[1]/PRODUCT")); - - } - - /** - * Specify connection properties in config - */ - public void testReadWithConnectionProperties() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustOrdersConnectionProps.xml")); - - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - - assertEquals(5, root.getList("CUSTOMER").size()); - - } - - /** - * Specify connection properties in config. Add explicit update command - */ - public void testUpdate() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustOrdersConnectionProps.xml")); - - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - // Verify precondition - assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick")); - int id = root.getInt("CUSTOMER[1]/ID"); - - Command update = commandGroup.getCommand("update customer"); - update.setParameterValue("ID", new Integer(id)); - update.execute(); - - // Verify update - reuse select command - root = read.executeQuery(); - assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME")); - - } - - /** - * Read all customers, select a specific customer. Then read that customer - * and related orders. Modify an order and flush changes back - */ - public void testRead2() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - // Read all customers and remember the first one - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - Integer id = (Integer) root.get("CUSTOMER[1]/ID"); - - // Read the specific Customer from above and its related orders - Command custOrders = commandGroup.getCommand("customer and orders"); - custOrders.setParameterValue("ID", id); - root = custOrders.executeQuery(); - - // Modify the first order and flush this change back to the database - root.setString("CUSTOMER[1]/orders[1]/PRODUCT", "Defibrillator"); - Integer orderId = (Integer) root.get("CUSTOMER[1]/orders[1]/ID"); - ApplyChangesCommand flush = commandGroup.getApplyChangesCommand(); - flush.execute(root); - - // Verify - Command orderByID = commandGroup.getCommand("order by id"); - orderByID.setParameterValue("ID", orderId); - assertEquals("Defibrillator", root.getString("ANORDER[1]/PRODUCT")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java deleted file mode 100644 index 3abbbc1b4c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.company.CompanyFactory; -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DatagraphRoot; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.DepEmpData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.EmployeeData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.TypeHelper; - -public class CompanyTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new EmployeeData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - new DepEmpData(getAutoConnection()).refresh(); - - } - - public void testSimple() throws Exception { - - // Build the select command - Command selectCommand = Command.FACTORY.createCommand("select COMPANY.NAME, " - + "EMPLOYEE.NAME, EMPLOYEE.SN, EMPLOYEE.MANAGER, " - + "DEPARTMENT.NAME, DEPARTMENT.LOCATION, DEPARTMENT.NUMBER from COMPANY, DEPARTMENT, EMPLOYEE " - + "where COMPANY.ID=DEPARTMENT.COMPANYID and DEPARTMENT.ID=EMPLOYEE.DEPARTMENTID", getConfig("companyMapping.xml")); - - // Parameterize the command - selectCommand.setConnection(getConnection()); - - // Get the graph - DataObject root = selectCommand.executeQuery(); - - // Get a company - DataObject company = (DataObject) root.getList("CompanyType").get(0); - assertEquals("MegaCorp", company.get("NAME")); - - // Get a department - DataObject department = (DataObject) company.getList("departments").get(0); - assertEquals("Advanced Technologies", department.get("NAME")); - - DataObject employee = (DataObject) department.getList("employees").get(0); - assertEquals("John Jones", employee.get("NAME")); - } - - public void testSimpleStatic() throws Exception { - - SDOUtil.registerStaticTypes(CompanyFactory.class); - // Build the select command - Command selectCommand = Command.FACTORY.createCommand("select COMPANY.NAME, " - + "EMPLOYEE.NAME, EMPLOYEE.SN, EMPLOYEE.MANAGER, " - + "DEPARTMENT.NAME, DEPARTMENT.LOCATION, DEPARTMENT.NUMBER from COMPANY, DEPARTMENT, EMPLOYEE " - + "where COMPANY.ID=DEPARTMENT.COMPANYID and DEPARTMENT.ID=EMPLOYEE.DEPARTMENTID", getConfig("companyMapping.xml")); - - // Parameterize the command - selectCommand.setConnection(getConnection()); - selectCommand.setDataObjectModel(TypeHelper.INSTANCE.getType(DatagraphRoot.class)); - selectCommand.addConverter("DEPARTMENT.NUMBER", "org.apache.tuscany.das.rdb.test.mappings.StringToIntegerConverter"); - selectCommand.addConverter("EMPLOYEE.MANAGER", "org.apache.tuscany.das.rdb.test.mappings.IntegerToBooleanConverter"); - - // Get the graph - DatagraphRoot root = (DatagraphRoot) selectCommand.executeQuery(); - - - CompanyType company = (CompanyType) root.getCompanies().get(0); - - assertEquals("MegaCorp", company.getName()); - - // Get a department - DepartmentType department = (DepartmentType) company.getDepartments().get(0); - assertEquals("Advanced Technologies", department.getName()); - - EmployeeType employee = (EmployeeType) department.getEmployees().get(0); - - assertEquals("John Jones", employee.getName()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompoundKeyTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompoundKeyTests.java deleted file mode 100644 index 80f08b2eed..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompoundKeyTests.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.test.data.OrderDetailsData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -/** - * Tests for Compound Keys - */ -public class CompoundKeyTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new OrderDetailsData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testRead() throws Exception { - - Command getOrderDetails = Command.FACTORY - .createCommand("Select * from ORDERDETAILS where ORDERID = :ORDERID AND PRODUCTID = :PRODUCTID"); - getOrderDetails.setConnection(getConnection()); - - getOrderDetails.setParameterValue("ORDERID", new Integer(1)); - getOrderDetails.setParameterValue("PRODUCTID", new Integer(1)); - - DataObject root = getOrderDetails.executeQuery(); - - DataObject orderDetail = (DataObject) root.get("ORDERDETAILS[1]"); - assertEquals(1.1f, orderDetail.getFloat("PRICE"), 0.01); - - } - - public void testReadModifyWrite() throws Exception { - - Command getOrderDetails = Command.FACTORY - .createCommand("Select * from ORDERDETAILS where ORDERID = 1 AND PRODUCTID = 1"); - getOrderDetails.setConnection(getConnection()); - DataObject root = getOrderDetails.executeQuery(); - - DataObject orderDetails = (DataObject) root.get("ORDERDETAILS[1]"); - assertEquals(1.1f, orderDetails.getFloat("PRICE"), 0.01); - - // Modify - orderDetails.setFloat("PRICE", 0f); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - // programatically add the only part of the mapping model needed for - // this simple case - apply.addPrimaryKey(new Key(new String[] { "ORDERDETAILS.ORDERID", "ORDERDETAILS.PRODUCTID" })); - - // Write - apply.execute(root); - - // Verify - orderDetails = root.getDataObject("ORDERDETAILS[1]"); - assertEquals(0f, orderDetails.getFloat("PRICE"), 0.01); - - } - - public void testReadOrdersAndDetails() throws Exception { - - Command read = Command.FACTORY - .createCommand("SELECT * FROM ANORDER LEFT JOIN ORDERDETAILS ON ANORDER.ID = ORDERDETAILS.ORDERID ORDER BY ANORDER.ID"); - read.setConnection(getConnection()); - - Key pk = new Key("ANORDER.ID"); - read.addPrimaryKey(pk); - - - //TODO - When this is omitted, we fail with NPE. Need a better error message - Key detailsPk = new Key(new String[] { "ORDERDETAILS.ORDERID", "ORDERDETAILS.PRODUCTID" }); - read.addPrimaryKey(detailsPk); - - Key fk = new Key("ORDERDETAILS.ORDERID"); - - read.addRelationship(pk, fk); - - DataObject root = read.executeQuery(); - - DataObject firstOrder = root.getDataObject("ANORDER[1]"); - assertEquals(1, firstOrder.getInt("ID")); - assertEquals(2, firstOrder.getList("ORDERDETAILS").size()); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java deleted file mode 100644 index f16ba34671..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * Tests the Converter framwork - */ -public class ConverterTests extends DasTest { - - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - - protected void tearDown() throws Exception { - super.tearDown(); - } - - private static DateFormat myformat = new SimpleDateFormat("yyyy.MM.dd"); - - private static Date kbday; - private static Date tbday; - - static { - try { - kbday = myformat.parse("1957.09.27"); - tbday = myformat.parse("1966.12.20"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - - - /** - * This tests the use of an arbitrary converter. The column converted is a VARCAHAR. - * ResultSetShape is used to specify that the property will be a SDODataTypes.DATE. - * - * So this example uses a converter that transforms a string column into a date property - * and conversely, a date property back to a string for the underlying column. - * - * The converter returns 1957.09.27 if the column value is "Williams" and 1966.12.20 - * if the value is "Pavick" - * - * On write, the converter returns "Pavick" if the property value is 1966.12.20 - * and "Williams" if the property value is 1957.09.27 - * - */ - public void testArbitraryConverter() throws Exception { - - //Create and initialize command to read customers - Command read = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 1"); - read.setConnection(getConnection()); - - String[] columns = { "ID", "LASTNAME", "ADDRESS" }; - String[] tables = { "CUSTOMER", "CUSTOMER", "CUSTOMER" }; - Type[] types = { SDODataTypes.INTEGEROBJECT, SDODataTypes.DATE, SDODataTypes.STRING }; - ResultSetShape shape = new ResultSetShape(tables, columns, types); - read.setResultSetShape(shape); - - read.addConverter("CUSTOMER.LASTNAME", "org.apache.tuscany.das.rdb.test.mappings.SillyDateStringConverter"); - - //Read - DataObject root = read.executeQuery(); - - //Verify - assertEquals(kbday, root.getDate("CUSTOMER[1]/LASTNAME")); - - //Modify - root.setDate("CUSTOMER[1]/LASTNAME", tbday); - - ApplyChangesCommand write = Command.FACTORY.createApplyChangesCommand(); - write.addPrimaryKey("CUSTOMER.ID"); - write.setConnection(getConnection()); - write.addConverter("CUSTOMER.LASTNAME", "org.apache.tuscany.das.rdb.test.mappings.SillyDateStringConverter"); - write.execute(root); - - //Read - root = read.executeQuery(); - - //Verify - assertEquals(tbday, root.getDate("CUSTOMER[1]/LASTNAME")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CorrectedDefectTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CorrectedDefectTests.java deleted file mode 100644 index d266daec7c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CorrectedDefectTests.java +++ /dev/null @@ -1,258 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * These tests attempt to duplicate customer reported errors and then to verify - * any necessary fix. - * - */ - -import java.util.Iterator; -import java.util.Random; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class CorrectedDefectTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Dilton's bug for adding new child data object - */ - public void testAddNewOrder() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID"); - select.setConnection(getConnection()); - - // Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - DataObject root = select.executeQuery(); - - DataObject cust = root.getDataObject("CUSTOMER[1]"); - - // Save ID and Order Count - int custID = cust.getInt("ID"); - int custOrderCount = cust.getList("ANORDER").size(); -// int rootCount = root.getList("ANORDER").size(); - - // Create a new Order and add to customer1 - DataObject order = root.createDataObject("ANORDER"); - - order.set("ID", new Integer(99)); - order.set("PRODUCT", "The 99th product"); - order.set("QUANTITY", new Integer(99)); - cust.getList("ANORDER").add(order); - - assertEquals(custOrderCount + 1, cust.getList("ANORDER").size()); - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Metadata - apply.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.addPrimaryKey("ANORDER.ID"); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(custID)); - - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - root = select.executeQuery(); - - assertEquals(custOrderCount + 1, root.getList("CUSTOMER[1]/ANORDER").size()); - - } - - public void testDiltonsInsertWorkaround() throws Exception { - - // String sql = "insert into conmgt.serverstatus (statusid, - // managedserverid, timestamp) values (316405209, 316405209, '2005-11-23 - // 19:29:52.636')"; - // String sql = "insert into conmgt.serverstatus (managedserverid, - // timestamp) values (316405209, '2005-11-23 19:29:52.636')"; - String sql = "insert into conmgt.serverstatus (managedserverid, timestamp) values (:serverid, :timestamp)"; - - Command insert = Command.FACTORY.createCommand(sql); - insert.setParameterValue("serverid", new Integer(316405209)); - insert.setParameterValue("timestamp", "2005-11-23 19:29:52.636"); - insert.setConnection(getConnection()); - insert.execute(); - - // Verify - Command select = Command.FACTORY.createCommand("Select * from conmgt.serverstatus"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("SERVERSTATUS").size()); - - } - - public void testWASDefect330118() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - // Read all customers and add one - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - int numCustomers = root.getList("CUSTOMER").size(); - - DataObject newCust = root.createDataObject("CUSTOMER"); - newCust.set("ID", new Integer(100)); - newCust.set("ADDRESS", "5528 Wells Fargo Drive"); - newCust.set("LASTNAME", "Gerkin"); - - // Now delete this new customer - newCust.delete(); - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - // Verify - root = read.executeQuery(); - assertEquals(numCustomers, root.getList("CUSTOMER").size()); - - } - - /** - * Should be able to explicitly set a parameter to null. But, should require - * that the parameter type is set. - */ - public void testDiltonsNullParameterBug1() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", null); - insert.setParameterType("LASTNAME", SDODataTypes.STRING); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - - /** - * Error by not setting a parameter - */ - public void testDiltonsNullParameterBug2() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); -// insert.setParameterValue("LASTNAME", null); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - - try { - insert.execute(); - fail(); - } - catch (RuntimeException e) { - //Expected since "LASTNAME" parameter not set - } - } - - /** - * Set parameter to empty string - */ - public void testDiltonsNullParameterBug3() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", ""); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - public void testUpdateChildThatHasGeneratedKey() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - - //Read a specific company based on the known ID - Command readCust = commandGroup.getCommand("all companies and departments"); - DataObject root = readCust.executeQuery(); - DataObject lastCustomer = root.getDataObject("COMPANY[3]"); - Iterator i = lastCustomer.getList("departments").iterator(); - Random generator = new Random(); - int random = generator.nextInt(1000) + 1; - DataObject department; - while (i.hasNext()) { - department = (DataObject)i.next(); - System.out.println("Modifying department: " + department.getString("NAME")); - department.setString("NAME", "Dept-" + random); - random = random + 1; - } - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - } - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java deleted file mode 100644 index 387dab95b1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java +++ /dev/null @@ -1,254 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This provdes the simplest examples that make use of the change history. The assumptions are: - * - * Single type - * Change history utilized - * Dynamic DataObjects - * - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class CrudWithChangeHistory - extends DasTest -{ - - protected void setUp() - throws Exception - { - super.setUp(); - new CustomerData( getAutoConnection() ).refresh(); - } - - protected void tearDown() - throws Exception - { - super.tearDown(); - } - - /** - * Read and modify a customer. - * Provide needed Create/Update/Delete statements programatically - */ - public void testReadModifyApply() - throws Exception - { - - //Read customer 1 - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection( getConnection() ); - - //Manually create and add update command - Command update = Command.FACTORY.createCommand( "update CUSTOMER set LASTNAME = :LASTNAME where ID = :ID" ); - update.addParameter( "LASTNAME", SDODataTypes.STRING ); - update.addParameter( "ID", SDODataTypes.INTEGER ); - apply.addUpdateCommand( customer.getType(), update ); - - //Flush changes - apply.execute( root ); - - //Verify changes - root = select.executeQuery(); - assertEquals( "Pavick", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - } - - /** - * Read and modify a customer. - * Provide needed Create/Update/Delete statements via xml file - */ - public void testReadModifyApply1() - throws Exception - { - - //Read customer 1 - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerMappingWithCUD.xml")); - apply.setConnection( getConnection() ); - - //Flush changes - apply.execute( root ); - - //Verify changes - root = select.executeQuery(); - assertEquals( "Pavick", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - } - - /** - * Same as previous but: - * Utilizes generated CUD statements - * Key info provided programatically - */ - public void testReadModifyApply2() - throws Exception - { - - //Read customer with particular ID - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = root.getDataObject( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection( getConnection() ); - //programatically add the only part of the mapping model needed for this simple case. - //The ID designation is needed to generate the CUD statements - apply.addPrimaryKey( "CUSTOMER.ID" ); - - //Flush changes - apply.execute( root ); - - //Verify the change - root = select.executeQuery(); - assertEquals( "Pavick", root.getDataObject( "CUSTOMER[1]" ).getString( "LASTNAME" ) ); - - } - - /** - * Builds on previous but: - * 1. Key info provided via XML file - */ - public void testReadModifyApply3() - throws Exception - { - - //Read customer with particular ID - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerMapping.xml")); - apply.setConnection( getConnection() ); - - //Flush changes - apply.execute( root ); - - //Verify the change - root = select.executeQuery(); - assertEquals( "Pavick", root.getDataObject( "CUSTOMER[1]" ).getString( "LASTNAME" ) ); - - } - - /** - * Test ability to handle multiple changes to the graph including Creates/Updates/Deletes - * Employs generated CUD - */ - public void testReadModifyDeleteInsertApply() - throws Exception - { - - //Read some customers - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where LASTNAME = 'Williams'" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject cust1 = (DataObject) root.getList( "CUSTOMER" ).get( 0 ); - DataObject cust2 = (DataObject) root.getList( "CUSTOMER" ).get( 1 ); - DataObject cust3 = (DataObject) root.getList( "CUSTOMER" ).get( 2 ); - - //Modify a customer - cust1.set( "LASTNAME", "Pavick" ); - int cust1ID = cust1.getInt( "ID" ); - - //Save IDs before delete - int cust2ID = cust2.getInt( "ID" ); - int cust3ID = cust3.getInt( "ID" ); - //Delete a couple - cust2.delete(); - cust3.delete(); - - //Create a new customer - DataObject cust4 = root.createDataObject( "CUSTOMER" ); - cust4.set( "ID", new Integer( 100 ) ); - cust4.set( "ADDRESS", "5528 Wells Fargo Drive" ); - cust4.set( "LASTNAME", "Gerkin" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerMapping.xml")); - apply.setConnection( getConnection() ); - - //Flush changes - apply.execute( root ); - - //Verify deletes - select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = :ID" ); - select.setConnection( getConnection() ); - select.setParameterValue( "ID", new Integer( cust2ID ) ); - root = select.executeQuery(); - assertTrue( root.getList( "CUSTOMER" ).isEmpty() ); - //reparameterize same command - select.setParameterValue( "ID", new Integer( cust3ID ) ); - root = select.executeQuery(); - assertTrue( root.getList( "CUSTOMER" ).isEmpty() ); - - //verify insert - select.setParameterValue( "ID", new Integer( 100 ) ); - root = select.executeQuery(); - assertEquals( 1, root.getList( "CUSTOMER" ).size() ); - assertEquals( "5528 Wells Fargo Drive", root.getString( "CUSTOMER[1]/ADDRESS" ) ); - assertEquals( "Gerkin", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - //verify update - select.setParameterValue( "ID", new Integer( cust1ID ) ); - root = select.executeQuery(); - assertEquals( "Pavick", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/DefectTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/DefectTests.java deleted file mode 100644 index 0835354c2f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/DefectTests.java +++ /dev/null @@ -1,353 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * These tests attempt to duplicate customer reported errors and then to verify - * any necessary fix. - * - */ - -import java.util.Iterator; -import java.util.Random; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.DepEmpData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.EmployeeData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class DefectTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new EmployeeData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - new DepEmpData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read a specific customer - */ - public void testDiltonsInsert() throws Exception { - - // String sql = "insert into conmgt.serverstatus (statusid, - // managedserverid, timestamp) values (316405209, 316405209, '2005-11-23 - // 19:29:52.636')"; - String sql = "insert into conmgt.serverstatus (managedserverid, timestamp) values (316405209, '2005-11-23 19:29:52.636')"; - - Command insert = Command.FACTORY.createCommand(sql); - insert.setConnection(getConnection()); - insert.execute(); - - // Verify - Command select = Command.FACTORY - .createCommand("Select * from conmgt.serverstatus where statusid = 316405209"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("conmgt.serverstatus").size()); - - } - - /** - * Dilton's bug for adding new child data object - */ - public void testAddNewOrder() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID"); - select.setConnection(getConnection()); - - // Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - DataObject root = select.executeQuery(); - - DataObject cust = root.getDataObject("CUSTOMER[1]"); - - // Save ID and Order Count - int custID = cust.getInt("ID"); - int custOrderCount = cust.getList("ANORDER").size(); - int rootCount = root.getList("ANORDER").size(); - - // Create a new Order and add to customer1 - DataObject order = root.createDataObject("ANORDER"); - - order.set("ID", new Integer(99)); - order.set("PRODUCT", "The 99th product"); - order.set("QUANTITY", new Integer(99)); - cust.getList("ANORDER").add(order); - - assertEquals(custOrderCount + 1, cust.getList("ANORDER").size()); - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Metadata - apply.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.addPrimaryKey("ANORDER.ID"); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(custID)); - - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - root = select.executeQuery(); - - assertEquals(custOrderCount + 1, root.getList("CUSTOMER[1]/ANORDER").size()); - - } - - public void testDiltonsInsertWorkaround() throws Exception { - - // String sql = "insert into conmgt.serverstatus (statusid, - // managedserverid, timestamp) values (316405209, 316405209, '2005-11-23 - // 19:29:52.636')"; - // String sql = "insert into conmgt.serverstatus (managedserverid, - // timestamp) values (316405209, '2005-11-23 19:29:52.636')"; - String sql = "insert into conmgt.serverstatus (managedserverid, timestamp) values (:serverid, :timestamp)"; - - Command insert = Command.FACTORY.createCommand(sql); - insert.setParameterValue("serverid", new Integer(316405209)); - insert.setParameterValue("timestamp", "2005-11-23 19:29:52.636"); - insert.setConnection(getConnection()); - insert.execute(); - - // Verify - Command select = Command.FACTORY.createCommand("Select * from conmgt.serverstatus"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("SERVERSTATUS").size()); - - } - - public void testWASDefect330118() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - // Read all customers and add one - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - int numCustomers = root.getList("CUSTOMER").size(); - - DataObject newCust = root.createDataObject("CUSTOMER"); - newCust.set("ID", new Integer(100)); - newCust.set("ADDRESS", "5528 Wells Fargo Drive"); - newCust.set("LASTNAME", "Gerkin"); - - // Now delete this new customer - newCust.delete(); - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - // Verify - root = read.executeQuery(); - assertEquals(numCustomers, root.getList("CUSTOMER").size()); - - } - - /** - * Yin Chen reports ... "In the class Statement, method: public int - * executeUpdate(Parameters parameters) - its tossing out RuntimeException - * when the value of the parameter is null. " - * - * His example build a update statement and sets one parameter value to be - * null. I will try to duplicate with an insert since that is simpler - * - */ - public void testYingChen12162005() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", "Williams"); - insert.setParameterValue("ADDRESS", null); - insert.execute(); - - // Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - /** - * Try a workaround using CommandGroup - */ - public void testYingChen12162005Workaraound() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomerConfig.xml")); - commandGroup.setConnection(getConnection()); - - Command insert = commandGroup.getCommand("insert customer"); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", "Williams"); - insert.setParameterValue("ADDRESS", null); - insert.execute(); - - // Verify - Command select = commandGroup.getCommand("read customer 10"); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - - - - /** - * Should be able to explicitly set a parameter to null. But, should require - * that the parameter type is set. - */ - public void testDiltonsNullParameterBug1() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", null); - insert.setParameterType("LASTNAME", SDODataTypes.STRING); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - - /** - * Error by not setting a parameter - */ - public void testDiltonsNullParameterBug2() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); -// insert.setParameterValue("LASTNAME", null); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - - try { - insert.execute(); - fail(); - } - catch (RuntimeException e) { - //Expected since "LASTNAME" parameter not set - } - } - - /** - * Set parameter to empty string - */ - public void testDiltonsNullParameterBug3() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", ""); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - public void testUpdateChildThatHasGeneratedKey() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - - //Read a specific company based on the known ID - Command readCust = commandGroup.getCommand("all companies and departments"); - DataObject root = readCust.executeQuery(); - DataObject lastCustomer = root.getDataObject("COMPANY[3]"); - Iterator i = lastCustomer.getList("departments").iterator(); - Random generator = new Random(); - int random = generator.nextInt(1000) + 1; - DataObject department; - while (i.hasNext()) { - department = (DataObject)i.next(); - System.out.println("Modifying department: " + department.getString("NAME")); - department.setString("NAME", "Dept-" + random); - random = random + 1; - } - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - } - - - - /** - * Test problem with Random - */ - public void testRandomNumber() throws Exception { - - Random generator = new Random(); - int number = generator.nextInt(1000) + 1; - assertTrue(number > 0 & number <= 1000); - - } - - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java deleted file mode 100644 index 2fa60ec576..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.company.CompanyFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.TypeHelper; - -public class ExceptionTests extends DasTest { - - public ExceptionTests() { - super(); - } - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testMissingConnection() throws Exception { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - try { - readCustomers.executeQuery(); - fail("RuntimeException should be thrown"); - } catch ( RuntimeException ex) { - assertEquals("A DASConnection object must be specified before executing the query.", ex.getMessage()); - } - - } - public void testMissingMapping() throws Exception { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - SDOUtil.registerStaticTypes(CompanyFactory.class); - readCustomers.setDataObjectModel(TypeHelper.INSTANCE.getType(DataGraphRoot.class)); - - try { - readCustomers.executeQuery(); - fail("Exception should be thrown"); - } catch (RuntimeException ex) { - assertEquals("An SDO Type with name CUSTOMER was not found", ex - .getMessage()); - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedCommandTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedCommandTests.java deleted file mode 100644 index 3cc6b823c0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedCommandTests.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.List; - -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersByLastnameCommand; -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersCommand; -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersStaticTypesCommand; -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersWithShapeCommand; -import org.apache.tuscany.das.rdb.test.commands.SimpleReadCustomersWithShapeCommand; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class GeneratedCommandTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testReadCustomers() throws Exception { - ReadCustomersCommand cmd = new ReadCustomersCommand(); - cmd.setConnection(getConnection()); - - DataObject root = cmd.executeQuery(); - assertEquals(5, root.getList("CUSTOMER").size()); - } - - public void testReadSomeCustomers() throws Exception { - ReadCustomersByLastnameCommand cmd = new ReadCustomersByLastnameCommand(); - cmd.setConnection(getConnection()); - cmd.setParameterValue("LASTNAME", "Williams"); - - DataObject root = cmd.executeQuery(); - assertEquals(4, root.getList("CUSTOMER").size()); - - } - - public void testReadCustomersStaticTypes() throws Exception { - ReadCustomersStaticTypesCommand cmd = new ReadCustomersStaticTypesCommand(); - cmd.setConnection(getConnection()); - cmd.setParameterValue("LASTNAME", "Williams"); - - DataGraphRoot root = (DataGraphRoot) cmd.executeQuery(); - - List customers = root.getCustomers(); - assertEquals(4, customers.size()); - - Customer cust1 = (Customer) customers.get(0); - assertEquals("Williams", cust1.getLastName()); - - } - - public void testSimpleReadCustomersWithShape() throws Exception { - SimpleReadCustomersWithShapeCommand cmd = new SimpleReadCustomersWithShapeCommand(); - cmd.setConnection(getConnection()); - DataObject root = cmd.executeQuery(); - assertEquals(5, root.getList("CUSTOMER").size()); - } - - public void testReadCustomersOrdersWithShape() throws Exception { - ReadCustomersWithShapeCommand cmd = new ReadCustomersWithShapeCommand(); - cmd.setConnection(getConnection()); - - DataObject root = cmd.executeQuery(); - assertEquals(5, root.getList("CUSTOMER").size()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java deleted file mode 100644 index 2fd91930c9..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * Generated IDs - * - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class GeneratedId extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - // Test insert into row with generated ID - public void testInsert() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into COMPANY (NAME) values (:NAME)"); - insert.setConnection(getConnection()); - insert.setParameterValue("NAME", "AAA Rental"); - insert.execute(); - - // Verify insert - // Verify - Command select = Command.FACTORY - .createCommand("Select ID, NAME from COMPANY"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - assertEquals(4, root.getList("COMPANY").size()); - assertTrue(root.getInt("COMPANY[1]/ID") > 0); - - } - - // Test back to back insertions with the same command - public void testInsert2() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into COMPANY (NAME) values (:NAME)"); - insert.setConnection(getConnection()); - insert.setParameterValue("NAME", "AAA Rental"); - insert.execute(); - - // insert another using same command - insert.setParameterValue("NAME", "BBB Rental"); - insert.execute(); - - // Verify insert - // Verify - Command select = Command.FACTORY - .createCommand("Select ID, NAME from COMPANY"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - assertEquals(5, root.getList("COMPANY").size()); - - } - - // Test ability to retrieve and utilize the generated key - public void testInsert3() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into COMPANY (NAME) values (:NAME)"); - insert.setConnection(getConnection()); - insert.setParameterValue("NAME", "AAA Rental"); - insert.execute(); - Integer key = (Integer) insert.getParameterValue("generated_key"); - - // Verify insert - Command select = Command.FACTORY - .createCommand("Select ID, NAME from COMPANY where ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", key); - DataObject root = select.executeQuery(); - assertEquals(key, root.get("COMPANY[1]/ID")); - - } - - // Test ability to propogate generated values back to owning data objects - public void testPropagateIds() throws Exception { - - Command select = Command.FACTORY.createCommand("Select * from COMPANY"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Programatically set minimum metadata necessary - apply.addGeneratedPrimaryKey("COMPANY.ID"); - - // verify pre-condition (id is not there until after flush) - assertNull(company.get("ID")); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - select = Command.FACTORY - .createCommand("Select * from COMPANY where ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]") - .getString("NAME")); - - } - - /** - * Same as above but metadata provided by XML config file - */ - public void testPropagateIdsXML() throws Exception { - - Command select = Command.FACTORY.createCommand("Select * from COMPANY", getConfig("basicCompanyMapping.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCompanyMapping.xml")); - apply.setConnection(getConnection()); - - // verify pre-condition (id is not there until after flush) - assertNull(company.get("ID")); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - select = Command.FACTORY - .createCommand("Select * from COMPANY where ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]") - .getString("NAME")); - - } - - /** - * Test ability to correctly flush heirarchy of objects that have generated - * keys - */ - public void testFlushCreateHeirarchy() throws Exception { - - String selectCompanys = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID"; - - Command select = Command.FACTORY.createCommand(selectCompanys, getConfig("basicCompanyDepartmentMapping.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create a new Department - //Do not set ID or CompanyID since these are generated - //ID INT, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT - DataObject department = root.createDataObject("DEPARTMENT"); - department.setString("NAME", "Do-rite Pest Control"); - department.setString("LOCATION", "The boonies"); - department.setString("NUMBER", "101"); - department.setInt("EOTM", 1); - - - // Associate the new department with the new company - company.getList("departments").add(department); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCompanyDepartmentMapping.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - String selectString = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID WHERE COMPANY.ID = :ID"; - - select = Command.FACTORY.createCommand(selectString); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]") - .getString("NAME")); - - } - - /** - * Test ability to correctly flush heirarchy of objects that have generated - * keys even when a created object has legal but NULL property values - */ - public void testFlushCreateHeirarchy2() throws Exception { - - String selectCompanys = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID"; - - Command select = Command.FACTORY.createCommand(selectCompanys, getConfig("basicCompanyDepartmentMapping.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create a new Department - //Do not set ID or CompanyID since these are generated - //ID INT, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT - DataObject department = root.createDataObject("DEPARTMENT"); - department.setString("NAME", "Do-rite Pest Control"); - //Do not set this property to force storing NULL to DB -// department.setString("LOCATION", "The boonies"); - department.setString("NUMBER", "101"); - department.setInt("EOTM", 1); - - - // Associate the new department with the new company - company.getList("departments").add(department); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCompanyDepartmentMapping.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - String selectString = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID WHERE COMPANY.ID = :ID"; - - select = Command.FACTORY.createCommand(selectString); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]").getString("NAME")); - - } - - - // Test that error is thrown when no key has been generated (as in a select) - public void testRead() throws Exception { - - Command select = Command.FACTORY.createCommand("Select * from COMPANY"); - select.setConnection(getConnection()); - select.executeQuery(); - - try { - select.getParameterValue("generated_id"); - fail("Should throw Error"); - } catch (RuntimeException e) { - // OK - } - } - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GraphMergeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GraphMergeTests.java deleted file mode 100644 index 35b06cc30e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GraphMergeTests.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.ArrayList; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.merge.impl.GraphMerger; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class GraphMergeTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - - public void testSingleTableMerge() throws Exception { - - Command select = Command.FACTORY - .createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where ID <= :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", "3"); - DataObject graph1 = select.executeQuery(); - assertEquals(3, graph1.getList("CUSTOMER").size()); - - select.setParameterValue("ID", "5"); - DataObject graph2 = select.executeQuery(); - assertEquals(5, graph2.getList("CUSTOMER").size()); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - DataObject mergedGraph = merger.merge(graph1, graph2); - - assertEquals(5, mergedGraph.getList("CUSTOMER").size()); - } - - public void testSingleTableMergeThreeGraphs() throws Exception { - - Command select = Command.FACTORY - .createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where ID <= :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", "3"); - DataObject graph1 = select.executeQuery(); - assertEquals(3, graph1.getList("CUSTOMER").size()); - - select.setParameterValue("ID", "4"); - DataObject graph2 = select.executeQuery(); - assertEquals(4, graph2.getList("CUSTOMER").size()); - - select.setParameterValue("ID", "5"); - DataObject graph3 = select.executeQuery(); - assertEquals(5, graph3.getList("CUSTOMER").size()); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - ArrayList graphs = new ArrayList(); - graphs.add(graph1); - graphs.add(graph2); - graphs.add(graph3); - DataObject mergedGraph = merger.merge(graphs); - - assertEquals(5, mergedGraph.getList("CUSTOMER").size()); - - } - - public void testMultiTableMerge() throws Exception { - //Read some customers and related orders - Command select = Command.FACTORY.createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID "); - select.setConnection(getConnection()); - - //Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - DataObject graph1 = select.executeQuery(); - - DataObject customer = (DataObject)graph1.getList("CUSTOMER").get(0); - assertEquals(2, customer.getList("ANORDER").size()); - - select.setParameterValue("ID", new Integer(2)); - DataObject graph2 = select.executeQuery(); - DataObject customer2 = (DataObject)graph2.getList("CUSTOMER").get(0); - assertEquals(1, graph2.getList("CUSTOMER").size()); - assertEquals(1, customer2.getList("ANORDER").size()); - assertEquals(2, customer2.getInt("ID")); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - merger.addPrimaryKey("ANORDER.ID"); - DataObject mergedGraph = merger.merge(graph1, graph2); - - assertEquals(3, mergedGraph.getList("ANORDER").size()); - assertEquals(2, mergedGraph.getList("CUSTOMER").size()); - - DataObject mergedCustomer = (DataObject) mergedGraph.getList("CUSTOMER").get(1); - assertEquals(2, mergedCustomer.getInt("ID")); - assertEquals(1, mergedCustomer.getList("ANORDER").size()); - DataObject mergedOrder = (DataObject) mergedCustomer.getList("ANORDER").get(0); - assertEquals(4, mergedOrder.getInt("ID")); - - - } - - public void testMultiTableAppendSingleTable() throws Exception { - //Read some customers and related orders - Command select = Command.FACTORY.createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID "); - select.setConnection(getConnection()); - - //Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - DataObject graph1 = select.executeQuery(); - - DataObject customer = (DataObject)graph1.getList("CUSTOMER").get(0); - assertEquals(2, customer.getList("ANORDER").size()); - - Command select2 = Command.FACTORY.createCommand("select * from ANORDER"); - select2.setConnection(getConnection()); - DataObject graph2 = select2.executeQuery(); - assertEquals(4, graph2.getList("ANORDER").size()); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - merger.addPrimaryKey("ANORDER.ID"); - DataObject mergedGraph = merger.merge(graph1, graph2); - assertEquals(4, mergedGraph.getList("ANORDER").size()); - assertEquals(1, mergedGraph.getList("CUSTOMER").size()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/NameMappingTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/NameMappingTests.java deleted file mode 100644 index 7b127e5768..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/NameMappingTests.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class NameMappingTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Test ability to assign DataObject type and propertyaliases with xml file - */ - public void testRead() throws Exception { - - // Read a customer - Command select = Command.FACTORY.createCommand( - "SELECT * FROM CUSTOMER WHERE CUSTOMER.ID = 1", getConfig("customerMapping.xml")); - select.setConnection(getConnection()); - - DataObject root = select.executeQuery(); - DataObject customer = root.getDataObject("Customer[1]"); - assertEquals(1, customer.getInt("id")); - assertEquals("1212 foobar lane", customer.getString("address")); - assertEquals("Williams", customer.getString("lastname")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OCCTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OCCTests.java deleted file mode 100644 index 09cf23e018..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OCCTests.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.BookData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class OCCTests extends DasTest { - protected void setUp() throws Exception { - super.setUp(); - - new BookData(getAutoConnection()).refresh(); - } - - - public void testSimpleOCC() throws Exception { - - //Read a book instance - Command select = Command.FACTORY.createCommand("SELECT * FROM BOOK WHERE ID = 1"); - select.setConnection(getConnection()); - select.addPrimaryKey("BOOK.ID"); - DataObject root = select.executeQuery(); - DataObject book = root.getDataObject("BOOK[1]"); - //Change a field to mark the instance 'dirty' - book.setInt("QUANTITY", 2); - - // Explicitly change OCC column in database to force collision - Command update = Command.FACTORY - .createCommand("update BOOK set OCC = :OCC where ID = 1"); - update.setConnection(getConnection()); - update.setParameterValue("OCC", new Integer(100)); - update.execute(); - - //Try to flush the change - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.addPrimaryKey("BOOK.ID"); - apply.addCollisionColumn("BOOK.OCC"); - - try { - apply.execute(root); - fail("An OCCException should be thrown"); - } catch (RuntimeException ex) { - if ( !ex.getMessage().equals("OCC Exception") ) - throw ex; - } - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OperationOrderingTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OperationOrderingTests.java deleted file mode 100644 index 1207c769e5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OperationOrderingTests.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CityData; -import org.apache.tuscany.das.rdb.test.data.StateData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class OperationOrderingTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - CityData city = new CityData(getAutoConnection()); - StateData state = new StateData(getAutoConnection()); - - city.doDeletes(); - state.doDeletes(); - state.doInserts(); - city.doInserts(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public OperationOrderingTests() { - super(); - } - - public void testInsert() throws Exception { - Command select = Command.FACTORY - .createCommand( - "Select * from STATES inner join CITIES on STATES.ID = CITIES.STATE_ID", - getConfig("cityStates.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - int numberOfStates = root.getList("STATES").size(); - int numberOfCities = root.getList("CITIES").size(); - - DataObject atlanta = root.createDataObject("CITIES"); - atlanta.setString("NAME", "Atlanta"); - atlanta.setInt("ID", 6); - - // Create a new Company - DataObject georgia = root.createDataObject("STATES"); - georgia.setInt("ID", 4); - georgia.setString("NAME", "GA"); - - georgia.getList("cities").add(atlanta); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("cityStates.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - select.setConnection(getConnection()); - root = select.executeQuery(); - assertEquals(numberOfCities + 1, root.getList("CITIES").size()); - assertEquals(numberOfStates + 1, root.getList("STATES").size()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/Paging.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/Paging.java deleted file mode 100644 index 250e7673d7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/Paging.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - - -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Pager; -import org.apache.tuscany.das.rdb.impl.PagerImpl; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - - - -public class Paging extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - public void testPaging() throws SQLException { - - //Build command to read all customers - Command custCommand = Command.FACTORY.createCommand("select * from CUSTOMER order by ID"); - custCommand.setConnection(getConnection()); - - //Create a pager with the command - Pager pager = new PagerImpl(custCommand, 2); - - //Get and work with first page - DataObject root = pager.next(); - DataObject customer1 = root.getDataObject("CUSTOMER[1]"); - DataObject customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - - //Get and work with the second page - root = pager.next(); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(3, customer1.getInt("ID")); - assertEquals(4, customer2.getInt("ID")); - - // First page again - root = pager.previous(); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - - } - - - public void testRandomPage() throws SQLException { - //Build the select command - Command select = Command.FACTORY - .createCommand("select * from CUSTOMER order by ID"); - - //Parameterize the command - select.setConnection(getConnection()); - - //Create a pager - Pager pager = new PagerImpl(select, 2); - - //Get the first page - DataObject root = pager.getPage(1); - DataObject customer1 = root.getDataObject("CUSTOMER[1]"); - DataObject customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - - //Get the second page - root = pager.getPage(2); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(3, customer1.getInt("ID")); - assertEquals(4, customer2.getInt("ID")); - - - // Get the first page again - root = pager.getPage(1); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - } - - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PartialUpdateTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PartialUpdateTests.java deleted file mode 100644 index 67af74f8a2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PartialUpdateTests.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class PartialUpdateTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public PartialUpdateTests() { - super(); - } - - public void testPartialUpdate() throws SQLException { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - DataObject customer = root.getDataObject("CUSTOMER[1]"); - // Verify - assertEquals(1, customer.getInt("ID")); - - Command update = Command.FACTORY - .createCommand("update CUSTOMER set LASTNAME = 'modified' where ID = 1"); - update.setConnection(getConnection()); - update.execute(); - - customer.setString("ADDRESS", "main street"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.setConnection(getConnection()); - apply.execute(root); - - root = readCustomers.executeQuery(); - - // If partial update was not used, LASTNAME would not be 'modified' - customer = root.getDataObject("CUSTOMER[1]"); - assertEquals(1, customer.getInt("ID")); - assertEquals("modified", customer.getString("LASTNAME")); - assertEquals("main street", customer.getString("ADDRESS")); - } - - public void testPartialInsert() throws SQLException { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - //Create a new customer - DataObject newCust = root.createDataObject("CUSTOMER"); - newCust.set("ID", new Integer(100)); - newCust.set("ADDRESS", "5528 Wells Fargo Drive"); - //Purposely do not set lastname to let it default to 'Garfugengheist' - //newCust.set("LASTNAME", "Gerkin" ); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.setConnection(getConnection()); - apply.execute(root); - - Command readNewCust = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 100"); - readNewCust.setConnection(getConnection()); - root = readNewCust.executeQuery(); - - // If partial insert was not used, LASTNAME would not be 'Garfugengheist' - newCust = root.getDataObject("CUSTOMER[1]"); - assertEquals(100, newCust.getInt("ID")); - assertEquals("Garfugengheist", newCust.getString("LASTNAME")); - assertEquals("5528 Wells Fargo Drive", newCust.getString("ADDRESS")); - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PassiveConnectionTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PassiveConnectionTests.java deleted file mode 100644 index ec3479941a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PassiveConnectionTests.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * Test capability to participate in an extenrlly managed transaction. The client is managing the - * transaction boundary so the DAS will not issue commit/rollback - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class PassiveConnectionTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read and modify a customer. Uses a "passive" connection - */ - public void testReadModifyApply() throws Exception { - - // Create and initialize a DAS connection and initialize for externally - // managed transaction boundaries - java.sql.Connection c = getConnection(); - - try { - - // Read customer 1 - Command select = Command.FACTORY - .createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(c); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get("CUSTOMER[1]"); - - // Modify customer - customer.set("LASTNAME", "Pavick"); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY - .createApplyChangesCommand(); - apply.setConnection(c, false); - apply.addPrimaryKey("CUSTOMER.ID"); - - // Flush changes - apply.execute(root); - - // Verify changes - root = select.executeQuery(); - assertEquals("Pavick", root.getString("CUSTOMER[1]/LASTNAME")); - - // Since the DAS is not managing tx boundaries, I must - } catch (Exception e) { - c.rollback(); - } finally { - c.commit(); - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ReadDBSchemaTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ReadDBSchemaTests.java deleted file mode 100644 index 7a74372551..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ReadDBSchemaTests.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * Test the ability to query Database schema(metadata) information using regular DAS APIs - * This is speciic to DB2 - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class ReadDBSchemaTests extends DasTest { - - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - - - public void testReadTableInfo() throws Exception { - - Command select = Command.FACTORY.createCommand("SELECT * from SYSIBM.SYSTABLES WHERE TYPE = 'T'"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject table = (DataObject)root.get("SYSTABLES[1]"); - - assertEquals('T', table.getChar("TYPE")); - - } - - - - //Utilities - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java deleted file mode 100644 index 67713dcfd3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; -import org.apache.tuscany.das.rdb.test.data.PartData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -public class RecursiveTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new PartData(getAutoConnection()).refresh(); - } - - public void testReadEngineParts() throws Exception { - - //Table definition - //CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT ); - - - String threeLevelPartsSQL = "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"; - Command select = Command.FACTORY.createCommand(threeLevelPartsSQL); - select.setConnection(getConnection()); - - String[] columns = {"ID", "NAME", "QUANTITY", "PARENT_ID", "ID", "NAME", "QUANTITY", "PARENT_ID", "ID", "NAME", "QUANTITY", "PARENT_ID"}; - String[] tables = {"PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART"}; - Type[] types = {SDODataTypes.INTEGEROBJECT, SDODataTypes.STRING, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.STRING, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.STRING, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT}; - ResultSetShape shape = new ResultSetShape(tables, columns, types); - - //Hack until we provide a nicer API - ((ReadCommandImpl)select).setResultSetShape(shape); - - // Need to set the key explicitly. The aggregate of columns not working - // because of null values - select.addPrimaryKey("PART.ID"); - select.addRelationship("PART.ID", "PART.PARENT_ID"); - DataObject root = select.executeQuery(); - - assertEquals(5, root.getList("PART").size()); - // printList(root.getList("PART")); - DataObject engine = root.getDataObject("PART.0"); - assertEquals("Engine", engine.getString("NAME")); - - assertEquals(3, engine.getList("PART").size()); - - DataObject piston = null; - Iterator i = engine.getList("PART").iterator(); - while ( i.hasNext() ) { - DataObject obj = (DataObject)i.next(); - if ( obj.getString("NAME").equals("Piston")) - piston = obj; - } - - assertEquals("Piston", piston.getString("NAME")); - assertEquals(1, piston.getList("PART").size()); - assertEquals("Piston Ring", piston.getDataObject("PART.0").getString("NAME")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RelationshipTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RelationshipTests.java deleted file mode 100644 index ddcfbd0784..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RelationshipTests.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class RelationshipTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Test ability to read a compound graph - */ - public void testRead() throws Exception { - - String statement = "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID = 1"; - - // Read some customers and related orders - Command select = Command.FACTORY.createCommand(statement, getConfig("customerOrderRelationshipMapping.xml")); - select.setConnection(getConnection()); - - DataObject root = select.executeQuery(); - DataObject customer = root.getDataObject("CUSTOMER[1]"); - - assertEquals(2, customer.getList("orders").size()); - - } - - /** - * Test ability to extract and flush relationhip changes from the change - * history - */ - public void testRelationshipModification() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID"); - select.setConnection(getConnection()); - - // Set minimum metadata necessary to describe relationship - // Maybe something like this ... - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - DataObject root = select.executeQuery(); - - DataObject cust1 = root.getDataObject("CUSTOMER[1]"); - DataObject cust2 = root.getDataObject("CUSTOMER[2]"); - - // Save IDs - Integer cust1ID = (Integer) cust1.get("ID"); - Integer cust2ID = (Integer) cust2.get("ID"); - // save order count - Integer cust1OrderCount = new Integer(cust1.getList("ANORDER").size()); - Integer cust2OrderCount = new Integer(cust2.getList("ANORDER").size()); - - // Move an order to cust1 from cust2 - DataObject order = (DataObject) cust2.getList("ANORDER").get(0); - cust1.getList("ANORDER").add(order); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY - .createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Manually create and add commands - Command update = Command.FACTORY - .createCommand("update ANORDER set CUSTOMER_ID = :CUSTOMER_ID where ID = :ID"); - update.addParameter("CUSTOMER_ID", SDODataTypes.INTEGER); - update.addParameter("ID", SDODataTypes.INTEGER); - update.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - update.addPrimaryKey("CUSTOMER.ID"); - update.addPrimaryKey("ANORDER.ID"); - apply.addUpdateCommand(order.getType(), update); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", cust1ID); - - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - root = select.executeQuery(); - - assertEquals(cust1OrderCount.intValue() + 1, root.getList( - "CUSTOMER[1]/ANORDER").size()); - - // verify cust2 relationship updates - select.setParameterValue("ID", cust2ID); - root = select.executeQuery(); - - assertEquals(cust2OrderCount.intValue() - 1, root.getList( - "CUSTOMER[1]/ANORDER").size()); - - } - - /** - * Same as above except uses xml file for relationhip and key information. - * Employs CUD generation. - */ - public void testRelationshipModification2() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID", getConfig("basicCustomerOrderMapping.xml")); - select.setConnection(getConnection()); - - DataObject root = select.executeQuery(); - - DataObject cust1 = root.getDataObject("CUSTOMER[1]"); - DataObject cust2 = root.getDataObject("CUSTOMER[2]"); - - // Save IDs - Integer cust1ID = (Integer) cust1.get("ID"); - Integer cust2ID = (Integer) cust2.get("ID"); - // save order count - Integer cust1OrderCount = new Integer(cust1.getList("orders").size()); - Integer cust2OrderCount = new Integer(cust2.getList("orders").size()); - - // Move an order to cust1 from cust2 - DataObject order = (DataObject) cust2.getList("orders").get(0); - cust1.getList("orders").add(order); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerOrderMapping.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID", - getConfig("basicCustomerOrderMapping.xml")); - select.setConnection(getConnection()); - select.setParameterValue("ID", cust1ID); - - root = select.executeQuery(); - assertEquals(cust1OrderCount.intValue() + 1, root.getList( - "CUSTOMER[1]/orders").size()); - - // verify cust2 relationship updates - select.setParameterValue("ID", cust2ID); - root = select.executeQuery(); - assertEquals(cust2OrderCount.intValue() - 1, root.getList( - "CUSTOMER[1]/orders").size()); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ResultSetShapeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ResultSetShapeTests.java deleted file mode 100644 index 34e531304e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ResultSetShapeTests.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * Test ability to specify format(shape) of the ResultSet. This is necessary - * when the JDBC driver in use does not provide adequate support for - * ResultSetMetadata. Also, we expect that specifying the result set shape will - * increase performance. - * - */ -public class ResultSetShapeTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read a specific customer - */ - public void testReadSingle() throws Exception { - - // Using literals in the select forces invalid resultset metadata - String sqlString = "Select 99, 'Roosevelt', '1600 Pennsylvania Avenue' from customer"; - String[] columns = { "ID", "LASTNAME", "ADDRESS" }; - String[] tables = { "CUSTOMER", "CUSTOMER", "CUSTOMER" }; - Type[] types = { SDODataTypes.LONG, SDODataTypes.STRING, - SDODataTypes.STRING }; - - ResultSetShape shape = new ResultSetShape(tables, columns, types); - - // Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand(sqlString); - readCustomers.addConverter("CUSTOMER.ID", "org.apache.tuscany.das.rdb.test.mappings.StringToLongConverter"); - // Specify result shape - readCustomers.setResultSetShape(shape); - - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - // Verify - assertEquals(5, root.getList("CUSTOMER").size()); - assertEquals(99, root.getInt("CUSTOMER[1]/ID")); - assertEquals("Roosevelt", root.getString("CUSTOMER[1]/LASTNAME")); - assertEquals("1600 Pennsylvania Avenue", root - .getString("CUSTOMER[1]/ADDRESS")); - - } - - /** - * Read a specific customer This duplicates the previous tests but does not - * provide the shape info. Since the select will not return valid metadata, - * this test is expected to fail - */ - public void testReadSingleVerifyShapeUse() throws Exception { - - // Using literals in the select forces invalid resultset metadata - String sqlString = "Select 99, 'Roosevelt', '1600 Pennsylvania Avenue' from customer"; - - // Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand(sqlString); - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - // Verify - try { - assertEquals(5, root.getList("CUSTOMER").size()); - fail("Should fail since there will be no feature named CUSTOMER"); - } catch (IllegalArgumentException e) { - // OK - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java deleted file mode 100644 index 0089e6b569..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This class provides tests for all supported "types". The current plan is to - * use the Data type definitions provided in the SDO 2 specification. We must - * test the ability to use all of these types as well as different mapping from - * thse types to types used in the database. For example, a SDO Data Type - * "STRING", might be staored as a "TIMESTAMP" in DB2. - * - */ - -import org.apache.tuscany.das.rdb.test.data.TypesData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -public class SerializationTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new TypesData(getAutoConnection()).refresh(); - } - - /** - * Read various types. - */ - - -public void testReadandSerialize() throws Exception { - /** Currently failing because of TUSCANY-22 - Command select = Command.FACTORY - .createCommand("Select * from TYPETEST where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject obj = root.getDataObject("TYPETEST[1]"); - - assertTrue(obj.isSet("ID")); - assertTrue(obj.isSet("ATIMESTAMP")); - assertTrue(obj.isSet("ADECIMAL")); - assertTrue(obj.isSet("AFLOAT")); - - //Java serilaization to file - FileOutputStream fos = null; - ObjectOutputStream out = null; - try { - fos = new FileOutputStream("serializedGraph.xml"); - out = new ObjectOutputStream(fos); - out.writeObject(root); - out.flush(); - } finally { - out.close(); - fos.close(); - } - - //Reconstruct the graph - FileInputStream fis = null; - ObjectInputStream in = null; - DataObject root2; - try { - fis = new FileInputStream("serializedGraph.xml"); - in = new ObjectInputStream(fis); - root2 = (DataObject) in.readObject(); - } finally { - in.close(); - fis.close(); - } - - assertEquals(1, root.getInt("TYPETEST[1]/ID")); - assertEquals(TypesData.getTimestamp(), (java.sql.Timestamp)root.get("TYPETEST[1]/ATIMESTAMP")); - assertEquals(1234567.89f, root2.getFloat("TYPETEST[1]/ADECIMAL"), .001); - assertEquals(1234567.89f, root2.getFloat("TYPETEST[1]/AFLOAT"), .001); - - */ - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SimplestCrud.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SimplestCrud.java deleted file mode 100644 index 44979cee4a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SimplestCrud.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * These are the simplest possible uses of the JDBC DAS. In this mode, the - * programming model is not much more than JDBC - * - * The assumptions for these tests are: - * - * Single type - * Client explicitly Read/Create/Update/Delete commands - * No O/R mapping metadata - * SDO change history is not used - * Dynamic DataObjects - * No specified graph model - * - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class SimplestCrud extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read a specific customer - */ - public void testReadSingle() throws Exception { - - //Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - //Read - DataObject root = readCustomers.executeQuery(); - - //Verify - assertEquals(1, root.getInt("CUSTOMER[1]/ID")); - } - - /** - * Read a specific customer - */ - public void testReadSingle2() throws Exception { - - //Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - //Read - DataObject root = readCustomers.executeQuery(); - - DataObject cust = root.getDataObject("CUSTOMER[1]"); - - int n = (cust.getType().getProperties()).size(); - for (int i=0; i<n; i++) { - System.out.println(cust.get(i)); - } - - - //Verify - assertEquals(1, root.getInt("CUSTOMER[1]/ID")); - } - - /** - * Read a specific customer - * Same as above but tests tolerance of white space in provided SQL - */ - public void testReadSingleWithWhiteSpace() throws Exception { - - //Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand(" select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - //Read - DataObject root = readCustomers.executeQuery(); - - //Verify - assertEquals(1, root.getInt("CUSTOMER[1]/ID")); - } - - /** - * Read all customers with a specific last name - */ - public void testReadMultiple() throws Exception { - - //Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where LASTNAME = 'Williams'"); - readCustomers.setConnection(getConnection()); - - //Read - DataObject root = readCustomers.executeQuery(); - - //Verify - assertEquals(4, root.getList("CUSTOMER").size()); - } - - /** - * Read all customers with a specific last name - * LASTNAME value is provided via a parameter - */ - public void testReadMultipleWithParameters() throws Exception { - - //Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where LASTNAME = :LASTNAME"); - readCustomers.setConnection(getConnection()); - - //Parameterize the command - readCustomers.setParameterValue("LASTNAME", "Williams"); - DataObject root = readCustomers.executeQuery(); - - //Verify - assertEquals(4, root.getList("CUSTOMER").size()); - } - - public void testInsert() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (10, 'Williams', '5528 Wells Fargo Dr')"); - insert.setConnection(getConnection()); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - public void testInsertWithParameters() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", "Williams"); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - - public void testDelete() throws Exception { - - //Verify pre-condition - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - - //Create and execute the delete command - Command delete = Command.FACTORY.createCommand("delete from CUSTOMER where ID = 1"); - delete.setConnection(getConnection()); - delete.execute(); - - //Verify delete by reusing the original select command - root = select.executeQuery(); - assertEquals(0, root.getList("CUSTOMER").size()); - - } - - - public void testUpdate() throws Exception { - - //Verify pre-condition - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick")); - - Command update = Command.FACTORY.createCommand("update CUSTOMER set LASTNAME = 'Pavick' where ID = 1"); - update.setConnection(getConnection()); - update.execute(); - - //Verify update - reuse select command - root = select.executeQuery(); - assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME")); - - } - - public void testUpdateWithParameters() throws Exception { - - //Verify pre-condition - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick")); - - Command update = Command.FACTORY.createCommand("update CUSTOMER set LASTNAME = :LASTNAME where ID = :ID"); - update.setConnection(getConnection()); - update.setParameterValue("LASTNAME", "Pavick"); - update.setParameterValue("ID", new Integer(1)); - update.execute(); - - //Verify update - reuse select command - root = select.executeQuery(); - assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME")); - - } - - public void testUpdateWithParmarkers() throws Exception { - - //Verify pre-condition - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick")); - - Command update = Command.FACTORY.createCommand("update CUSTOMER set LASTNAME = ? where ID = ?"); - update.setConnection(getConnection()); - update.setParameterValue(1, "Pavick"); - update.setParameterValue(2, new Integer(1)); - update.execute(); - - //Verify update - reuse select command - root = select.executeQuery(); - assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME")); - - } - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/StoredProcs.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/StoredProcs.java deleted file mode 100644 index d4d3746cd4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/StoredProcs.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * Generated IDs - * - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class StoredProcs extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CompanyData(getAutoConnection()).refresh(); - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - // Call a simple stored proc to read all companies - public void testGetCompanies() throws Exception { - - Command read = Command.FACTORY.createCommand("{call GETALLCOMPANIES()}"); - read.setConnection(getConnection()); - DataObject root = read.executeQuery(); - - //Verify - assertEquals(3, root.getList("COMPANY").size()); - assertTrue(root.getInt("COMPANY[1]/ID") > 0); - - } - - public void testGetNamedCompany() throws Exception { - - Command read = Command.FACTORY.createCommand("{call GETNAMEDCOMPANY(?)}"); - - read.setConnection(getConnection()); - read.setParameterValue(1, "MegaCorp"); - DataObject root = read.executeQuery(); - - assertEquals("MegaCorp", root.getString("COMPANY[1]/NAME")); - - } - - public void testGetNamedCompanyByName() throws Exception { - Command read = Command.FACTORY - .createCommand("{call GETNAMEDCOMPANY(:NAME)}"); - - read.setConnection(getConnection()); - read.setParameterValue("NAME", "MegaCorp"); - DataObject root = read.executeQuery(); - - assertEquals("MegaCorp", root.getString("COMPANY[1]/NAME")); - } - - - // Retreive heirarchy using a stored proc ... new programming model - public void testGetCustomersAndOrder() throws Exception { - - Command read = Command.FACTORY.createCommand("{call getCustomerAndOrders(?)}"); - read.setConnection(getConnection()); - read.setParameterValue(1, new Integer(1)); - - //Set minimum metadata necessary to describe relationship - read.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - read.addPrimaryKey("CUSTOMER.ID"); - read.addPrimaryKey("ANORDER.ID"); - - DataObject root = read.executeQuery(); - - DataObject customer = (DataObject) root.getList("CUSTOMER").get(0); - assertEquals(2, customer.getList("ANORDER").size()); - - } - - /** - * Call a stored proc requiring an in parameter and producing an out - * parameter and a resultset - * - * This stored proc takes a lastname argument and returns a graph of - * customers with that last name. The number of read customers is returned - * in the out parameter - */ -/* public void testGetNamedCustomers() throws Exception { - - Command read = Command.FACTORY.createCommand("{call GETNAMEDCUSTOMERS(?,?)}"); - read.setConnection(getConnection()); - read.setParameterValue(1, "Williams"); - read.addParameter(2, Parameter.OUT, SDODataTypes.INTEGER); - DataObject root = read.executeQuery(); - - Integer customersRead = (Integer) read.getParameterValue(2); - - assertEquals(4, customersRead.intValue()); - assertEquals(customersRead.intValue(), root.getList("CUSTOMER").size()); - - } - */ - //TODO - Resolve issue with programmatic creation of GETNAMEDCUSTOMERS on DB2 and - //re-enable this test - - - // Simplest possible SP write - public void testDelete() throws Exception { - -// JDBCDASCommand delete = JDBCDASCommand.FACTORY.createSPWriteCommand("{call DELETECUSTOMER(?)}"); - Command delete = Command.FACTORY.createCommand("{call DELETECUSTOMER(?)}"); - delete.setConnection(getConnection()); - delete.setParameterValue(1, new Integer(1)); - delete.execute(); - - // Verify DELETE - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertTrue(root.getList("CUSTOMER").isEmpty()); - - } - -/* // For debug - public void testRawCall() throws Exception { - - Connection c = getConnection(); - CallableStatement cs = c.prepareCall("{call GETNAMEDCUSTOMERS(?,?)}"); - ParameterMetaData pm = cs.getParameterMetaData(); - int count = pm.getParameterCount(); - for (int i = 1; i <= count; i++) { - int mode = pm.getParameterMode(i); - if (mode == ParameterMetaData.parameterModeOut - || mode == ParameterMetaData.parameterModeInOut) - cs.registerOutParameter(i, pm.getParameterType(i)); - } - cs.setString(1, "Williams"); - // cs.registerOutParameter(2,java.sql.Types.INTEGER); - boolean isResultSet = cs.execute(); - System.out.println("Has a result set => " + isResultSet); - ResultSet rs = cs.getResultSet(); - - if (isResultSet) { - System.out.println("Results are: "); - while (rs.next()) { - System.out.println(rs.getObject(2)); - } - } - System.out.println("Count is =>" + cs.getObject(2)); - c.commit(); - } - - // For debug - public void testRawCall2() throws Exception { - - Connection c = getConnection(); - CallableStatement cs = c.prepareCall("{call getCustomerAndOrders(?)}"); - cs.setObject(1, new Integer(1)); - boolean isResultSet = cs.execute(); - System.out.println("call getCustomerAndOrders(?) has a result set => " - + isResultSet); - ResultSet rs = cs.getResultSet(); - - write(rs); - c.commit(); - } - - public void testGetAllOrders() throws Exception { - - System.out.println("all orders"); - Connection c = getConnection(); - PreparedStatement s = c.prepareStatement("select * from anorder"); - write (s.executeQuery()); - c.commit(); - - }*/ - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java deleted file mode 100644 index 0cdc279136..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.io.IOException; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.CustomerFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.TypeHelper; - -public class TopDown extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - // Uses dynamic SDOs but user provides the model - public void testUserProvidedModelDynamic() throws SQLException, IOException { - - // Build the select command - Command select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID", - getConfig("1xM_mapping_no_cud.xml")); - - SDOUtil.registerStaticTypes(CustomerFactory.class); - -// Set the object model - select.setDataObjectModel(TypeHelper.INSTANCE.getType(DataGraphRoot.class)); - - - // Parameterize the command - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - - // Get the graph - DataGraphRoot is from the typed package - DataGraphRoot root = (DataGraphRoot) select.executeQuery(); - - // Modify a customer - Customer customer = (Customer) root.getCustomers().get(0); - customer.setLastName("Pavick"); - - // Modify an order - AnOrder order = (AnOrder) customer.getOrders().get(0); - order.setProduct("Kitchen Sink 001"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.setMapping(getConfig("1xM_mapping_no_cud.xml")); - - // Flush changes - apply.execute((DataObject) root); - - /* - * JDBCDAS das = JDBCDAS.FACTORY.create(); // Build the select command - * CrudCommand select = CrudCommand.FACTORY.create( "select CUSTOMER.ID, - * CUSTOMER.LASTNAME, CUSTOMER.ADDRESS, ANORDER.ID, ANORDER.PRODUCT, - * ANORDER.QUANTITY, ANORDER.CUSTOMER_ID from CUSTOMER left outer join - * ANORDER on ANORDER.CUSTOMER_ID=CUSTOMER.ID where CUSTOMER.ID = :ID" , - * getMappingModel_1xM_uni_as_stream() , getGraphType()); // - * Parameterize the command select.setConnection(getConnection()); - * select.setParameter("ID", new Integer(1)); // Get the graph - * DataObject root = das.getRootDataObject(select); // Modify a customer - * DataObject customer = (DataObject) root.getList("CUSTOMER").get(0); - * customer.set("LASTNAME", "Pavick"); // Modify the first order - * DataObject order = (DataObject)customer.getList("orders").get(0); - * order.setString("PRODUCT", "Kitchen Sink 001"); // Build command for - * flush ApplyChangesCommand command = - * ApplyChangesCommand.FACTORY.create(getMappingModel_1xM_uni_as_stream()); - * command.setConnection(getConnection()); // Flush changes - * das.applyChanges(root, command); - */ - } - - /* - * //User provides the model and uses generated classes public void - * testUserProvidedModelStatic() throws SQLException, IOException { - * - * JDBCDAS das = JDBCDAS.FACTORY.create(); - * - * //Build the select command CrudCommand select = - * CrudCommand.FACTORY.create( "select CUSTOMER.ID, CUSTOMER.LASTNAME, - * CUSTOMER.ADDRESS, ANORDER.ID, ANORDER.PRODUCT, ANORDER.QUANTITY, - * ANORDER.CUSTOMER_ID from CUSTOMER left outer join ANORDER on - * ANORDER.CUSTOMER_ID=CUSTOMER.ID where CUSTOMER.ID = :ID" , - * getMappingModel_1xM_uni_as_stream() , getGraphType()); - * - * //Parameterize the command select.setConnection(getConnection()); - * select.setParameter("ID", new Integer(1)); - * - * //Get the graph DataObject root = das.getRootDataObject(getGraphType(), - * select); - * - * //Modify a customer DataGraphRoot dgRoot = (DataGraphRoot) root; // TODO - * Need to cast to Static customer and use "setLastName()" - * - * Customer customer = (Customer) dgRoot.getCustomers().get(0); - * customer.setLastName("Pavick"); - * - * //Modify the first order AnOrder order = customer.getOrders(); - * order.setProduct("Kitchen Sink 001"); - * - * //Build command for flush ApplyChangesCommand command = - * ApplyChangesCommand.FACTORY.create(getMappingModel_1xM_uni_as_stream()); - * command.setConnection(getConnection()); - * - * //Flush changes das.applyChanges(root, command); } - */ - -}
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TypeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TypeTests.java deleted file mode 100644 index fc94299ef6..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TypeTests.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This class provides tests for all supported "types". The current plan is to use the Data - * type definitions provided in the SDO 2 specification. We must test the ability to use - * all of these types as well as different mapping from thse types to types used in the - * database. For example, a SDO Data Type "STRING", might be staored as a "TIMESTAMP" in DB2. - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.TypesData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - - -public class TypeTests extends DasTest { - - - protected void setUp() throws Exception { - super.setUp(); - new TypesData(getAutoConnection()).refresh(); - } - - /** - * Read various types. - */ - public void testRead() throws Exception { - - //Read customer 1 - Command select = Command.FACTORY.createCommand("Select * from TYPETEST where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject types = (DataObject)root.get("TYPETEST[1]"); - - java.sql.Timestamp ts = (java.sql.Timestamp)types.get("ATIMESTAMP"); - assertEquals(ts, TypesData.getTimestamp()); - - float decimal = types.getFloat("ADECIMAL"); - assertEquals(1234567.89f, decimal, .0001); - - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersByLastnameCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersByLastnameCommand.java deleted file mode 100644 index 09a6147118..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersByLastnameCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - - -public class ReadCustomersByLastnameCommand extends ReadCommandImpl { - - private static final String sqlString = "select * from CUSTOMER where LASTNAME = :LASTNAME"; - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - mapping.getTable().add(t); - } - - public ReadCustomersByLastnameCommand() { - super(sqlString, mapping); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersCommand.java deleted file mode 100644 index 615ef12dab..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - - -public class ReadCustomersCommand extends ReadCommandImpl { - - private static final String sqlString = "select * from CUSTOMER"; - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - mapping.getTable().add(t); - } - - public ReadCustomersCommand() { - super(sqlString, mapping); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java deleted file mode 100644 index c8dcdebb68..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; - -import commonj.sdo.helper.TypeHelper; - - -public class ReadCustomersStaticTypesCommand extends ReadCommandImpl { - - private static final String sqlString = "Select ID, LASTNAME, ADDRESS from CUSTOMER where LASTNAME = :LASTNAME"; - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - t.setPropertyName("Customer"); - mapping.getTable().add(t); - } - - public ReadCustomersStaticTypesCommand() { - super(sqlString, mapping); - setDataObjectModel(TypeHelper.INSTANCE.getType(DataGraphRoot.class)); - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersWithShapeCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersWithShapeCommand.java deleted file mode 100644 index 82d8cefbc2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersWithShapeCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - -import commonj.sdo.Type; - -public class ReadCustomersWithShapeCommand extends ReadCommandImpl { - - // This sql string ensures that we won't have resultset metadata - private static final String sqlString = "Select * from customer union select * from customer"; - - private static final String[] columns = {"ID", "LASTNAME", "ADDRESS"}; - private static final String[] tables = {"CUSTOMER", "CUSTOMER", "CUSTOMER"}; - private static final Type[] types = {SDODataTypes.INT, SDODataTypes.STRING, SDODataTypes.STRING}; - - public ReadCustomersWithShapeCommand() { - super(sqlString); - ResultSetShape shape = new ResultSetShape(tables, columns, types); - setResultSetShape(shape); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/SimpleReadCustomersWithShapeCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/SimpleReadCustomersWithShapeCommand.java deleted file mode 100644 index 1f45ba317f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/SimpleReadCustomersWithShapeCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* Licensed 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. -*/ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - -import commonj.sdo.Type; - -public class SimpleReadCustomersWithShapeCommand extends ReadCommandImpl { - - // This sql string ensures that we won't have resultset metadata - private static final String sqlString = "Select * from customer union select * from customer"; - - private static final String[] columns = {"ID", "LASTNAME", "ADDRESS"}; - private static final String[] tables = {"CUSTOMER", "CUSTOMER", "CUSTOMER"}; - private static final Type[] types = {SDODataTypes.INT, SDODataTypes.STRING, SDODataTypes.STRING}; - - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - mapping.getTable().add(t); - } - - public SimpleReadCustomersWithShapeCommand() { - super(sqlString, mapping); - ResultSetShape shape = new ResultSetShape(tables, columns, types); - setResultSetShape(shape); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java deleted file mode 100644 index dcf1f1edd9..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - - -/** - * <!-- begin-user-doc --> - * The <b>Factory</b> for the model. - * It provides a create method for each non-abstract class of the model. - * <!-- end-user-doc --> - * @generated - */ -public interface CompanyFactory -{ - /** - * The singleton instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - CompanyFactory INSTANCE = org.apache.tuscany.das.rdb.test.company.impl.CompanyFactoryImpl.eINSTANCE; - - /** - * Returns a new object of class '<em>Type</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Type</em>'. - * @generated - */ - CompanyType createCompanyType(); - - /** - * Returns a new object of class '<em>Datagraph Root</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Datagraph Root</em>'. - * @generated - */ - DatagraphRoot createDatagraphRoot(); - - /** - * Returns a new object of class '<em>Department Type</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Department Type</em>'. - * @generated - */ - DepartmentType createDepartmentType(); - - /** - * Returns a new object of class '<em>Employee Type</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Employee Type</em>'. - * @generated - */ - EmployeeType createEmployeeType(); - -} //CompanyFactory diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java deleted file mode 100644 index bc8e95c735..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Type</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getDepartments <em>Departments</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth <em>Employee Of The Month</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getName <em>Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface CompanyType -{ - /** - * Returns the value of the '<em><b>Departments</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.DepartmentType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Departments</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Departments</em>' containment reference list. - * @generated - */ - List getDepartments(); - - /** - * Returns the value of the '<em><b>Employee Of The Month</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Employee Of The Month</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Employee Of The Month</em>' attribute. - * @see #setEmployeeOfTheMonth(String) - * @generated - */ - String getEmployeeOfTheMonth(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth <em>Employee Of The Month</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Employee Of The Month</em>' attribute. - * @see #getEmployeeOfTheMonth() - * @generated - */ - void setEmployeeOfTheMonth(String value); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - -} // CompanyType diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java deleted file mode 100644 index cdce989e1c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Datagraph Root</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getCompanies <em>Companies</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getDepartments <em>Departments</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getEmployees <em>Employees</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface DatagraphRoot -{ - /** - * Returns the value of the '<em><b>Companies</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.CompanyType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Companies</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Companies</em>' containment reference list. - * @generated - */ - List getCompanies(); - - /** - * Returns the value of the '<em><b>Departments</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.DepartmentType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Departments</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Departments</em>' containment reference list. - * @generated - */ - List getDepartments(); - - /** - * Returns the value of the '<em><b>Employees</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.EmployeeType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Employees</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Employees</em>' containment reference list. - * @generated - */ - List getEmployees(); - -} // DatagraphRoot diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java deleted file mode 100644 index 0fa23d972b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Department Type</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getEmployees <em>Employees</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation <em>Location</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber <em>Number</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface DepartmentType -{ - /** - * Returns the value of the '<em><b>Employees</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.EmployeeType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Employees</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Employees</em>' containment reference list. - * @generated - */ - List getEmployees(); - - /** - * Returns the value of the '<em><b>Location</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Location</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Location</em>' attribute. - * @see #setLocation(String) - * @generated - */ - String getLocation(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation <em>Location</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Location</em>' attribute. - * @see #getLocation() - * @generated - */ - void setLocation(String value); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the '<em><b>Number</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Number</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Number</em>' attribute. - * @see #isSetNumber() - * @see #unsetNumber() - * @see #setNumber(int) - * @generated - */ - int getNumber(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber <em>Number</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Number</em>' attribute. - * @see #isSetNumber() - * @see #unsetNumber() - * @see #getNumber() - * @generated - */ - void setNumber(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber <em>Number</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetNumber() - * @see #getNumber() - * @see #setNumber(int) - * @generated - */ - void unsetNumber(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber <em>Number</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Number</em>' attribute is set. - * @see #unsetNumber() - * @see #getNumber() - * @see #setNumber(int) - * @generated - */ - boolean isSetNumber(); - -} // DepartmentType diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java deleted file mode 100644 index ccc4dcb393..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Employee Type</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager <em>Manager</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN <em>SN</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface EmployeeType -{ - /** - * Returns the value of the '<em><b>Manager</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Manager</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Manager</em>' attribute. - * @see #isSetManager() - * @see #unsetManager() - * @see #setManager(boolean) - * @generated - */ - boolean isManager(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager <em>Manager</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Manager</em>' attribute. - * @see #isSetManager() - * @see #unsetManager() - * @see #isManager() - * @generated - */ - void setManager(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager <em>Manager</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetManager() - * @see #isManager() - * @see #setManager(boolean) - * @generated - */ - void unsetManager(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager <em>Manager</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Manager</em>' attribute is set. - * @see #unsetManager() - * @see #isManager() - * @see #setManager(boolean) - * @generated - */ - boolean isSetManager(); - - /** - * Returns the value of the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Name</em>' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getName <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the '<em><b>SN</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>SN</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>SN</em>' attribute. - * @see #setSN(String) - * @generated - */ - String getSN(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN <em>SN</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>SN</em>' attribute. - * @see #getSN() - * @generated - */ - void setSN(String value); - -} // EmployeeType diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java deleted file mode 100644 index 7ce6161e54..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import org.apache.tuscany.das.rdb.test.company.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * <!-- begin-user-doc --> - * An implementation of the model <b>Factory</b>. - * <!-- end-user-doc --> - * @generated - */ -public class CompanyFactoryImpl extends EFactoryImpl implements CompanyFactory -{ - /** - * The singleton instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final CompanyFactoryImpl eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static CompanyFactoryImpl init() - { - try - { - CompanyFactoryImpl theCompanyFactory = (CompanyFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("org.apache.tuscany.das.rdb.test/company.xsd"); - if (theCompanyFactory != null) - { - return theCompanyFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new CompanyFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CompanyFactoryImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case CompanyPackageImpl.COMPANY_TYPE: return (EObject)createCompanyType(); - case CompanyPackageImpl.DATAGRAPH_ROOT: return (EObject)createDatagraphRoot(); - case CompanyPackageImpl.DEPARTMENT_TYPE: return (EObject)createDepartmentType(); - case CompanyPackageImpl.DOCUMENT_ROOT: return (EObject)createDocumentRoot(); - case CompanyPackageImpl.EMPLOYEE_TYPE: return (EObject)createEmployeeType(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CompanyType createCompanyType() - { - CompanyTypeImpl companyType = new CompanyTypeImpl(); - return companyType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public DatagraphRoot createDatagraphRoot() - { - DatagraphRootImpl datagraphRoot = new DatagraphRootImpl(); - return datagraphRoot; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public DepartmentType createDepartmentType() - { - DepartmentTypeImpl departmentType = new DepartmentTypeImpl(); - return departmentType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EObject createDocumentRoot() - { - EObject documentRoot = super.create(CompanyPackageImpl.Literals.DOCUMENT_ROOT); - return documentRoot; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EmployeeType createEmployeeType() - { - EmployeeTypeImpl employeeType = new EmployeeTypeImpl(); - return employeeType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CompanyPackageImpl getCompanyPackageImpl() - { - return (CompanyPackageImpl)getEPackage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @deprecated - * @generated - */ - public static CompanyPackageImpl getPackage() - { - return CompanyPackageImpl.eINSTANCE; - } - -} //CompanyFactoryImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java deleted file mode 100644 index 6e8e40b107..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java +++ /dev/null @@ -1,1248 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import org.apache.tuscany.das.rdb.test.company.CompanyFactory; -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DatagraphRoot; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * <!-- begin-user-doc --> - * The <b>Package</b> for the model. - * It contains accessors for the meta objects to represent - * <ul> - * <li>each class,</li> - * <li>each feature of each class,</li> - * <li>each enum,</li> - * <li>and each data type</li> - * </ul> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.CompanyFactory - * @generated - */ -public class CompanyPackageImpl extends EPackageImpl -{ - /** - * The package name. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNAME = "company"; - - /** - * The package namespace URI. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNS_URI = "org.apache.tuscany.das.rdb.test/company.xsd"; - - /** - * The package namespace name. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNS_PREFIX = "company"; - - /** - * The singleton instance of the package. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final CompanyPackageImpl eINSTANCE = org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl.init(); - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl <em>Type</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getCompanyType() - * @generated - */ - public static final int COMPANY_TYPE = 0; - - /** - * The feature id for the '<em><b>Departments</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMPANY_TYPE__DEPARTMENTS = 0; - - /** - * The feature id for the '<em><b>Employee Of The Month</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH = 1; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMPANY_TYPE__NAME = 2; - - /** - * The number of structural features of the '<em>Type</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int COMPANY_TYPE_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl <em>Datagraph Root</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDatagraphRoot() - * @generated - */ - public static final int DATAGRAPH_ROOT = 1; - - /** - * The feature id for the '<em><b>Companies</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT__COMPANIES = 0; - - /** - * The feature id for the '<em><b>Departments</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT__DEPARTMENTS = 1; - - /** - * The feature id for the '<em><b>Employees</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT__EMPLOYEES = 2; - - /** - * The number of structural features of the '<em>Datagraph Root</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl <em>Department Type</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDepartmentType() - * @generated - */ - public static final int DEPARTMENT_TYPE = 2; - - /** - * The feature id for the '<em><b>Employees</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__EMPLOYEES = 0; - - /** - * The feature id for the '<em><b>Location</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__LOCATION = 1; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__NAME = 2; - - /** - * The feature id for the '<em><b>Number</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__NUMBER = 3; - - /** - * The number of structural features of the '<em>Department Type</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl <em>Document Root</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDocumentRoot() - * @generated - */ - public static final int DOCUMENT_ROOT = 3; - - /** - * The feature id for the '<em><b>Mixed</b></em>' attribute list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__MIXED = 0; - - /** - * The feature id for the '<em><b>XMLNS Prefix Map</b></em>' map. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; - - /** - * The feature id for the '<em><b>XSI Schema Location</b></em>' map. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; - - /** - * The feature id for the '<em><b>Company</b></em>' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__COMPANY = 3; - - /** - * The number of structural features of the '<em>Document Root</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl <em>Employee Type</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getEmployeeType() - * @generated - */ - public static final int EMPLOYEE_TYPE = 4; - - /** - * The feature id for the '<em><b>Manager</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE__MANAGER = 0; - - /** - * The feature id for the '<em><b>Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE__NAME = 1; - - /** - * The feature id for the '<em><b>SN</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE__SN = 2; - - /** - * The number of structural features of the '<em>Employee Type</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE_FEATURE_COUNT = 3; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass companyTypeEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass datagraphRootEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass departmentTypeEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass documentRootEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass employeeTypeEClass = null; - - /** - * Creates an instance of the model <b>Package</b>, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - * <p>Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#eNS_URI - * @see #init() - * @generated - */ - private CompanyPackageImpl() - { - super(eNS_URI, ((EFactory)CompanyFactory.INSTANCE)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the <b>Package</b> for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - * <p>Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - * <p>Invocation of this method will not affect any packages that have - * already been initialized. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static CompanyPackageImpl init() - { - if (isInited) return (CompanyPackageImpl)EPackage.Registry.INSTANCE.getEPackage(CompanyPackageImpl.eNS_URI); - - // Obtain or create and register package - CompanyPackageImpl theCompanyPackageImpl = (CompanyPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof CompanyPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new CompanyPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XMLTypePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theCompanyPackageImpl.createPackageContents(); - - // Initialize created meta-data - theCompanyPackageImpl.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theCompanyPackageImpl.freeze(); - - return theCompanyPackageImpl; - } - - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.CompanyType <em>Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Type</em>'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType - * @generated - */ - public EClass getCompanyType() - { - return companyTypeEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getDepartments <em>Departments</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Departments</em>'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType#getDepartments() - * @see #getCompanyType() - * @generated - */ - public EReference getCompanyType_Departments() - { - return (EReference)companyTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth <em>Employee Of The Month</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Employee Of The Month</em>'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth() - * @see #getCompanyType() - * @generated - */ - public EAttribute getCompanyType_EmployeeOfTheMonth() - { - return (EAttribute)companyTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType#getName() - * @see #getCompanyType() - * @generated - */ - public EAttribute getCompanyType_Name() - { - return (EAttribute)companyTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot <em>Datagraph Root</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Datagraph Root</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot - * @generated - */ - public EClass getDatagraphRoot() - { - return datagraphRootEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getCompanies <em>Companies</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Companies</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getCompanies() - * @see #getDatagraphRoot() - * @generated - */ - public EReference getDatagraphRoot_Companies() - { - return (EReference)datagraphRootEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getDepartments <em>Departments</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Departments</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getDepartments() - * @see #getDatagraphRoot() - * @generated - */ - public EReference getDatagraphRoot_Departments() - { - return (EReference)datagraphRootEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getEmployees <em>Employees</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Employees</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getEmployees() - * @see #getDatagraphRoot() - * @generated - */ - public EReference getDatagraphRoot_Employees() - { - return (EReference)datagraphRootEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType <em>Department Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Department Type</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType - * @generated - */ - public EClass getDepartmentType() - { - return departmentTypeEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getEmployees <em>Employees</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Employees</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getEmployees() - * @see #getDepartmentType() - * @generated - */ - public EReference getDepartmentType_Employees() - { - return (EReference)departmentTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation <em>Location</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Location</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation() - * @see #getDepartmentType() - * @generated - */ - public EAttribute getDepartmentType_Location() - { - return (EAttribute)departmentTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getName() - * @see #getDepartmentType() - * @generated - */ - public EAttribute getDepartmentType_Name() - { - return (EAttribute)departmentTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber <em>Number</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Number</em>'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber() - * @see #getDepartmentType() - * @generated - */ - public EAttribute getDepartmentType_Number() - { - return (EAttribute)departmentTypeEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.emf.ecore.EObject <em>Document Root</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Document Root</em>'. - * @see org.eclipse.emf.ecore.EObject - * @generated - */ - public EClass getDocumentRoot() - { - return documentRootEClass; - } - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.emf.ecore.EObject#getMixed <em>Mixed</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute list '<em>Mixed</em>'. - * @see org.eclipse.emf.ecore.EObject#getMixed() - * @see #getDocumentRoot() - * @generated - */ - public EAttribute getDocumentRoot_Mixed() - { - return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the map '<em>XMLNS Prefix Map</em>'. - * @see org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_XMLNSPrefixMap() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXSISchemaLocation <em>XSI Schema Location</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the map '<em>XSI Schema Location</em>'. - * @see org.eclipse.emf.ecore.EObject#getXSISchemaLocation() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_XSISchemaLocation() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.emf.ecore.EObject#getCompany <em>Company</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference '<em>Company</em>'. - * @see org.eclipse.emf.ecore.EObject#getCompany() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_Company() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType <em>Employee Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Employee Type</em>'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType - * @generated - */ - public EClass getEmployeeType() - { - return employeeTypeEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager <em>Manager</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Manager</em>'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager() - * @see #getEmployeeType() - * @generated - */ - public EAttribute getEmployeeType_Manager() - { - return (EAttribute)employeeTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getName <em>Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType#getName() - * @see #getEmployeeType() - * @generated - */ - public EAttribute getEmployeeType_Name() - { - return (EAttribute)employeeTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN <em>SN</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>SN</em>'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN() - * @see #getEmployeeType() - * @generated - */ - public EAttribute getEmployeeType_SN() - { - return (EAttribute)employeeTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the factory that creates the instances of the model. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the factory that creates the instances of the model. - * @generated - */ - public CompanyFactory getCompanyFactory() - { - return (CompanyFactory)getEFactoryInstance(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - companyTypeEClass = createEClass(COMPANY_TYPE); - createEReference(companyTypeEClass, COMPANY_TYPE__DEPARTMENTS); - createEAttribute(companyTypeEClass, COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH); - createEAttribute(companyTypeEClass, COMPANY_TYPE__NAME); - - datagraphRootEClass = createEClass(DATAGRAPH_ROOT); - createEReference(datagraphRootEClass, DATAGRAPH_ROOT__COMPANIES); - createEReference(datagraphRootEClass, DATAGRAPH_ROOT__DEPARTMENTS); - createEReference(datagraphRootEClass, DATAGRAPH_ROOT__EMPLOYEES); - - departmentTypeEClass = createEClass(DEPARTMENT_TYPE); - createEReference(departmentTypeEClass, DEPARTMENT_TYPE__EMPLOYEES); - createEAttribute(departmentTypeEClass, DEPARTMENT_TYPE__LOCATION); - createEAttribute(departmentTypeEClass, DEPARTMENT_TYPE__NAME); - createEAttribute(departmentTypeEClass, DEPARTMENT_TYPE__NUMBER); - - documentRootEClass = createEClass(DOCUMENT_ROOT); - createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); - createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); - createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); - createEReference(documentRootEClass, DOCUMENT_ROOT__COMPANY); - - employeeTypeEClass = createEClass(EMPLOYEE_TYPE); - createEAttribute(employeeTypeEClass, EMPLOYEE_TYPE__MANAGER); - createEAttribute(employeeTypeEClass, EMPLOYEE_TYPE__NAME); - createEAttribute(employeeTypeEClass, EMPLOYEE_TYPE__SN); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(companyTypeEClass, CompanyType.class, "CompanyType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCompanyType_Departments(), this.getDepartmentType(), null, "departments", null, 1, -1, CompanyType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCompanyType_EmployeeOfTheMonth(), theXMLTypePackage.getIDREF(), "employeeOfTheMonth", null, 0, 1, CompanyType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCompanyType_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, CompanyType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(datagraphRootEClass, DatagraphRoot.class, "DatagraphRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getDatagraphRoot_Companies(), this.getCompanyType(), null, "companies", null, 0, -1, DatagraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDatagraphRoot_Departments(), this.getDepartmentType(), null, "departments", null, 0, -1, DatagraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDatagraphRoot_Employees(), this.getEmployeeType(), null, "employees", null, 0, -1, DatagraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(departmentTypeEClass, DepartmentType.class, "DepartmentType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getDepartmentType_Employees(), this.getEmployeeType(), null, "employees", null, 1, -1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDepartmentType_Location(), theXMLTypePackage.getString(), "location", null, 0, 1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDepartmentType_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDepartmentType_Number(), theXMLTypePackage.getInt(), "number", null, 0, 1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(documentRootEClass, null, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_Company(), this.getCompanyType(), null, "company", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - - initEClass(employeeTypeEClass, EmployeeType.class, "EmployeeType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getEmployeeType_Manager(), theXMLTypePackage.getBoolean(), "manager", null, 0, 1, EmployeeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEmployeeType_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, EmployeeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEmployeeType_SN(), theXMLTypePackage.getID(), "sN", null, 0, 1, EmployeeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (companyTypeEClass, - source, - new String[] - { - "name", "CompanyType", - "kind", "elementOnly" - }); - addAnnotation - (getCompanyType_Departments(), - source, - new String[] - { - "kind", "element", - "name", "departments" - }); - addAnnotation - (getCompanyType_EmployeeOfTheMonth(), - source, - new String[] - { - "kind", "attribute", - "name", "employeeOfTheMonth" - }); - addAnnotation - (getCompanyType_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (datagraphRootEClass, - source, - new String[] - { - "name", "DatagraphRoot", - "kind", "elementOnly" - }); - addAnnotation - (getDatagraphRoot_Companies(), - source, - new String[] - { - "kind", "element", - "name", "companies" - }); - addAnnotation - (getDatagraphRoot_Departments(), - source, - new String[] - { - "kind", "element", - "name", "departments" - }); - addAnnotation - (getDatagraphRoot_Employees(), - source, - new String[] - { - "kind", "element", - "name", "employees" - }); - addAnnotation - (departmentTypeEClass, - source, - new String[] - { - "name", "DepartmentType", - "kind", "elementOnly" - }); - addAnnotation - (getDepartmentType_Employees(), - source, - new String[] - { - "kind", "element", - "name", "employees" - }); - addAnnotation - (getDepartmentType_Location(), - source, - new String[] - { - "kind", "attribute", - "name", "location" - }); - addAnnotation - (getDepartmentType_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getDepartmentType_Number(), - source, - new String[] - { - "kind", "attribute", - "name", "number" - }); - addAnnotation - (documentRootEClass, - source, - new String[] - { - "name", "", - "kind", "mixed" - }); - addAnnotation - (getDocumentRoot_Mixed(), - source, - new String[] - { - "kind", "elementWildcard", - "name", ":mixed" - }); - addAnnotation - (getDocumentRoot_XMLNSPrefixMap(), - source, - new String[] - { - "kind", "attribute", - "name", "xmlns:prefix" - }); - addAnnotation - (getDocumentRoot_XSISchemaLocation(), - source, - new String[] - { - "kind", "attribute", - "name", "xsi:schemaLocation" - }); - addAnnotation - (getDocumentRoot_Company(), - source, - new String[] - { - "kind", "element", - "name", "company", - "namespace", "##targetNamespace" - }); - addAnnotation - (employeeTypeEClass, - source, - new String[] - { - "name", "EmployeeType", - "kind", "empty" - }); - addAnnotation - (getEmployeeType_Manager(), - source, - new String[] - { - "kind", "attribute", - "name", "manager" - }); - addAnnotation - (getEmployeeType_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getEmployeeType_SN(), - source, - new String[] - { - "kind", "attribute", - "name", "SN" - }); - } - - /** - * <!-- begin-user-doc --> - * Defines literals for the meta objects that represent - * <ul> - * <li>each class,</li> - * <li>each feature of each class,</li> - * <li>each enum,</li> - * <li>and each data type</li> - * </ul> - * <!-- end-user-doc --> - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl <em>Type</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getCompanyType() - * @generated - */ - public static final EClass COMPANY_TYPE = eINSTANCE.getCompanyType(); - - /** - * The meta object literal for the '<em><b>Departments</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference COMPANY_TYPE__DEPARTMENTS = eINSTANCE.getCompanyType_Departments(); - - /** - * The meta object literal for the '<em><b>Employee Of The Month</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH = eINSTANCE.getCompanyType_EmployeeOfTheMonth(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute COMPANY_TYPE__NAME = eINSTANCE.getCompanyType_Name(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl <em>Datagraph Root</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDatagraphRoot() - * @generated - */ - public static final EClass DATAGRAPH_ROOT = eINSTANCE.getDatagraphRoot(); - - /** - * The meta object literal for the '<em><b>Companies</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DATAGRAPH_ROOT__COMPANIES = eINSTANCE.getDatagraphRoot_Companies(); - - /** - * The meta object literal for the '<em><b>Departments</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DATAGRAPH_ROOT__DEPARTMENTS = eINSTANCE.getDatagraphRoot_Departments(); - - /** - * The meta object literal for the '<em><b>Employees</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DATAGRAPH_ROOT__EMPLOYEES = eINSTANCE.getDatagraphRoot_Employees(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl <em>Department Type</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDepartmentType() - * @generated - */ - public static final EClass DEPARTMENT_TYPE = eINSTANCE.getDepartmentType(); - - /** - * The meta object literal for the '<em><b>Employees</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DEPARTMENT_TYPE__EMPLOYEES = eINSTANCE.getDepartmentType_Employees(); - - /** - * The meta object literal for the '<em><b>Location</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute DEPARTMENT_TYPE__LOCATION = eINSTANCE.getDepartmentType_Location(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute DEPARTMENT_TYPE__NAME = eINSTANCE.getDepartmentType_Name(); - - /** - * The meta object literal for the '<em><b>Number</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute DEPARTMENT_TYPE__NUMBER = eINSTANCE.getDepartmentType_Number(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl <em>Document Root</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDocumentRoot() - * @generated - */ - public static final EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); - - /** - * The meta object literal for the '<em><b>Mixed</b></em>' attribute list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); - - /** - * The meta object literal for the '<em><b>XMLNS Prefix Map</b></em>' map feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); - - /** - * The meta object literal for the '<em><b>XSI Schema Location</b></em>' map feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); - - /** - * The meta object literal for the '<em><b>Company</b></em>' containment reference feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DOCUMENT_ROOT__COMPANY = eINSTANCE.getDocumentRoot_Company(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl <em>Employee Type</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getEmployeeType() - * @generated - */ - public static final EClass EMPLOYEE_TYPE = eINSTANCE.getEmployeeType(); - - /** - * The meta object literal for the '<em><b>Manager</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute EMPLOYEE_TYPE__MANAGER = eINSTANCE.getEmployeeType_Manager(); - - /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute EMPLOYEE_TYPE__NAME = eINSTANCE.getEmployeeType_Name(); - - /** - * The meta object literal for the '<em><b>SN</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute EMPLOYEE_TYPE__SN = eINSTANCE.getEmployeeType_SN(); - - } - -} //CompanyPackageImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java deleted file mode 100644 index 6387e87dc8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java +++ /dev/null @@ -1,293 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Type</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getDepartments <em>Departments</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getEmployeeOfTheMonth <em>Employee Of The Month</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getName <em>Name</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class CompanyTypeImpl extends DataObjectImpl implements CompanyType -{ - /** - * The cached value of the '{@link #getDepartments() <em>Departments</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDepartments() - * @generated - * @ordered - */ - protected EList departments = null; - - /** - * The default value of the '{@link #getEmployeeOfTheMonth() <em>Employee Of The Month</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEmployeeOfTheMonth() - * @generated - * @ordered - */ - protected static final String EMPLOYEE_OF_THE_MONTH_EDEFAULT = null; - - /** - * The cached value of the '{@link #getEmployeeOfTheMonth() <em>Employee Of The Month</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEmployeeOfTheMonth() - * @generated - * @ordered - */ - protected String employeeOfTheMonth = EMPLOYEE_OF_THE_MONTH_EDEFAULT; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected CompanyTypeImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.COMPANY_TYPE; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getDepartments() - { - if (departments == null) - { - departments = new EObjectContainmentEList(DepartmentType.class, this, CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS); - } - return departments; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getEmployeeOfTheMonth() - { - return employeeOfTheMonth; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEmployeeOfTheMonth(String newEmployeeOfTheMonth) - { - String oldEmployeeOfTheMonth = employeeOfTheMonth; - employeeOfTheMonth = newEmployeeOfTheMonth; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH, oldEmployeeOfTheMonth, employeeOfTheMonth)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.COMPANY_TYPE__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - return ((InternalEList)getDepartments()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - return getDepartments(); - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - return getEmployeeOfTheMonth(); - case CompanyPackageImpl.COMPANY_TYPE__NAME: - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - getDepartments().clear(); - getDepartments().addAll((Collection)newValue); - return; - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - setEmployeeOfTheMonth((String)newValue); - return; - case CompanyPackageImpl.COMPANY_TYPE__NAME: - setName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - getDepartments().clear(); - return; - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - setEmployeeOfTheMonth(EMPLOYEE_OF_THE_MONTH_EDEFAULT); - return; - case CompanyPackageImpl.COMPANY_TYPE__NAME: - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - return departments != null && !departments.isEmpty(); - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - return EMPLOYEE_OF_THE_MONTH_EDEFAULT == null ? employeeOfTheMonth != null : !EMPLOYEE_OF_THE_MONTH_EDEFAULT.equals(employeeOfTheMonth); - case CompanyPackageImpl.COMPANY_TYPE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (employeeOfTheMonth: "); - result.append(employeeOfTheMonth); - result.append(", name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} //CompanyTypeImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java deleted file mode 100644 index 41e94ee4d3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DatagraphRoot; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Datagraph Root</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl#getCompanies <em>Companies</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl#getDepartments <em>Departments</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl#getEmployees <em>Employees</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class DatagraphRootImpl extends DataObjectImpl implements DatagraphRoot -{ - /** - * The cached value of the '{@link #getCompanies() <em>Companies</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCompanies() - * @generated - * @ordered - */ - protected EList companies = null; - - /** - * The cached value of the '{@link #getDepartments() <em>Departments</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDepartments() - * @generated - * @ordered - */ - protected EList departments = null; - - /** - * The cached value of the '{@link #getEmployees() <em>Employees</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEmployees() - * @generated - * @ordered - */ - protected EList employees = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected DatagraphRootImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.DATAGRAPH_ROOT; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getCompanies() - { - if (companies == null) - { - companies = new EObjectContainmentEList(CompanyType.class, this, CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES); - } - return companies; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getDepartments() - { - if (departments == null) - { - departments = new EObjectContainmentEList(DepartmentType.class, this, CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS); - } - return departments; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getEmployees() - { - if (employees == null) - { - employees = new EObjectContainmentEList(EmployeeType.class, this, CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES); - } - return employees; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - return ((InternalEList)getCompanies()).basicRemove(otherEnd, msgs); - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - return ((InternalEList)getDepartments()).basicRemove(otherEnd, msgs); - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - return ((InternalEList)getEmployees()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - return getCompanies(); - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - return getDepartments(); - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - return getEmployees(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - getCompanies().clear(); - getCompanies().addAll((Collection)newValue); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - getDepartments().clear(); - getDepartments().addAll((Collection)newValue); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - getEmployees().clear(); - getEmployees().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - getCompanies().clear(); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - getDepartments().clear(); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - getEmployees().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - return companies != null && !companies.isEmpty(); - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - return departments != null && !departments.isEmpty(); - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - return employees != null && !employees.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //DatagraphRootImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java deleted file mode 100644 index aed8ff1325..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Department Type</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getEmployees <em>Employees</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getLocation <em>Location</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getNumber <em>Number</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class DepartmentTypeImpl extends DataObjectImpl implements DepartmentType -{ - /** - * The cached value of the '{@link #getEmployees() <em>Employees</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEmployees() - * @generated - * @ordered - */ - protected EList employees = null; - - /** - * The default value of the '{@link #getLocation() <em>Location</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLocation() - * @generated - * @ordered - */ - protected static final String LOCATION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLocation() - * @generated - * @ordered - */ - protected String location = LOCATION_EDEFAULT; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getNumber() <em>Number</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getNumber() - * @generated - * @ordered - */ - protected static final int NUMBER_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getNumber() <em>Number</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getNumber() - * @generated - * @ordered - */ - protected int number = NUMBER_EDEFAULT; - - /** - * This is true if the Number attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean numberESet = false; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected DepartmentTypeImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.DEPARTMENT_TYPE; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getEmployees() - { - if (employees == null) - { - employees = new EObjectContainmentEList(EmployeeType.class, this, CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES); - } - return employees; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getLocation() - { - return location; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setLocation(String newLocation) - { - String oldLocation = location; - location = newLocation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION, oldLocation, location)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.DEPARTMENT_TYPE__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public int getNumber() - { - return number; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setNumber(int newNumber) - { - int oldNumber = number; - number = newNumber; - boolean oldNumberESet = numberESet; - numberESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER, oldNumber, number, !oldNumberESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetNumber() - { - int oldNumber = number; - boolean oldNumberESet = numberESet; - number = NUMBER_EDEFAULT; - numberESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER, oldNumber, NUMBER_EDEFAULT, oldNumberESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetNumber() - { - return numberESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - return ((InternalEList)getEmployees()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - return getEmployees(); - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - return getLocation(); - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - return getName(); - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - return new Integer(getNumber()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - getEmployees().clear(); - getEmployees().addAll((Collection)newValue); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - setLocation((String)newValue); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - setName((String)newValue); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - setNumber(((Integer)newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - getEmployees().clear(); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - setLocation(LOCATION_EDEFAULT); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - setName(NAME_EDEFAULT); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - unsetNumber(); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - return employees != null && !employees.isEmpty(); - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - return isSetNumber(); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (location: "); - result.append(location); - result.append(", name: "); - result.append(name); - result.append(", number: "); - if (numberESet) result.append(number); else result.append("<unset>"); - result.append(')'); - return result.toString(); - } - -} //DepartmentTypeImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java deleted file mode 100644 index a329f6a575..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java +++ /dev/null @@ -1,323 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Employee Type</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl#isManager <em>Manager</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl#getName <em>Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl#getSN <em>SN</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class EmployeeTypeImpl extends DataObjectImpl implements EmployeeType -{ - /** - * The default value of the '{@link #isManager() <em>Manager</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isManager() - * @generated - * @ordered - */ - protected static final boolean MANAGER_EDEFAULT = false; - - /** - * The cached value of the '{@link #isManager() <em>Manager</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isManager() - * @generated - * @ordered - */ - protected boolean manager = MANAGER_EDEFAULT; - - /** - * This is true if the Manager attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean managerESet = false; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getSN() <em>SN</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getSN() - * @generated - * @ordered - */ - protected static final String SN_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSN() <em>SN</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getSN() - * @generated - * @ordered - */ - protected String sN = SN_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EmployeeTypeImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.EMPLOYEE_TYPE; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isManager() - { - return manager; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setManager(boolean newManager) - { - boolean oldManager = manager; - manager = newManager; - boolean oldManagerESet = managerESet; - managerESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER, oldManager, manager, !oldManagerESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetManager() - { - boolean oldManager = manager; - boolean oldManagerESet = managerESet; - manager = MANAGER_EDEFAULT; - managerESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER, oldManager, MANAGER_EDEFAULT, oldManagerESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetManager() - { - return managerESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.EMPLOYEE_TYPE__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getSN() - { - return sN; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setSN(String newSN) - { - String oldSN = sN; - sN = newSN; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.EMPLOYEE_TYPE__SN, oldSN, sN)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - return isManager() ? Boolean.TRUE : Boolean.FALSE; - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - return getName(); - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - return getSN(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - setManager(((Boolean)newValue).booleanValue()); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - setName((String)newValue); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - setSN((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - unsetManager(); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - setName(NAME_EDEFAULT); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - setSN(SN_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - return isSetManager(); - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - return SN_EDEFAULT == null ? sN != null : !SN_EDEFAULT.equals(sN); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (manager: "); - if (managerESet) result.append(manager); else result.append("<unset>"); - result.append(", name: "); - result.append(name); - result.append(", sN: "); - result.append(sN); - result.append(')'); - return result.toString(); - } - -} //EmployeeTypeImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java deleted file mode 100644 index e08af66db2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java +++ /dev/null @@ -1,206 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>An Order</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID <em>ID</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct <em>Product</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity <em>Quantity</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID <em>Customer ID</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface AnOrder -{ - /** - * Returns the value of the '<em><b>ID</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>ID</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>ID</em>' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #setID(int) - * @generated - */ - int getID(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>ID</em>' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #getID() - * @generated - */ - void setID(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - void unsetID(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID <em>ID</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>ID</em>' attribute is set. - * @see #unsetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - boolean isSetID(); - - /** - * Returns the value of the '<em><b>Product</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Product</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Product</em>' attribute. - * @see #setProduct(String) - * @generated - */ - String getProduct(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct <em>Product</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Product</em>' attribute. - * @see #getProduct() - * @generated - */ - void setProduct(String value); - - /** - * Returns the value of the '<em><b>Quantity</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Quantity</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Quantity</em>' attribute. - * @see #isSetQuantity() - * @see #unsetQuantity() - * @see #setQuantity(int) - * @generated - */ - int getQuantity(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity <em>Quantity</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Quantity</em>' attribute. - * @see #isSetQuantity() - * @see #unsetQuantity() - * @see #getQuantity() - * @generated - */ - void setQuantity(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity <em>Quantity</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetQuantity() - * @see #getQuantity() - * @see #setQuantity(int) - * @generated - */ - void unsetQuantity(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity <em>Quantity</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Quantity</em>' attribute is set. - * @see #unsetQuantity() - * @see #getQuantity() - * @see #setQuantity(int) - * @generated - */ - boolean isSetQuantity(); - - /** - * Returns the value of the '<em><b>Customer ID</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Customer ID</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Customer ID</em>' attribute. - * @see #isSetCustomerID() - * @see #unsetCustomerID() - * @see #setCustomerID(int) - * @generated - */ - int getCustomerID(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID <em>Customer ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Customer ID</em>' attribute. - * @see #isSetCustomerID() - * @see #unsetCustomerID() - * @see #getCustomerID() - * @generated - */ - void setCustomerID(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID <em>Customer ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetCustomerID() - * @see #getCustomerID() - * @see #setCustomerID(int) - * @generated - */ - void unsetCustomerID(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID <em>Customer ID</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>Customer ID</em>' attribute is set. - * @see #unsetCustomerID() - * @see #getCustomerID() - * @see #setCustomerID(int) - * @generated - */ - boolean isSetCustomerID(); - -} // AnOrder diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java deleted file mode 100644 index d34e220d34..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Customer</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID <em>ID</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.Customer#getLastName <em>Last Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.Customer#getAddress <em>Address</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.Customer#getOrders <em>Orders</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface Customer -{ - /** - * Returns the value of the '<em><b>ID</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>ID</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>ID</em>' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #setID(int) - * @generated - */ - int getID(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>ID</em>' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #getID() - * @generated - */ - void setID(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isSetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - void unsetID(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID <em>ID</em>}' attribute is set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return whether the value of the '<em>ID</em>' attribute is set. - * @see #unsetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - boolean isSetID(); - - /** - * Returns the value of the '<em><b>Last Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Last Name</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Last Name</em>' attribute. - * @see #setLastName(String) - * @generated - */ - String getLastName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getLastName <em>Last Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Last Name</em>' attribute. - * @see #getLastName() - * @generated - */ - void setLastName(String value); - - /** - * Returns the value of the '<em><b>Address</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Address</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Address</em>' attribute. - * @see #setAddress(String) - * @generated - */ - String getAddress(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getAddress <em>Address</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Address</em>' attribute. - * @see #getAddress() - * @generated - */ - void setAddress(String value); - - /** - * Returns the value of the '<em><b>Orders</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.customer.AnOrder}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Orders</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Orders</em>' containment reference list. - * @generated - */ - List getOrders(); - -} // Customer diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java deleted file mode 100644 index d0e20b6a55..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - - -/** - * <!-- begin-user-doc --> - * The <b>Factory</b> for the model. - * It provides a create method for each non-abstract class of the model. - * <!-- end-user-doc --> - * @generated - */ -public interface CustomerFactory -{ - /** - * The singleton instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - CustomerFactory INSTANCE = org.apache.tuscany.das.rdb.test.customer.impl.CustomerFactoryImpl.eINSTANCE; - - /** - * Returns a new object of class '<em>An Order</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>An Order</em>'. - * @generated - */ - AnOrder createAnOrder(); - - /** - * Returns a new object of class '<em>Customer</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Customer</em>'. - * @generated - */ - Customer createCustomer(); - - /** - * Returns a new object of class '<em>Data Graph Root</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return a new object of class '<em>Data Graph Root</em>'. - * @generated - */ - DataGraphRoot createDataGraphRoot(); - -} //CustomerFactory diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java deleted file mode 100644 index 6229ee605b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - -import java.util.List; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Data Graph Root</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getCustomers <em>Customers</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getOrders <em>Orders</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public interface DataGraphRoot -{ - /** - * Returns the value of the '<em><b>Customers</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.customer.Customer}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Customers</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Customers</em>' containment reference list. - * @generated - */ - List getCustomers(); - - /** - * Returns the value of the '<em><b>Orders</b></em>' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.customer.AnOrder}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Orders</em>' containment reference list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Orders</em>' containment reference list. - * @generated - */ - List getOrders(); - -} // DataGraphRoot diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java deleted file mode 100644 index 94f2ee9e61..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java +++ /dev/null @@ -1,451 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>An Order</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getID <em>ID</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getProduct <em>Product</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getQuantity <em>Quantity</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getCustomerID <em>Customer ID</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class AnOrderImpl extends DataObjectImpl implements AnOrder -{ - /** - * The default value of the '{@link #getID() <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getID() - * @generated - * @ordered - */ - protected static final int ID_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getID() <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getID() - * @generated - * @ordered - */ - protected int iD = ID_EDEFAULT; - - /** - * This is true if the ID attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean iDESet = false; - - /** - * The default value of the '{@link #getProduct() <em>Product</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getProduct() - * @generated - * @ordered - */ - protected static final String PRODUCT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getProduct() <em>Product</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getProduct() - * @generated - * @ordered - */ - protected String product = PRODUCT_EDEFAULT; - - /** - * The default value of the '{@link #getQuantity() <em>Quantity</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQuantity() - * @generated - * @ordered - */ - protected static final int QUANTITY_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getQuantity() <em>Quantity</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQuantity() - * @generated - * @ordered - */ - protected int quantity = QUANTITY_EDEFAULT; - - /** - * This is true if the Quantity attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean quantityESet = false; - - /** - * The default value of the '{@link #getCustomerID() <em>Customer ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCustomerID() - * @generated - * @ordered - */ - protected static final int CUSTOMER_ID_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getCustomerID() <em>Customer ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCustomerID() - * @generated - * @ordered - */ - protected int customerID = CUSTOMER_ID_EDEFAULT; - - /** - * This is true if the Customer ID attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean customerIDESet = false; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected AnOrderImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return CustomerPackageImpl.Literals.AN_ORDER; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public int getID() - { - return iD; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setID(int newID) - { - int oldID = iD; - iD = newID; - boolean oldIDESet = iDESet; - iDESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__ID, oldID, iD, !oldIDESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetID() - { - int oldID = iD; - boolean oldIDESet = iDESet; - iD = ID_EDEFAULT; - iDESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.AN_ORDER__ID, oldID, ID_EDEFAULT, oldIDESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetID() - { - return iDESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getProduct() - { - return product; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setProduct(String newProduct) - { - String oldProduct = product; - product = newProduct; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__PRODUCT, oldProduct, product)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public int getQuantity() - { - return quantity; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setQuantity(int newQuantity) - { - int oldQuantity = quantity; - quantity = newQuantity; - boolean oldQuantityESet = quantityESet; - quantityESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__QUANTITY, oldQuantity, quantity, !oldQuantityESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetQuantity() - { - int oldQuantity = quantity; - boolean oldQuantityESet = quantityESet; - quantity = QUANTITY_EDEFAULT; - quantityESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.AN_ORDER__QUANTITY, oldQuantity, QUANTITY_EDEFAULT, oldQuantityESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetQuantity() - { - return quantityESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public int getCustomerID() - { - return customerID; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setCustomerID(int newCustomerID) - { - int oldCustomerID = customerID; - customerID = newCustomerID; - boolean oldCustomerIDESet = customerIDESet; - customerIDESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__CUSTOMER_ID, oldCustomerID, customerID, !oldCustomerIDESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetCustomerID() - { - int oldCustomerID = customerID; - boolean oldCustomerIDESet = customerIDESet; - customerID = CUSTOMER_ID_EDEFAULT; - customerIDESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.AN_ORDER__CUSTOMER_ID, oldCustomerID, CUSTOMER_ID_EDEFAULT, oldCustomerIDESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetCustomerID() - { - return customerIDESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - return new Integer(getID()); - case CustomerPackageImpl.AN_ORDER__PRODUCT: - return getProduct(); - case CustomerPackageImpl.AN_ORDER__QUANTITY: - return new Integer(getQuantity()); - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - return new Integer(getCustomerID()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - setID(((Integer)newValue).intValue()); - return; - case CustomerPackageImpl.AN_ORDER__PRODUCT: - setProduct((String)newValue); - return; - case CustomerPackageImpl.AN_ORDER__QUANTITY: - setQuantity(((Integer)newValue).intValue()); - return; - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - setCustomerID(((Integer)newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - unsetID(); - return; - case CustomerPackageImpl.AN_ORDER__PRODUCT: - setProduct(PRODUCT_EDEFAULT); - return; - case CustomerPackageImpl.AN_ORDER__QUANTITY: - unsetQuantity(); - return; - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - unsetCustomerID(); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - return isSetID(); - case CustomerPackageImpl.AN_ORDER__PRODUCT: - return PRODUCT_EDEFAULT == null ? product != null : !PRODUCT_EDEFAULT.equals(product); - case CustomerPackageImpl.AN_ORDER__QUANTITY: - return isSetQuantity(); - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - return isSetCustomerID(); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (iD: "); - if (iDESet) result.append(iD); else result.append("<unset>"); - result.append(", product: "); - result.append(product); - result.append(", quantity: "); - if (quantityESet) result.append(quantity); else result.append("<unset>"); - result.append(", customerID: "); - if (customerIDESet) result.append(customerID); else result.append("<unset>"); - result.append(')'); - return result.toString(); - } - -} //AnOrderImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java deleted file mode 100644 index e0264517cc..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import org.apache.tuscany.das.rdb.test.customer.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * <!-- begin-user-doc --> - * An implementation of the model <b>Factory</b>. - * <!-- end-user-doc --> - * @generated - */ -public class CustomerFactoryImpl extends EFactoryImpl implements CustomerFactory -{ - /** - * The singleton instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final CustomerFactoryImpl eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static CustomerFactoryImpl init() - { - try - { - CustomerFactoryImpl theCustomerFactory = (CustomerFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("http:///org.apache.tuscany.das.rdb.test/customer.xsd"); - if (theCustomerFactory != null) - { - return theCustomerFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new CustomerFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CustomerFactoryImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case CustomerPackageImpl.AN_ORDER: return (EObject)createAnOrder(); - case CustomerPackageImpl.CUSTOMER: return (EObject)createCustomer(); - case CustomerPackageImpl.DATA_GRAPH_ROOT: return (EObject)createDataGraphRoot(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public AnOrder createAnOrder() - { - AnOrderImpl anOrder = new AnOrderImpl(); - return anOrder; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Customer createCustomer() - { - CustomerImpl customer = new CustomerImpl(); - return customer; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public DataGraphRoot createDataGraphRoot() - { - DataGraphRootImpl dataGraphRoot = new DataGraphRootImpl(); - return dataGraphRoot; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CustomerPackageImpl getCustomerPackageImpl() - { - return (CustomerPackageImpl)getEPackage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @deprecated - * @generated - */ - public static CustomerPackageImpl getPackage() - { - return CustomerPackageImpl.eINSTANCE; - } - -} //CustomerFactoryImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java deleted file mode 100644 index d41df59c94..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Customer</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getID <em>ID</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getLastName <em>Last Name</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getAddress <em>Address</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getOrders <em>Orders</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class CustomerImpl extends DataObjectImpl implements Customer -{ - /** - * The default value of the '{@link #getID() <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getID() - * @generated - * @ordered - */ - protected static final int ID_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getID() <em>ID</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getID() - * @generated - * @ordered - */ - protected int iD = ID_EDEFAULT; - - /** - * This is true if the ID attribute has been set. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - protected boolean iDESet = false; - - /** - * The default value of the '{@link #getLastName() <em>Last Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLastName() - * @generated - * @ordered - */ - protected static final String LAST_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLastName() <em>Last Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLastName() - * @generated - * @ordered - */ - protected String lastName = LAST_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getAddress() <em>Address</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAddress() - * @generated - * @ordered - */ - protected static final String ADDRESS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAddress() <em>Address</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAddress() - * @generated - * @ordered - */ - protected String address = ADDRESS_EDEFAULT; - - /** - * The cached value of the '{@link #getOrders() <em>Orders</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getOrders() - * @generated - * @ordered - */ - protected EList orders = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected CustomerImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return CustomerPackageImpl.Literals.CUSTOMER; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public int getID() - { - return iD; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setID(int newID) - { - int oldID = iD; - iD = newID; - boolean oldIDESet = iDESet; - iDESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.CUSTOMER__ID, oldID, iD, !oldIDESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void unsetID() - { - int oldID = iD; - boolean oldIDESet = iDESet; - iD = ID_EDEFAULT; - iDESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.CUSTOMER__ID, oldID, ID_EDEFAULT, oldIDESet)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isSetID() - { - return iDESet; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getLastName() - { - return lastName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setLastName(String newLastName) - { - String oldLastName = lastName; - lastName = newLastName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.CUSTOMER__LAST_NAME, oldLastName, lastName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getAddress() - { - return address; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setAddress(String newAddress) - { - String oldAddress = address; - address = newAddress; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.CUSTOMER__ADDRESS, oldAddress, address)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getOrders() - { - if (orders == null) - { - orders = new EObjectContainmentEList(AnOrder.class, this, CustomerPackageImpl.CUSTOMER__ORDERS); - } - return orders; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ORDERS: - return ((InternalEList)getOrders()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - return new Integer(getID()); - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - return getLastName(); - case CustomerPackageImpl.CUSTOMER__ADDRESS: - return getAddress(); - case CustomerPackageImpl.CUSTOMER__ORDERS: - return getOrders(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - setID(((Integer)newValue).intValue()); - return; - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - setLastName((String)newValue); - return; - case CustomerPackageImpl.CUSTOMER__ADDRESS: - setAddress((String)newValue); - return; - case CustomerPackageImpl.CUSTOMER__ORDERS: - getOrders().clear(); - getOrders().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - unsetID(); - return; - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - setLastName(LAST_NAME_EDEFAULT); - return; - case CustomerPackageImpl.CUSTOMER__ADDRESS: - setAddress(ADDRESS_EDEFAULT); - return; - case CustomerPackageImpl.CUSTOMER__ORDERS: - getOrders().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - return isSetID(); - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName); - case CustomerPackageImpl.CUSTOMER__ADDRESS: - return ADDRESS_EDEFAULT == null ? address != null : !ADDRESS_EDEFAULT.equals(address); - case CustomerPackageImpl.CUSTOMER__ORDERS: - return orders != null && !orders.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (iD: "); - if (iDESet) result.append(iD); else result.append("<unset>"); - result.append(", lastName: "); - result.append(lastName); - result.append(", address: "); - result.append(address); - result.append(')'); - return result.toString(); - } - -} //CustomerImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java deleted file mode 100644 index c847afd6ce..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java +++ /dev/null @@ -1,837 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.CustomerFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * <!-- begin-user-doc --> - * The <b>Package</b> for the model. - * It contains accessors for the meta objects to represent - * <ul> - * <li>each class,</li> - * <li>each feature of each class,</li> - * <li>each enum,</li> - * <li>and each data type</li> - * </ul> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.customer.CustomerFactory - * @generated - */ -public class CustomerPackageImpl extends EPackageImpl -{ - /** - * The package name. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNAME = "customer"; - - /** - * The package namespace URI. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNS_URI = "http:///org.apache.tuscany.das.rdb.test/customer.xsd"; - - /** - * The package namespace name. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final String eNS_PREFIX = "customer"; - - /** - * The singleton instance of the package. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final CustomerPackageImpl eINSTANCE = org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl.init(); - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl <em>An Order</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getAnOrder() - * @generated - */ - public static final int AN_ORDER = 0; - - /** - * The feature id for the '<em><b>ID</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int AN_ORDER__ID = 0; - - /** - * The feature id for the '<em><b>Product</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int AN_ORDER__PRODUCT = 1; - - /** - * The feature id for the '<em><b>Quantity</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int AN_ORDER__QUANTITY = 2; - - /** - * The feature id for the '<em><b>Customer ID</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int AN_ORDER__CUSTOMER_ID = 3; - - /** - * The number of structural features of the '<em>An Order</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int AN_ORDER_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl <em>Customer</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getCustomer() - * @generated - */ - public static final int CUSTOMER = 1; - - /** - * The feature id for the '<em><b>ID</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CUSTOMER__ID = 0; - - /** - * The feature id for the '<em><b>Last Name</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CUSTOMER__LAST_NAME = 1; - - /** - * The feature id for the '<em><b>Address</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CUSTOMER__ADDRESS = 2; - - /** - * The feature id for the '<em><b>Orders</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CUSTOMER__ORDERS = 3; - - /** - * The number of structural features of the '<em>Customer</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int CUSTOMER_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl <em>Data Graph Root</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getDataGraphRoot() - * @generated - */ - public static final int DATA_GRAPH_ROOT = 2; - - /** - * The feature id for the '<em><b>Customers</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DATA_GRAPH_ROOT__CUSTOMERS = 0; - - /** - * The feature id for the '<em><b>Orders</b></em>' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DATA_GRAPH_ROOT__ORDERS = 1; - - /** - * The number of structural features of the '<em>Data Graph Root</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int DATA_GRAPH_ROOT_FEATURE_COUNT = 2; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass anOrderEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass customerEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass dataGraphRootEClass = null; - - /** - * Creates an instance of the model <b>Package</b>, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - * <p>Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#eNS_URI - * @see #init() - * @generated - */ - private CustomerPackageImpl() - { - super(eNS_URI, ((EFactory)CustomerFactory.INSTANCE)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the <b>Package</b> for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - * <p>Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - * <p>Invocation of this method will not affect any packages that have - * already been initialized. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static CustomerPackageImpl init() - { - if (isInited) return (CustomerPackageImpl)EPackage.Registry.INSTANCE.getEPackage(CustomerPackageImpl.eNS_URI); - - // Obtain or create and register package - CustomerPackageImpl theCustomerPackageImpl = (CustomerPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof CustomerPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new CustomerPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XMLTypePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theCustomerPackageImpl.createPackageContents(); - - // Initialize created meta-data - theCustomerPackageImpl.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theCustomerPackageImpl.freeze(); - - return theCustomerPackageImpl; - } - - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder <em>An Order</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>An Order</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder - * @generated - */ - public EClass getAnOrder() - { - return anOrderEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID <em>ID</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>ID</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getID() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_ID() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct <em>Product</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Product</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_Product() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity <em>Quantity</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Quantity</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_Quantity() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID <em>Customer ID</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Customer ID</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_CustomerID() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.customer.Customer <em>Customer</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Customer</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer - * @generated - */ - public EClass getCustomer() - { - return customerEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID <em>ID</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>ID</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getID() - * @see #getCustomer() - * @generated - */ - public EAttribute getCustomer_ID() - { - return (EAttribute)customerEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getLastName <em>Last Name</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Last Name</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getLastName() - * @see #getCustomer() - * @generated - */ - public EAttribute getCustomer_LastName() - { - return (EAttribute)customerEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getAddress <em>Address</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Address</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getAddress() - * @see #getCustomer() - * @generated - */ - public EAttribute getCustomer_Address() - { - return (EAttribute)customerEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getOrders <em>Orders</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Orders</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getOrders() - * @see #getCustomer() - * @generated - */ - public EReference getCustomer_Orders() - { - return (EReference)customerEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot <em>Data Graph Root</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Data Graph Root</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.DataGraphRoot - * @generated - */ - public EClass getDataGraphRoot() - { - return dataGraphRootEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getCustomers <em>Customers</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Customers</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getCustomers() - * @see #getDataGraphRoot() - * @generated - */ - public EReference getDataGraphRoot_Customers() - { - return (EReference)dataGraphRootEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getOrders <em>Orders</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the containment reference list '<em>Orders</em>'. - * @see org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getOrders() - * @see #getDataGraphRoot() - * @generated - */ - public EReference getDataGraphRoot_Orders() - { - return (EReference)dataGraphRootEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the factory that creates the instances of the model. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the factory that creates the instances of the model. - * @generated - */ - public CustomerFactory getCustomerFactory() - { - return (CustomerFactory)getEFactoryInstance(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - anOrderEClass = createEClass(AN_ORDER); - createEAttribute(anOrderEClass, AN_ORDER__ID); - createEAttribute(anOrderEClass, AN_ORDER__PRODUCT); - createEAttribute(anOrderEClass, AN_ORDER__QUANTITY); - createEAttribute(anOrderEClass, AN_ORDER__CUSTOMER_ID); - - customerEClass = createEClass(CUSTOMER); - createEAttribute(customerEClass, CUSTOMER__ID); - createEAttribute(customerEClass, CUSTOMER__LAST_NAME); - createEAttribute(customerEClass, CUSTOMER__ADDRESS); - createEReference(customerEClass, CUSTOMER__ORDERS); - - dataGraphRootEClass = createEClass(DATA_GRAPH_ROOT); - createEReference(dataGraphRootEClass, DATA_GRAPH_ROOT__CUSTOMERS); - createEReference(dataGraphRootEClass, DATA_GRAPH_ROOT__ORDERS); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(anOrderEClass, AnOrder.class, "AnOrder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getAnOrder_ID(), theXMLTypePackage.getInt(), "iD", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAnOrder_Product(), theXMLTypePackage.getString(), "product", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAnOrder_Quantity(), theXMLTypePackage.getInt(), "quantity", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAnOrder_CustomerID(), theXMLTypePackage.getInt(), "customerID", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(customerEClass, Customer.class, "Customer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getCustomer_ID(), theXMLTypePackage.getInt(), "iD", null, 1, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCustomer_LastName(), theXMLTypePackage.getString(), "lastName", null, 1, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCustomer_Address(), theXMLTypePackage.getString(), "address", null, 1, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getCustomer_Orders(), this.getAnOrder(), null, "orders", null, 1, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(dataGraphRootEClass, DataGraphRoot.class, "DataGraphRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getDataGraphRoot_Customers(), this.getCustomer(), null, "customers", null, 0, -1, DataGraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDataGraphRoot_Orders(), this.getAnOrder(), null, "orders", null, 0, -1, DataGraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (anOrderEClass, - source, - new String[] - { - "name", "AnOrder", - "kind", "elementOnly" - }); - addAnnotation - (getAnOrder_ID(), - source, - new String[] - { - "kind", "element", - "name", "ID" - }); - addAnnotation - (getAnOrder_Product(), - source, - new String[] - { - "kind", "element", - "name", "Product" - }); - addAnnotation - (getAnOrder_Quantity(), - source, - new String[] - { - "kind", "element", - "name", "Quantity" - }); - addAnnotation - (getAnOrder_CustomerID(), - source, - new String[] - { - "kind", "element", - "name", "Customer_ID" - }); - addAnnotation - (customerEClass, - source, - new String[] - { - "name", "Customer", - "kind", "elementOnly" - }); - addAnnotation - (getCustomer_ID(), - source, - new String[] - { - "kind", "element", - "name", "ID" - }); - addAnnotation - (getCustomer_LastName(), - source, - new String[] - { - "kind", "element", - "name", "lastName" - }); - addAnnotation - (getCustomer_Address(), - source, - new String[] - { - "kind", "element", - "name", "address" - }); - addAnnotation - (getCustomer_Orders(), - source, - new String[] - { - "kind", "element", - "name", "orders" - }); - addAnnotation - (dataGraphRootEClass, - source, - new String[] - { - "name", "DataGraphRoot", - "kind", "elementOnly" - }); - addAnnotation - (getDataGraphRoot_Customers(), - source, - new String[] - { - "kind", "element", - "name", "customers" - }); - addAnnotation - (getDataGraphRoot_Orders(), - source, - new String[] - { - "kind", "element", - "name", "orders" - }); - } - - /** - * <!-- begin-user-doc --> - * Defines literals for the meta objects that represent - * <ul> - * <li>each class,</li> - * <li>each feature of each class,</li> - * <li>each enum,</li> - * <li>and each data type</li> - * </ul> - * <!-- end-user-doc --> - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl <em>An Order</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getAnOrder() - * @generated - */ - public static final EClass AN_ORDER = eINSTANCE.getAnOrder(); - - /** - * The meta object literal for the '<em><b>ID</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute AN_ORDER__ID = eINSTANCE.getAnOrder_ID(); - - /** - * The meta object literal for the '<em><b>Product</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute AN_ORDER__PRODUCT = eINSTANCE.getAnOrder_Product(); - - /** - * The meta object literal for the '<em><b>Quantity</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute AN_ORDER__QUANTITY = eINSTANCE.getAnOrder_Quantity(); - - /** - * The meta object literal for the '<em><b>Customer ID</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute AN_ORDER__CUSTOMER_ID = eINSTANCE.getAnOrder_CustomerID(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl <em>Customer</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getCustomer() - * @generated - */ - public static final EClass CUSTOMER = eINSTANCE.getCustomer(); - - /** - * The meta object literal for the '<em><b>ID</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CUSTOMER__ID = eINSTANCE.getCustomer_ID(); - - /** - * The meta object literal for the '<em><b>Last Name</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CUSTOMER__LAST_NAME = eINSTANCE.getCustomer_LastName(); - - /** - * The meta object literal for the '<em><b>Address</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute CUSTOMER__ADDRESS = eINSTANCE.getCustomer_Address(); - - /** - * The meta object literal for the '<em><b>Orders</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference CUSTOMER__ORDERS = eINSTANCE.getCustomer_Orders(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl <em>Data Graph Root</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getDataGraphRoot() - * @generated - */ - public static final EClass DATA_GRAPH_ROOT = eINSTANCE.getDataGraphRoot(); - - /** - * The meta object literal for the '<em><b>Customers</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DATA_GRAPH_ROOT__CUSTOMERS = eINSTANCE.getDataGraphRoot_Customers(); - - /** - * The meta object literal for the '<em><b>Orders</b></em>' containment reference list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference DATA_GRAPH_ROOT__ORDERS = eINSTANCE.getDataGraphRoot_Orders(); - - } - -} //CustomerPackageImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java deleted file mode 100644 index 5031b58870..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Data Graph Root</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl#getCustomers <em>Customers</em>}</li> - * <li>{@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl#getOrders <em>Orders</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class DataGraphRootImpl extends DataObjectImpl implements DataGraphRoot -{ - /** - * The cached value of the '{@link #getCustomers() <em>Customers</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getCustomers() - * @generated - * @ordered - */ - protected EList customers = null; - - /** - * The cached value of the '{@link #getOrders() <em>Orders</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getOrders() - * @generated - * @ordered - */ - protected EList orders = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected DataGraphRootImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return CustomerPackageImpl.Literals.DATA_GRAPH_ROOT; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getCustomers() - { - if (customers == null) - { - customers = new EObjectContainmentEList(Customer.class, this, CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS); - } - return customers; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public List getOrders() - { - if (orders == null) - { - orders = new EObjectContainmentEList(AnOrder.class, this, CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS); - } - return orders; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - return ((InternalEList)getCustomers()).basicRemove(otherEnd, msgs); - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - return ((InternalEList)getOrders()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - return getCustomers(); - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - return getOrders(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - getCustomers().clear(); - getCustomers().addAll((Collection)newValue); - return; - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - getOrders().clear(); - getOrders().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - getCustomers().clear(); - return; - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - getOrders().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - return customers != null && !customers.isEmpty(); - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - return orders != null && !orders.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //DataGraphRootImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java deleted file mode 100644 index 4b55d417eb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class BookData extends TestDataWithExplicitColumns { - - //CREATE TABLE BOOK (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), AUTHOR VARCHAR(30), QUANTITY INT, OCC INTEGER) - - private static int[] bookTypes = {Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER}; - - private static Object[][] bookData = { - { new Integer(1), "The Brothers Karamazov", "Fyodor Dostoevsky", new Integer(5), new Integer(17) }, - { new Integer(2), "Cat in the Hat", "Doctor Seuss", new Integer(10), new Integer(1) }}; - - private static String[] bookColumns = { "ID", "NAME", "AUTHOR", "QUANTITY", "OCC"}; - - public BookData(Connection connection) { - super(connection, bookData, bookColumns, bookTypes); - } - - public String getTableName() { - return "BOOK"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java deleted file mode 100644 index 0ebbd6c5af..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class CityData extends TestData { - - private static Object[][] cityData = { - {new Integer(1), "Lizard Lick", "1"}, - {new Integer(2), "Morrisville", "1"}, - {new Integer(3), "Breckenridge", "2"}, - {new Integer(4), "Barstow", "3"}, - {new Integer(5), "Sacramento", "3"} - - }; - - public CityData(Connection c) { - super(c, cityData); - } - - public String getTableName() { - return "CITIES"; - } - - public void doDeletes() throws SQLException { - deleteRowsFromTable(); - - } - - public void doInserts() throws SQLException { - insertRows(); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java deleted file mode 100644 index 9c49004ba5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class CompanyData extends TestDataWithExplicitColumns { - - //CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY ,NAME VARCHAR(30)) - - private static int[] columnTypes = {Types.VARCHAR}; - - private static Object[][] companyData = { { "ACME Publishing" }, - { "Do-rite plumbing" }, - { "MegaCorp" } }; - - private static String[] companyColumns = { "NAME" }; - - public CompanyData(Connection connection) { - super(connection, companyData, companyColumns, columnTypes); - } - - public String getTableName() { - return "COMPANY"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java deleted file mode 100644 index 66d0c25369..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.RelationshipData; - - -public class CompanyDeptData extends RelationshipData { - - public static Object[][] data = { - {"MegaCorp", "Advanced Technologies"} - }; - - public CompanyDeptData(Connection c) { - super(c, data); - } - - protected String getParentRetrievalStatement() { - return "select id from company where name = ?"; - } - - protected String getChildUpdateStatement() { - return "update department set companyid = ? where department.name = ?"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java deleted file mode 100644 index 149bcfc71b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class CustomerData extends TestData { - - private static Object[][] customerData = { - {new Integer(1), "Williams", "1212 foobar lane"}, - {new Integer(2), "Daniel", "156 Brentfield Loop"}, - {new Integer(3), "Williams", "456 penny lane"}, - {new Integer(4), "Williams", "5000 pineville"}, - {new Integer(5), "Williams", "100000 firefly lane"} - }; - - public CustomerData(Connection connection) { - super(connection, customerData); - } - - - public String getTableName() { - return "CUSTOMER"; - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java deleted file mode 100644 index fbd9cf7cab..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.RelationshipData; - - -public class DepEmpData extends RelationshipData { - - private static Object[][] data = { - {"Advanced Technologies", "John Jones"}, - {"Advanced Technologies", "Jane Doe"}, - {"Advanced Technologies", "Al Smith"} - }; - - - public DepEmpData(Connection c) { - super(c, data); - } - - protected String getParentRetrievalStatement() { - return "select department.id from department where department.name = ?"; - } - - protected String getChildUpdateStatement() { - return "update employee set employee.departmentid = ? where employee.name = ?"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java deleted file mode 100644 index d3c10affdd..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class DepartmentData extends TestDataWithExplicitColumns { - - private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.VARCHAR}; - - private static Object[][] deptData = { { "Advanced Technologies", "NY", "123" } }; - - private static String[] deptColumns = { "NAME", "LOCATION", "NUMBER" }; - - public DepartmentData(Connection connection) { - super(connection, deptData, deptColumns, columnTypes); - } - - public String getTableName() { - return "DEPARTMENT"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java deleted file mode 100644 index 82dcbe4cb3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class EmployeeData extends TestDataWithExplicitColumns { - - private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.SMALLINT}; - - private static Object[][] employeeData = { { "John Jones", "E0001", new Boolean(false) }, - { "Mary Smith", "E0002", new Boolean(true)}, - { "Jane Doe", "E0003", new Boolean(false)}, - { "Al Smith", "E0004", new Boolean(true) } }; - - private static String[] employeeColumns = { "NAME", "SN", "MANAGER" }; - - public EmployeeData(Connection connection) { - super(connection, employeeData, employeeColumns, columnTypes); - } - - public String getTableName() { - return "EMPLOYEE"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java deleted file mode 100644 index e6a52204f8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class OrderData extends TestData { - - - public static Object[][] orderData = { - {new Integer(1), "recombobulator", new Integer(47), new Integer(1)}, - {new Integer(2), "wrench", new Integer(17), new Integer(3)}, - {new Integer(3), "pliers", new Integer(500), new Integer(1)}, - {new Integer(4), "Tooth Paste", new Integer(12), new Integer(2)} - }; - - public OrderData(Connection c) { - super(c, orderData); - } - - public String getTableName() { - return "ANORDER"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderDetailsData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderDetailsData.java deleted file mode 100644 index 9193f7c6d5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderDetailsData.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class OrderDetailsData extends TestData { - - //CREATE TABLE ORDERDETAILS (ORDERID INT NOT NULL, PRODUCTID INT NOT NULL, PRICE FLOAT, PRIMARY KEY (ORDERID, PRODUCTID)) - - public static Object[][] orderDetailsData = { - {new Integer(1), new Integer(1), new Float(1.1)}, - {new Integer(1), new Integer(2), new Float(1.2)}, - {new Integer(2), new Integer(1), new Float(2.1)}, - {new Integer(2), new Integer(2), new Float(2.2)} - }; - - public OrderDetailsData(Connection c) { - super(c, orderDetailsData); - } - - public String getTableName() { - return "ORDERDETAILS"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java deleted file mode 100644 index dd78b1be35..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class PartData extends TestDataWithExplicitColumns { - - - //CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT ) - - private static String[] partColumns = { "ID" , "NAME", "QUANTITY", "PARENT_ID"}; - - private static int[] columnTypes = {Types.INTEGER, Types.VARCHAR, Types.INTEGER, Types.INTEGER}; - - private static Object[][] partData = { - {new Integer(1), "Engine", new Integer(1), null}, - {new Integer(2), "Block", new Integer(1), new Integer(1)}, - {new Integer(3), "Cam Shaft", new Integer(2), new Integer(1)}, - {new Integer(4), "Piston", new Integer(8), new Integer(1)}, - {new Integer(5), "Piston Ring", new Integer(2), new Integer(4)} - }; - - public PartData(Connection connection) { - super(connection, partData, partColumns, columnTypes); - } - - public String getTableName() { - return "PART"; - } - -} - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java deleted file mode 100644 index 0c6d41d096..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class StateData extends TestData { - - public StateData(Connection c) { - super(c, stateData); - } - - public String getTableName() { - return "STATES"; - } - - private static Object[][] stateData = { - {new Integer(1), "NC"}, - {new Integer(2), "CO"}, - {new Integer(3), "CA"} - }; - - public void doDeletes() throws SQLException { - deleteRowsFromTable(); - } - - public void doInserts() throws SQLException { - insertRows(); - - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java deleted file mode 100644 index 1097b07cc5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class TypesData extends TestData { - - private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:ss:mm.SSS"); - private static Timestamp timestamp = getTimestamp(); - - private static Object[][] customerData = { - {new Integer(1), timestamp, new Float(1234567.89), new Float(1234567.89)} - }; - - public TypesData(Connection connection) { - super(connection, customerData); - } - - public String getTableName() { - return "TYPETEST"; - } - - - //Utilities - private static Date getDate() { - - try { - return dateFormat.parse("1966-12-20 00:00:00.0"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - - } - - public static Timestamp getTimestamp() { - - return new Timestamp(getDate().getTime()); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java deleted file mode 100644 index 75df028490..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import junit.framework.Test; - -public class DB2Setup extends DatabaseSetup { - - public DB2Setup(Test test) { - super(test); - } - - protected void initConnectionProtocol() { - - platformName = "DB2"; - driverName = "com.ibm.db2.jcc.DB2Driver"; - databaseURL = "jdbc:db2:DASTEST"; - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java deleted file mode 100644 index c4e75d20a8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; -import java.util.Iterator; -import java.util.List; - -import junit.framework.TestCase; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -/** - * - */ -public class DasTest extends TestCase { - - public static Connection connection = null; - private boolean usingDefaultSetup = false; - - /** - * Tears down the fixture, for example, close a network connection. This - * method is called after a test is executed. - */ - protected void tearDown() throws Exception { -// if (usingDefaultSetup) -// connection = null; - } - - protected Connection getAutoConnection() throws SQLException { - - Connection c = primGetConnection(); - c.setAutoCommit(true); - return connection; - - } - - protected Connection getConnection() throws SQLException { - - Connection c = primGetConnection(); - c.setAutoCommit(false); - return connection; - } - - /** - * This provides the default connection for runing single test cases on a - * chosen platform. - */ - private Connection primGetConnection() { - if (connection == null) - defaultSetup(); - return connection; - } - - - - /** - * This is a bit of a hack since it counts on constructor initialization of the - * DatabaseSet up class and also calls its setUp method directly. This is a misuse - * of this JUnit TestSetup subclass . - * - * TODO - refactor to avoid this hackiness ... could move this logic to its own - * class that is then invoked by DatabaseSetUp - */ - private void defaultSetup() { - - usingDefaultSetup = true; - -// DatabaseSetup setUp = new DB2Setup(this); - DatabaseSetup setUp = new DerbySetup(this); - try { - setUp.setUp(); - } catch (Exception e) { - throw new RuntimeException(e); - } - - } - - - //Utilities - protected InputStream getConfig(String fileName) throws FileNotFoundException { - return Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); - } - - protected void write(String label, ResultSet rs) throws IOException, SQLException { - - ResultSetMetaData md = rs.getMetaData(); - int count = md.getColumnCount(); - System.out.println("Contents of ResultSet from " + label); - for (int i = 1; i <= count; i++) { - System.out.print("\t"); - System.out.println (md.getColumnLabel(i)); - } - System.out.println(""); - while (rs.next()) { - for (int i = 1; i <= count; i++) { - System.out.print("\t"); - System.out.print(rs.getString(i)); - } - System.out.println("\t"); - } - System.out.println("done"); - } - - - protected void printList(List data) { - Iterator i = data.iterator(); - while ( i.hasNext()) { - System.out.println(); - DataObject obj = (DataObject) i.next(); - Iterator props = obj.getType().getProperties().iterator(); - while ( props.hasNext()) { - Property p = (Property) props.next(); - if ( p.isMany() ) { - System.out.print("[ " + p.getName() + " ] "); - Iterator children = obj.getList(p).iterator(); - while ( children.hasNext()) { - DataObject child = (DataObject) children.next(); - System.out.print("[ " + child.get("ID") + " ]"); - } - System.out.println(); - } else if ( !p.getType().isDataType()) { - DataObject child = obj.getDataObject(p); - if ( child != null ) - System.out.println("[ " + p.getName() + " ] " + "[ " + child.get("ID") + " ]"); - } else { - System.out.println("[ " + p.getName() + " ] " + obj.get(p)); - } - } - } - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java deleted file mode 100644 index f0bd99c5e1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; - -import junit.extensions.TestSetup; -import junit.framework.Test; - -public class DatabaseSetup extends TestSetup { - - protected String platformName = "Not initialized"; - - protected String driverName = "Not initialized"; - - protected String databaseURL = "Not initialized"; - - private Connection connection; - - protected Statement s; - - public DatabaseSetup(Test test) { - super(test); - initConnectionProtocol(); - initConnection(); - DasTest.connection = connection; - } - - protected void initConnectionProtocol() { - // Subclasses provide implementation - } - - private void initConnection() { - - try { - - Class.forName(driverName).newInstance(); - connection = DriverManager.getConnection(databaseURL); - connection.setAutoCommit(false); - - } catch (Exception e) { - if (e instanceof SQLException) - ((SQLException) e).getNextException().printStackTrace(); - throw new RuntimeException(e); - } - - } - - protected void setUp() throws Exception { - - System.out.println("Setting up for " + platformName + " run"); - - s = connection.createStatement(); - - try { - dropTables(); - dropProcedures(); - createTables(); - createProcedures(); - connection.commit(); - } catch (SQLException e) { - connection.rollback(); - } - - } - - protected void tearDown() throws Exception { - - System.out.println("Ending " + platformName + " run"); - connection.close(); - - } - - private void dropTables() { - - System.out.println("Dropping tables"); - - String[] statements = { - - "DROP TABLE CUSTOMER", "DROP TABLE ANORDER", "DROP TABLE ORDERDETAILS", "DROP TABLE ITEM", "DROP TABLE COMPANY", - "DROP TABLE EMPLOYEE", "DROP TABLE DEPARTMENT", "DROP TABLE BOOK", "DROP TABLE PART", "DROP TABLE TYPETEST", - "DROP TABLE CITIES", "DROP TABLE STATES", "DROP TABLE conmgt.SERVERSTATUS" - - }; - - for (int i = 0; i < statements.length; i++) { - try { - s.execute(statements[i]); - } catch (SQLException e) { - //If the table does not exist then ignore the exception on drop - if (!e.getMessage().contains("does not exist")) - throw new RuntimeException(e); - } - } - } - - protected void dropProcedures() { - - System.out.println("Dropping procedures"); - - String[] statements = { - - "DROP PROCEDURE GETALLCOMPANIES", "DROP PROCEDURE DELETECUSTOMER", "DROP PROCEDURE GETNAMEDCOMPANY", - "DROP PROCEDURE GETCUSTOMERANDORDERS", - // "DROP PROCEDURE GETNAMEDCUSTOMERS" - - }; - - for (int i = 0; i < statements.length; i++) { - try { - s.execute(statements[i]); - } catch (SQLException e) { - //If the proc does not exist then ignore the exception on drop - if (!e.getMessage().contains("does not exist")) - throw new RuntimeException(e); - } - } - } - - private void createTables() { - - System.out.println("Creating tables"); - - try { - - s.execute(getCreateCustomer()); - s.execute(getCreateAnOrder()); - s.execute(getCreateOrderDetails()); - s.execute(getCreateItem()); - s.execute(getCreateCompany()); - s.execute(getCreateEmployee()); - s.execute(getCreateDepartment()); - s.execute(getCreateBook()); - s.execute(getCreatePart()); - s.execute(getCreateTypeTest()); - s.execute(getCreateStates()); - s.execute(getCreateCities()); - s.execute(getCreateServerStatus()); - - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - protected void createProcedures() { - - System.out.println("Creating procedures"); - try { - - s - .execute("CREATE PROCEDURE GETALLCOMPANIES() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getAllCompanies'"); - s - .execute("CREATE PROCEDURE DELETECUSTOMER(theId int) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.deleteCustomer'"); - s - .execute("CREATE PROCEDURE GETNAMEDCOMPANY(theName VARCHAR(100)) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getNamedCompany'"); - s - .execute("CREATE PROCEDURE GETCUSTOMERANDORDERS(theID INTEGER) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getCustomerAndOrders'"); - // TODO s.execute("CREATE PROCEDURE GETNAMEDCUSTOMERS(theName - // VARCHAR(100), OUT theCount INTEGER) PARAMETER STYLE JAVA LANGUAGE - // JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME - // 'tests.framework.JavaStoredProcs.getNamedCustomers'"); - // This is failing on DB2 with SQLCODE: 42723. Need to investigate - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - // - // This section povides methods that return strings for table creation. - // Platform-specific sublcasses - // can override these as necessary - // - - protected String getCreateCustomer() { - return "CREATE TABLE CUSTOMER (ID INT PRIMARY KEY NOT NULL, LASTNAME VARCHAR(30) DEFAULT 'Garfugengheist', ADDRESS VARCHAR(30))"; - } - - protected String getCreateAnOrder() { - return "CREATE TABLE ANORDER (ID INT PRIMARY KEY NOT NULL, PRODUCT VARCHAR(30), QUANTITY INT, CUSTOMER_ID INT)"; - } - - protected String getCreateOrderDetails() { - return "CREATE TABLE ORDERDETAILS (ORDERID INT NOT NULL, PRODUCTID INT NOT NULL, PRICE FLOAT, PRIMARY KEY (ORDERID, PRODUCTID))"; - } - - protected String getCreateItem() { - return "CREATE TABLE ITEM (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(30))"; - } - - protected String getCreateCompany() { - return "CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY ,NAME VARCHAR(30))"; - } - - protected String getCreateEmployee() { - return "CREATE TABLE EMPLOYEE (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, NAME VARCHAR(30), SN VARCHAR(10), MANAGER SMALLINT, DEPARTMENTID INT)"; - } - - protected String getCreateDepartment() { - return "CREATE TABLE DEPARTMENT (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT)"; - } - - protected String getCreateBook() { - return "CREATE TABLE BOOK (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), AUTHOR VARCHAR(30), QUANTITY INT, OCC INTEGER)"; - } - - protected String getCreatePart() { - return "CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT )"; - } - - protected String getCreateTypeTest() { - return "CREATE TABLE TYPETEST (ID INT PRIMARY KEY NOT NULL, ATIMESTAMP TIMESTAMP, ADECIMAL DECIMAL(9,2), AFLOAT FLOAT)"; - } - - protected String getCreateStates() { - return "CREATE TABLE STATES (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(2))"; - } - - protected String getCreateCities() { - return "CREATE TABLE CITIES (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), STATE_ID INT, CONSTRAINT FK1 FOREIGN KEY (STATE_ID) REFERENCES STATES (ID) ON DELETE NO ACTION ON UPDATE NO ACTION)"; - } - - protected String getCreateServerStatus() { - - return "CREATE TABLE CONMGT.SERVERSTATUS (STATUSID INTEGER PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 ,INCREMENT BY 1), MANAGEDSERVERID INTEGER NOT NULL, TIMESTAMP TIMESTAMP NOT NULL)"; - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DerbySetup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DerbySetup.java deleted file mode 100644 index 082b1ec50a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DerbySetup.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.util.Properties; - -import junit.framework.Test; - -public class DerbySetup extends DatabaseSetup { - - public DerbySetup(Test test) { - super(test); - } - - protected void initConnectionProtocol() { - - //Set the derby property to explicitly specify the database location relative - //from current directory to "target" - Properties p = System.getProperties(); - p.put("derby.system.home", "target"); - - platformName = "Derby"; - driverName = "org.apache.derby.jdbc.EmbeddedDriver"; - databaseURL = "jdbc:derby:dastest; create = true"; - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java deleted file mode 100644 index b993893a85..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -/** - * Stored Procedures for DB2 and Derby SP tests - * - */ -public class JavaStoredProcs { - - public static void getAllCompanies(ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = conn.prepareStatement("SELECT * FROM COMPANY"); - results[0] = ps.executeQuery(); - } - - public static void deleteCustomer(int theId) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = conn.prepareStatement("DELETE FROM CUSTOMER WHERE ID = ?"); - ps.setInt(1, theId); - ps.execute(); - - } - - public static void getNamedCompany(String theName, ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = conn.prepareStatement("SELECT * FROM COMPANY WHERE NAME = ?"); - ps.setString(1, theName); - results[0] = ps.executeQuery(); - } - - public static void getCustomerAndOrders(int theId, ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = - conn.prepareStatement("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID = ?"); - ps.setInt(1, theId); - results[0] = ps.executeQuery(); - } - - public static void getNamedCustomers(String theName, int[] outCount, ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = - conn.prepareStatement("SELECT * FROM CUSTOMER WHERE LASTNAME = ?"); - ps.setString(1, theName); - results[0] = ps.executeQuery(); - - ps = conn.prepareStatement("SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = ?"); - ps.setString(1, theName); - - ResultSet rs = ps.executeQuery(); - rs.next(); - outCount[0] = rs.getInt(1); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java deleted file mode 100644 index b3616882f4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.SQLException; - - -import junit.framework.Test; - -public class MySQLSetup extends DatabaseSetup { - - public MySQLSetup(Test test) { - super(test); - } - - protected void initConnectionProtocol() { - - platformName = "MySQL"; - driverName = "com.mysql.jdbc.Driver"; - databaseURL = "jdbc:mysql:///dastest?user=dastester&password=dastester"; - - } - - - protected void createProcedures () { - - String createGetAllCompanies = - "CREATE PROCEDURE `dastest`.`GETALLCOMPANIES` () "+ - " SELECT * FROM COMPANY "; - - - String createDeleteCustomer = - "CREATE PROCEDURE `dastest`.`DELETECUSTOMER` (theId INT) " + - " DELETE FROM CUSTOMER WHERE ID = theId "; - - - String createGetNamedCustomers = - "CREATE PROCEDURE `dastest`.`GETNAMEDCUSTOMERS`(IN thename VARCHAR(30), OUT theCount INTEGER ) " + - " BEGIN " + - " SELECT * FROM CUSTOMER AS CUSTOMER WHERE LASTNAME = theName; " + - " SET theCount = (SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = theName); " + - " END "; - - String createGetCustomerAndOrders = - " CREATE PROCEDURE `dastest`.`GETCUSTOMERANDORDERS` (theId INT) " + - " SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID = theId "; - - - String createGetNamedCompany = - " CREATE PROCEDURE `dastest`.`GETNAMEDCOMPANY` (theName VARCHAR(100)) " + - " SELECT * FROM COMPANY WHERE NAME = theName"; - - System.out.println("Creating procedures"); - try { - - s.execute(createGetAllCompanies); - s.execute(createDeleteCustomer); - s.execute(createGetNamedCompany); - s.execute(createGetCustomerAndOrders); -// s.execute(createGetNamedCustomers); -//TODO - add this back after DB2 problem is resolved - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - - //Overrides for table creation - protected String getCreateCompany() { - return "CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(30))"; - } - protected String getCreateEmployee() { - return "CREATE TABLE EMPLOYEE (ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(30), SN VARCHAR(10), MANAGER SMALLINT, DEPARTMENTID INT)"; - } - protected String getCreateDepartment() { - return "CREATE TABLE DEPARTMENT (ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT)"; - } - protected String getCreateTypeTest() { - return "CREATE TABLE TYPETEST (ID INT PRIMARY KEY NOT NULL, ATIMESTAMP DATETIME, ADECIMAL DECIMAL(9,2), AFLOAT FLOAT)"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java deleted file mode 100644 index 330320656e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -public abstract class RelationshipData { - protected Object[][] data; - private int currentRow = -1; - protected Connection connection; - - - public RelationshipData(Connection c, Object[][] inputData) { - this.connection = c; - this.data = inputData; - } - - public int size() { - return data[0].length; - } - - public int numberOfRows() { - return data.length; - } - - public boolean next() { - ++currentRow; - if ( currentRow < numberOfRows() ) - return true; - else - return false; - } - - - public void refresh() throws SQLException { - updateRelationships(); - } - - protected abstract String getParentRetrievalStatement(); - protected abstract String getChildUpdateStatement(); - - - protected void updateRelationships() throws SQLException { - // { MegaCorp, Advanced Technologies } - // select company.id from company where company.name = ? - PreparedStatement retrieveParent = connection.prepareStatement(getParentRetrievalStatement()); - // update department set department.companyid = ? where department.name = ? - PreparedStatement updateChild = connection.prepareStatement(getChildUpdateStatement()); - - while ( next() ) { - retrieveParent.setObject(1, data[currentRow][0]); - retrieveParent.execute(); - ResultSet rs = retrieveParent.getResultSet(); - rs.next(); - Object parentID = rs.getObject(1); - retrieveParent.clearParameters(); - - updateChild.setObject(1, parentID); - updateChild.setObject(2, data[currentRow][1]); - updateChild.execute(); - updateChild.clearParameters(); - } - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java deleted file mode 100644 index 686433bfc8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -public abstract class TestData { - - protected Object[][] data; - private int currentRow = -1; - protected Connection connection; - - - public TestData(Connection c, Object[][] customerData) { - this.connection = c; - this.data = customerData; - } - - public int size() { - return data[0].length; - } - - public int numberOfRows() { - return data.length; - } - - public boolean next() { - ++currentRow; - if ( currentRow < numberOfRows() ) - return true; - else - return false; - } - - public abstract String getTableName(); - - - public Object getObject(int i) { - return data[currentRow][i-1]; - } - - public void refresh() throws SQLException { - deleteRowsFromTable(); - insertRows(); - } - - protected void deleteRowsFromTable() throws SQLException { - PreparedStatement ps = connection.prepareStatement("delete from " + getTableName()); - ps.execute(); - } - - protected void insertRows() throws SQLException { - StringBuffer sql = new StringBuffer(); - sql.append("insert into "); - sql.append(getTableName()); - sql.append(" values ("); - for ( int i=1; i < size(); i++) { - sql.append("?,"); - } - sql.append("?)"); - PreparedStatement ps = connection.prepareStatement(sql.toString()); - - while ( next() ) { - for ( int i=1; i <= size(); i++ ) { - ps.setObject(i, getObject(i)); - } - ps.execute(); - ps.clearParameters(); - } - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java deleted file mode 100644 index 8ded99af9b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public abstract class TestDataWithExplicitColumns extends TestData { - - protected String[] columns; - protected int[] sqlTypes; - - private static boolean debug = false; - - public TestDataWithExplicitColumns(Connection c, Object[][] data, - String[] columns, int[] sqlTypes) { - super(c, data); - this.columns = columns; - this.sqlTypes = sqlTypes; - } - - private String getColumn(int i) { - return columns[i - 1]; - } - - private int getSqlType(int i) { - return (sqlTypes[i - 1]); - } - - // Create an insert statement of the following form ... - // "INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)" - // This is necessary for tables with a generated column since the PK value is not provided - protected void insertRows() throws SQLException { - StringBuffer sql = new StringBuffer(); - sql.append("insert into "); - sql.append(getTableName()); - - sql.append(" ("); - for (int i = 1; i <= size(); i++) { - sql.append(getColumn(i)); - if ( i < size() ) - sql.append(','); - } - sql.append(" )"); - - sql.append(" values ("); - for (int i = 1; i < size(); i++) { - sql.append("?,"); - } - sql.append("?)"); - - DebugUtil.debugln(getClass(), debug, sql.toString()); - PreparedStatement ps = connection.prepareStatement(sql.toString()); - - while (next()) { - for (int i = 1; i <= size(); i++) { - ps.setObject(i, getObject(i), getSqlType(i)); - } - ps.execute(); - ps.clearParameters(); - } - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java deleted file mode 100644 index e25d2c4c95..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import org.apache.tuscany.das.rdb.Converter; - -public class IntegerToBooleanConverter implements Converter { - - public IntegerToBooleanConverter() { - super(); - } - - public Object getPropertyValue(Object columnData) { - Integer value = (Integer) columnData; - return value.intValue() == 0 ? Boolean.FALSE : Boolean.TRUE; - } - - public Object getColumnValue(Object propertyData) { - Boolean value = (Boolean) propertyData; - if ( value.booleanValue()) - return new Integer(1); - else - return new Integer(0); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java deleted file mode 100644 index 7c164bd675..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.tuscany.das.rdb.Converter; - - -public class SillyDateStringConverter implements Converter { - - public SillyDateStringConverter() { - super(); - } - - private static DateFormat myformat = new SimpleDateFormat("yyyy.MM.dd"); - - private static Date kbday; - - private static Date tbday; - - static { - try { - kbday = myformat.parse("1957.09.27"); - tbday = myformat.parse("1966.12.20"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - public Object getPropertyValue(Object columnData) { - - if (columnData.equals("Williams")) - return kbday; - - if (columnData.equals("Pavick")) - return tbday; - - throw new IllegalArgumentException(); - - } - - public Object getColumnValue(Object propertyData) { - - if (propertyData.equals(kbday)) - return "Williams"; - - if (propertyData.equals(tbday)) - return "Pavick"; - - throw new IllegalArgumentException(); - - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java deleted file mode 100644 index 8ff57aef6d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import org.apache.tuscany.das.rdb.Converter; - -public class StringToIntegerConverter implements Converter { - - public StringToIntegerConverter() { - super(); - } - - public Object getPropertyValue(Object columnData) { - // System.out.println("Converting object.. " + columnData); - - return new Integer(columnData.toString()); - } - - public Object getColumnValue(Object columnData) { - return columnData.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java deleted file mode 100644 index 74a5e2917f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import org.apache.tuscany.das.rdb.Converter; - -public class StringToLongConverter implements Converter { - - public StringToLongConverter() { - super(); - } - - public Object getPropertyValue(Object columnData) { - return new Long(columnData.toString()); - } - - public Object getColumnValue(Object columnData) { - return columnData.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java deleted file mode 100644 index ce6034c4c5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.BestPracticeTests; -import org.apache.tuscany.das.rdb.test.CUDGeneration; -import org.apache.tuscany.das.rdb.test.CompanyTests; -import org.apache.tuscany.das.rdb.test.CompoundKeyTests; -import org.apache.tuscany.das.rdb.test.ConverterTests; -import org.apache.tuscany.das.rdb.test.CorrectedDefectTests; -import org.apache.tuscany.das.rdb.test.CrudWithChangeHistory; -import org.apache.tuscany.das.rdb.test.ExceptionTests; -import org.apache.tuscany.das.rdb.test.GeneratedCommandTests; -import org.apache.tuscany.das.rdb.test.GeneratedId; -import org.apache.tuscany.das.rdb.test.GraphMergeTests; -import org.apache.tuscany.das.rdb.test.NameMappingTests; -import org.apache.tuscany.das.rdb.test.OCCTests; -import org.apache.tuscany.das.rdb.test.OperationOrderingTests; -import org.apache.tuscany.das.rdb.test.Paging; -import org.apache.tuscany.das.rdb.test.PartialUpdateTests; -import org.apache.tuscany.das.rdb.test.PassiveConnectionTests; -import org.apache.tuscany.das.rdb.test.RecursiveTests; -import org.apache.tuscany.das.rdb.test.RelationshipTests; -import org.apache.tuscany.das.rdb.test.ResultSetShapeTests; -import org.apache.tuscany.das.rdb.test.SerializationTests; -import org.apache.tuscany.das.rdb.test.SimplestCrud; -import org.apache.tuscany.das.rdb.test.StoredProcs; -import org.apache.tuscany.das.rdb.test.TopDown; -import org.apache.tuscany.das.rdb.test.TypeTests; -import org.apache.tuscany.das.rdb.test.CommandGroupTests; -import org.apache.tuscany.das.rdb.test.typed.SimplestStaticCrud; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllCommonTests { - - public static Test suite() { - TestSuite suite = new TestSuite("All platform-common DAS tests"); - //$JUnit-BEGIN$ - - suite.addTest(new TestSuite (SimplestCrud.class)); - suite.addTest(new TestSuite (CrudWithChangeHistory.class)); - suite.addTest(new TestSuite (SimplestStaticCrud.class)); - suite.addTest(new TestSuite (Paging.class)); - suite.addTest(new TestSuite (GeneratedId.class)); - - suite.addTest(new TestSuite (StoredProcs.class)); - suite.addTest(new TestSuite (CUDGeneration.class)); - suite.addTest(new TestSuite (TopDown.class)); - suite.addTest(new TestSuite (OCCTests.class)); - suite.addTest(new TestSuite (RecursiveTests.class)); - - suite.addTest(new TestSuite (GraphMergeTests.class)); - suite.addTest(new TestSuite (CompoundKeyTests.class)); - suite.addTest(new TestSuite (RelationshipTests.class)); - suite.addTest(new TestSuite (NameMappingTests.class)); - suite.addTest(new TestSuite (GeneratedCommandTests.class)); - - suite.addTest(new TestSuite (CompanyTests.class)); - suite.addTest(new TestSuite (ResultSetShapeTests.class)); - suite.addTest(new TestSuite (TypeTests.class)); - suite.addTest(new TestSuite (OperationOrderingTests.class)); - suite.addTest(new TestSuite (ConverterTests.class)); - - suite.addTest(new TestSuite (PartialUpdateTests.class)); - suite.addTest(new TestSuite (ExceptionTests.class)); - suite.addTest(new TestSuite (PassiveConnectionTests.class)); - suite.addTest(new TestSuite (SerializationTests.class)); - - suite.addTest(new TestSuite (CommandGroupTests.class)); - suite.addTest(new TestSuite (BestPracticeTests.class)); - suite.addTest(new TestSuite (CorrectedDefectTests.class)); - - //$JUnit-END$ - return suite; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java deleted file mode 100644 index a5fcb5eba0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.ReadDBSchemaTests; -import org.apache.tuscany.das.rdb.test.framework.DB2Setup; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsDB2 { - - - public static Test suite() { - - TestSuite suite = new TestSuite(); - suite.addTest(AllCommonTests.suite()); - suite.addTest(new TestSuite (ReadDBSchemaTests.class)); - - TestSuite suite2 = new TestSuite("All DAS tests on DB2"); - suite2.addTest(new DB2Setup(suite)); - return suite2; - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java deleted file mode 100644 index 8af82f0114..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.framework.DerbySetup; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsDerby extends TestSuite { - - - public static Test suite() { - - TestSuite suite = new TestSuite("All DAS tests on Derby"); - suite.addTest(new DerbySetup(AllCommonTests.suite())); - return suite; - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java deleted file mode 100644 index 2b862eba8c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.framework.MySQLSetup; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsMySQL { - - - public static Test suite() { - - TestSuite suite = new TestSuite("All DAS tests on MySQL"); - suite.addTest(new MySQLSetup(AllCommonTests.suite())); - return suite; - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java deleted file mode 100644 index f8baca2cb8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed 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. - */ -package org.apache.tuscany.das.rdb.test.typed; - -import java.io.InputStream; -import java.util.Collection; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.customer.CustomerFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.TypeHelper; - - -/** - */ -public class SimplestStaticCrud extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - public void testRead() throws Exception { - SDOUtil.registerStaticTypes(CustomerFactory.class); - InputStream mapping = getClass().getClassLoader().getResourceAsStream("basicStaticCustomer.xml"); - Command select = Command.FACTORY.createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where LASTNAME = :LASTNAME",mapping); - select.setConnection(getConnection()); - select.setParameterValue("LASTNAME", "Williams"); - TypeHelper helper = TypeHelper.INSTANCE; - - select.setDataObjectModel(helper.getType(DataGraphRoot.class)); - - DataGraphRoot root = (DataGraphRoot) select.executeQuery(); - - Collection customers = root.getCustomers(); - assertEquals(4, customers.size()); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/1xM_mapping_no_cud.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/1xM_mapping_no_cud.xml deleted file mode 100644 index 26d64e85d7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/1xM_mapping_no_cud.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER" propertyName="Customer"> - <Column name="ID" propertyName="iD" primaryKey="true"/> - </Table> - - <Table name="ANORDER" propertyName="AnOrder"> - <Column name="CUSTOMER_ID" propertyName="customerID"/> - <Column name="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/tags/java-stable-20060304/das/rdb/src/test/resources/CompanyConfig.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/CompanyConfig.xml deleted file mode 100644 index af9b994aaa..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/CompanyConfig.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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 = :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 = :ID" kind="Select"/> - -<!-- - <ConnectionProperties dataSource="java:comp/env/jdbc/dastest"/> ---> - - - <ConnectionProperties driverClassName="org.apache.derby.jdbc.EmbeddedDriver" - driverURL="jdbc:derby:dastest"/> - - <Table name="COMPANY"> - <Column name="ID" primaryKey="true" generated="true"/> - </Table> - - <Table name="DEPARTMENT"> - <Column name="ID" primaryKey="true" generated="true"/> - </Table> - - <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true"> - <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/> - </Relationship> - - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/CustOrdersConnectionProps.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/CustOrdersConnectionProps.xml deleted file mode 100644 index a103f7a9d4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/CustOrdersConnectionProps.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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 = :ID" - kind="Select"> - <Parameter name=":ID"/> - </Command> - - <Command name="customer and orders" - SQL="select * from CUSTOMER left join ANORDER on CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID" - kind="Select"> - <Parameter name=":ID"/> - </Command> - - <!-- Test usage of '?' rather than named parameter --> - <Command name="order by id with ?" SQL="select * from ANORDER where ANORDER.ID = ?" - kind="Select"> - <Parameter name=":ID"/> - </Command> - - <Command name="update customer" - SQL="update CUSTOMER set LASTNAME = 'Pavick' where ID = :ID" - kind="Update"> - <Parameter name=":ID"/> - </Command> - - <ConnectionProperties driverClassName="org.apache.derby.jdbc.EmbeddedDriver" - driverURL="jdbc:derby:dastest"/> - - <Table name="CUSTOMER"> - <Column name="ID" primaryKey="true"/> - </Table> - - <Table name="ANORDER"> - <Column name="ID" primaryKey="true"/> - </Table> - - <Relationship name="orders" primaryKeyTable="CUSTOMER" - foreignKeyTable="ANORDER" many="true"> - <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> - </Relationship> - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/CustomersOrdersConfig.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/CustomersOrdersConfig.xml deleted file mode 100644 index 635b30d926..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/CustomersOrdersConfig.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<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 = :ID" - kind="Select"> - <Parameter name=":ID"/> - </Command> - - <Command name="order by id" SQL="select * from ANORDER where ANORDER.ID = :ID" - kind="Select"> - <Parameter name=":ID"/> - </Command> - - <Table name="CUSTOMER"> - <Column name="ID" primaryKey="true"/> - </Table> - - <Table name="ANORDER"> - <Column name="ID" primaryKey="true"/> - </Table> - - <Relationship name="orders" primaryKeyTable="CUSTOMER" - foreignKeyTable="ANORDER" many="true"> - <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> - </Relationship> - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyDepartmentMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyDepartmentMapping.xml deleted file mode 100644 index 4ddc1eb4fb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyDepartmentMapping.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="COMPANY"> - <Column name="ID" primaryKey="true" generated="true"/> - <Column name="NAME"/> - </Table> - - <Table name="DEPARTMENT"> - <Column name="ID" primaryKey="true" generated="true"/> - <Column name="NAME"/> - <Column name="NUMBER"/> - <Column name="COMPANYID"/> - <Column name="EOTM"/> - </Table> - - <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true"> - <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/> - </Relationship> - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyMapping.xml deleted file mode 100644 index cf1429ff8f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyMapping.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <Table name="COMPANY"> - <Column name="ID" primaryKey="true" generated="true"/> - <Column name="NAME"/> - </Table> -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMapping.xml deleted file mode 100644 index 6ccfda6510..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMapping.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER"> - <Column name="ID" primaryKey="true"/> - <Column name="LASTNAME"/> - <Column name="ADDRESS"/> - </Table> - -</Config> diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithCUD.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithCUD.xml deleted file mode 100644 index 760ce866f7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithCUD.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER" - create="insert into customer values (:ID, :LASTNAME, :ADDRESS)" - update="update customer set lastname = :LASTNAME, address = :ADDRESS where ID = :ID" - delete="delete from customer where ID = :ID"> - <Column name="ID" primaryKey="true"/> - <Column name="LASTNAME"/> - <Column name="ADDRESS"/> - </Table> - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml deleted file mode 100644 index 8acf38db90..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER" - create="insert into customer blah values (:ID, :LASTNAME, :ADDRESS)" - update="update customer blah set lastname = :LASTNAME, address = :ADDRESS where ID = :ID" - delete="delete from customer blah where ID = :ID"> - <Column name="ID" primaryKey="true"/> - <Column name="LASTNAME"/> - <Column name="ADDRESS"/> - </Table> - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerOrderMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerOrderMapping.xml deleted file mode 100644 index 3881fb192b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerOrderMapping.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER"> - <Column name="ID" primaryKey="true"/> - </Table> - <Table name="ANORDER"> - <Column name="ID" primaryKey="true"/> - <Column name="CUSTOMER_ID"/> - </Table> - - <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> - <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> - </Relationship> - -</Config> - diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicStaticCustomer.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicStaticCustomer.xml deleted file mode 100644 index 0de6d79af0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicStaticCustomer.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER" propertyName="Customer"> - <Column name="ID" primaryKey="true"/> - <Column name="LASTNAME"/> - <Column name="ADDRESS"/> - </Table> - -</Config> diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/cityStates.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/cityStates.xml deleted file mode 100644 index 4a9108c835..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/cityStates.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="STATES"> - <Column name="ID" primaryKey="true"/> - <Column name="NAME"/> - </Table> - - <Table name="CITIES"> - - <Column name="ID" primaryKey="true"/> - <Column name="NAME"/> - <Column name="STATE_ID"/> - - </Table> - - <Relationship name="cities" primaryKeyTable="STATES" foreignKeyTable="CITIES" many="true"> - <KeyPair primaryKeyColumn="ID" foreignKeyColumn="STATE_ID"/> - </Relationship> - - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/company.ecore b/tags/java-stable-20060304/das/rdb/src/test/resources/company.ecore deleted file mode 100644 index 888acdf1c3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/company.ecore +++ /dev/null @@ -1,130 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="company"
- nsURI="org.apache.tuscany.das.rdb.test/company.xsd" nsPrefix="company">
- <eClassifiers xsi:type="ecore:EClass" name="CompanyType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="CompanyType"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="departments" lowerBound="1"
- upperBound="-1" eType="#//DepartmentType" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="departments"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="employeeOfTheMonth" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IDREF">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="employeeOfTheMonth"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="name"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="DepartmentType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="DepartmentType"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="employees" lowerBound="1"
- upperBound="-1" eType="#//EmployeeType" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="employees"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="location" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="location"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="name"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="number" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="number"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value=""/>
- <details key="kind" value="mixed"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="elementWildcard"/>
- <details key="name" value=":mixed"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
- eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
- transient="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="xmlns:prefix"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
- eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
- transient="true" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="xsi:schemaLocation"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="company" upperBound="-2"
- eType="#//CompanyType" volatile="true" transient="true" derived="true" containment="true"
- resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="company"/>
- <details key="namespace" value="##targetNamespace"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EmployeeType">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="EmployeeType"/>
- <details key="kind" value="empty"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="manager" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"
- unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="manager"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="name"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="sN" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//ID"
- iD="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="attribute"/>
- <details key="name" value="SN"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/company.genmodel b/tags/java-stable-20060304/das/rdb/src/test/resources/company.genmodel deleted file mode 100644 index 0b89c2c0c8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/company.genmodel +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/rdbdas2/src/test/java"
- modelPluginID="das.tests" modelName="Company" rootExtendsInterface="" rootExtendsClass="org.eclipse.emf.ecore.sdo.impl.EDataObjectImpl"
- rootImplementsInterface="org.eclipse.emf.ecore.sdo.InternalEDataObject" suppressEMFTypes="true"
- suppressEMFMetaData="true" featureMapWrapperInterface="commonj.sdo.Sequence" featureMapWrapperInternalInterface="org.eclipse.emf.ecore.sdo.util.ESequence"
- featureMapWrapperClass="org.eclipse.emf.ecore.sdo.util.BasicESequence" importerID="org.eclipse.xsd.ecore.importer">
- <foreignModel>company.xsd</foreignModel>
- <staticPackages>http://www.eclipse.org/emf/2003/SDO</staticPackages>
- <modelPluginVariables>EMF_COMMONJ_SDO=org.eclipse.emf.commonj.sdo</modelPluginVariables>
- <modelPluginVariables>EMF_ECORE_SDO=org.eclipse.emf.ecore.sdo</modelPluginVariables>
- <genPackages prefix="Company" basePackage="org.apache.tuscany.das.rdb.test" resource="XML"
- disposableProviderFactory="true" ecorePackage="company.ecore#/">
- <genClasses ecoreClass="company.ecore#//CompanyType">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference company.ecore#//CompanyType/departments"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//CompanyType/employeeOfTheMonth"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//CompanyType/name"/>
- </genClasses>
- <genClasses ecoreClass="company.ecore#//DepartmentType">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference company.ecore#//DepartmentType/employees"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//DepartmentType/location"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//DepartmentType/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//DepartmentType/number"/>
- </genClasses>
- <genClasses ecoreClass="company.ecore#//DocumentRoot">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute company.ecore#//DocumentRoot/mixed"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference company.ecore#//DocumentRoot/xMLNSPrefixMap"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference company.ecore#//DocumentRoot/xSISchemaLocation"/>
- <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference company.ecore#//DocumentRoot/company"/>
- </genClasses>
- <genClasses ecoreClass="company.ecore#//EmployeeType">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//EmployeeType/manager"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//EmployeeType/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute company.ecore#//EmployeeType/sN"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/company.xsd b/tags/java-stable-20060304/das/rdb/src/test/resources/company.xsd deleted file mode 100644 index 44bc2bd3aa..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/company.xsd +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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:complexType name="DatagraphRoot"> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" minOccurs="0" name="companies" type="company:CompanyType"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" name="departments" type="company:DepartmentType"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" name="employees" type="company:EmployeeType"/> - </xsd:sequence> - </xsd:complexType> - - <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/tags/java-stable-20060304/das/rdb/src/test/resources/companyMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/companyMapping.xml deleted file mode 100644 index 1b30cb3a91..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/companyMapping.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="COMPANY" propertyName="CompanyType"> - <Column name="ID" primaryKey="true"/> - </Table> - - <Table name="DEPARTMENT" propertyName="DepartmentType"> - <Column name="ID" primaryKey="true"/> - </Table> - <Table name="EMPLOYEE" propertyName="EmployeeType"> - <Column name="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/tags/java-stable-20060304/das/rdb/src/test/resources/customer.ecore b/tags/java-stable-20060304/das/rdb/src/test/resources/customer.ecore deleted file mode 100644 index 74786d8af4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.ecore +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="customer"
- nsURI="http:///org.apache.tuscany.das.rdb.test/customer.xsd" nsPrefix="customer">
- <eClassifiers xsi:type="ecore:EClass" name="AnOrder">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="AnOrder"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="iD" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="ID"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="product" unique="false"
- lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="Product"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="quantity" unique="false"
- lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int"
- unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="Quantity"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="customerID" unique="false"
- lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int"
- unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="Customer_ID"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Customer">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="Customer"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="iD" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Int" unsettable="true">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="ID"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="lastName" unique="false"
- lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="lastName"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="address" unique="false"
- lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="address"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="orders" lowerBound="1"
- upperBound="-1" eType="#//AnOrder" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="orders"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="DataGraphRoot">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="name" value="DataGraphRoot"/>
- <details key="kind" value="elementOnly"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="customers" upperBound="-1"
- eType="#//Customer" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="customers"/>
- </eAnnotations>
- </eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="orders" upperBound="-1"
- eType="#//AnOrder" containment="true" resolveProxies="false">
- <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
- <details key="kind" value="element"/>
- <details key="name" value="orders"/>
- </eAnnotations>
- </eStructuralFeatures>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.genmodel b/tags/java-stable-20060304/das/rdb/src/test/resources/customer.genmodel deleted file mode 100644 index 8c1cd53e57..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.genmodel +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/rdbdas2/src"
- modelPluginID="rdbdas2" modelName="Customer" rootExtendsInterface="" rootExtendsClass="org.eclipse.emf.ecore.sdo.impl.EDataObjectImpl"
- rootImplementsInterface="org.eclipse.emf.ecore.sdo.InternalEDataObject" suppressEMFTypes="true"
- suppressEMFMetaData="true" featureMapWrapperInterface="commonj.sdo.Sequence" featureMapWrapperInternalInterface="org.eclipse.emf.ecore.sdo.util.ESequence"
- featureMapWrapperClass="org.eclipse.emf.ecore.sdo.util.BasicESequence" importerID="org.eclipse.xsd.ecore.importer">
- <foreignModel>customer.xsd</foreignModel>
- <staticPackages>http://www.eclipse.org/emf/2003/SDO</staticPackages>
- <modelPluginVariables>EMF_COMMONJ_SDO=org.eclipse.emf.commonj.sdo</modelPluginVariables>
- <modelPluginVariables>EMF_ECORE_SDO=org.eclipse.emf.ecore.sdo</modelPluginVariables>
- <genPackages prefix="Customer" basePackage="org.apache.tuscany.das.rdb.test" resource="XML"
- disposableProviderFactory="true" ecorePackage="customer.ecore#/">
- <genClasses ecoreClass="customer.ecore#//AnOrder">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute customer.ecore#//AnOrder/iD"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute customer.ecore#//AnOrder/product"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute customer.ecore#//AnOrder/quantity"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute customer.ecore#//AnOrder/customerID"/>
- </genClasses>
- <genClasses ecoreClass="customer.ecore#//Customer">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute customer.ecore#//Customer/iD"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute customer.ecore#//Customer/lastName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute customer.ecore#//Customer/address"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference customer.ecore#//Customer/orders"/>
- </genClasses>
- <genClasses ecoreClass="customer.ecore#//DataGraphRoot">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference customer.ecore#//DataGraphRoot/customers"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference customer.ecore#//DataGraphRoot/orders"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.xsd b/tags/java-stable-20060304/das/rdb/src/test/resources/customer.xsd deleted file mode 100644 index c4a5bc2635..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.xsd +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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="DataGraphRoot"> - <xsd:sequence> - - <xsd:element maxOccurs="unbounded" minOccurs="0" name="customers" type="this:Customer"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" name="orders" type="this:AnOrder"/> - </xsd:sequence> - </xsd:complexType> - - <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/tags/java-stable-20060304/das/rdb/src/test/resources/customerMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/customerMapping.xml deleted file mode 100644 index 35d05137a8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customerMapping.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER" propertyName="Customer"> - <Column name="ID" propertyName="id" primaryKey="true"/> - <Column name="LASTNAME" propertyName="lastname"/> - <Column name="ADDRESS" propertyName="address"/> - </Table> - -</Config>
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customerOrderRelationshipMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/customerOrderRelationshipMapping.xml deleted file mode 100644 index ee739f1345..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customerOrderRelationshipMapping.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <Table name="CUSTOMER"> - <Column name="ID" primaryKey="true"/> - </Table> - <Table name="ANORDER"> - <Column name="ID" primaryKey="true"/> - </Table> - - <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> - <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> - </Relationship> - -</Config> - |