geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r520023 [5/10] - in /geronimo/sandbox/j2g: ./ bin/ doc/ src/ src/common/ src/common/META-INF/ src/common/src/ src/common/src/org/ src/common/src/org/apache/ src/common/src/org/apache/apps/ src/common/src/org/apache/apps/j2gmigrator/ src/con...
Date Mon, 19 Mar 2007 17:43:49 GMT
Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/src/org/apache/apps/j2gmigrator/resources/ds/DSResourcesTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/src/org/apache/apps/j2gmigrator/resources/ds/DSResourcesTool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/src/org/apache/apps/j2gmigrator/resources/ds/DSResourcesTool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-ds.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-ds.xml (added)
+++ geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-ds.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,122 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<!-- The Hypersonic embedded database JCA connection factory config
+$Id$ -->
+
+
+<datasources>
+   <local-tx-datasource>
+
+      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
+      <!-- Datasources are not available outside the virtual machine -->
+      <jndi-name>DefaultDS</jndi-name>
+
+      <!-- for tcp connection, allowing other processes to use the hsqldb
+      database. This requires the org.jboss.jdbc.HypersonicDatabase mbean.
+      <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
+-->
+      <!-- for totally in-memory db, not saved when jboss stops. 
+      The org.jboss.jdbc.HypersonicDatabase mbean necessary
+      <connection-url>jdbc:hsqldb:.</connection-url>
+-->
+      <!-- for in-process persistent db, saved when jboss stops. The
+      org.jboss.jdbc.HypersonicDatabase mbean is necessary for properly db shutdown
+-->
+      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
+
+      <!-- The driver class -->
+      <driver-class>org.hsqldb.jdbcDriver</driver-class>
+
+      <!-- The login and password -->
+      <user-name>sa</user-name>
+      <password></password>
+
+      <!--example of how to specify class that determines if exception means connection should be destroyed-->
+      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
+
+      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
+      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
+
+      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
+      <min-pool-size>5</min-pool-size>
+
+      <!-- The maximum connections in a pool/sub-pool -->
+      <max-pool-size>20</max-pool-size>
+
+      <!-- The time before an unused connection is destroyed -->
+      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
+      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
+      <idle-timeout-minutes>0</idle-timeout-minutes>
+
+      <!-- sql to call when connection is created
+        <new-connection-sql>some arbitrary sql</new-connection-sql>
+      -->
+
+      <!-- sql to call on an existing pooled connection when it is obtained from pool 
+         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
+      -->
+
+      <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
+         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
+      -->
+
+      <!-- Whether to check all statements are closed when the connection is returned to the pool,
+           this is a debugging feature that should be turned off in production -->
+      <track-statements/>
+
+      <!-- Use the getConnection(user, pw) for logins
+        <application-managed-security/>
+      -->
+
+      <!-- Use the security domain defined in conf/login-config.xml -->
+      <security-domain>HsqlDbRealm</security-domain>
+
+      <!-- Use the security domain defined in conf/login-config.xml or the
+           getConnection(user, pw) for logins. The security domain takes precedence.
+        <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
+      -->
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Hypersonic SQL</type-mapping>
+      </metadata>
+
+      <!-- This mbean can be used when using in process persistent hypersonic -->
+      <depends>jboss:service=Hypersonic,database=localDB</depends>
+   </local-tx-datasource>
+
+   <!-- This mbean should be used only when using tcp connections. Uncomment
+   when the tcp based connection-url is used. 
+   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
+     name="jboss:service=Hypersonic">
+     <attribute name="Port">1701</attribute>
+     <attribute name="Silent">true</attribute>
+     <attribute name="Database">default</attribute>
+     <attribute name="Trace">false</attribute>
+     <attribute name="No_system_exit">true</attribute>
+   </mbean>
+ -->
+
+   <!-- This mbean can be used when using in process persistent db -->
+   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
+     name="jboss:service=Hypersonic,database=localDB">
+     <attribute name="Database">localDB</attribute>
+     <attribute name="InProcessMode">true</attribute>
+   </mbean>
+</datasources>

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-ds.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-ds.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-geronimo-plan.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-geronimo-plan.xml (added)
+++ geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-geronimo-plan.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,56 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:moduleId>
+      <dep:artifactId>DefaultDS</dep:artifactId>
+    </dep:moduleId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>hsqldb</dep:groupId>
+        <dep:artifactId>hsqldb</dep:artifactId>
+        <dep:type>jar</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+  </dep:environment>
+  <resourceadapter>
+    <outbound-resourceadapter>
+      <connection-definition>
+        <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+        <connectiondefinition-instance>
+          <name>DefaultDS</name>
+          <config-property-setting name="UserName">sa</config-property-setting>
+          <config-property-setting name="Password"></config-property-setting>
+          <config-property-setting name="Driver">org.hsqldb.jdbcDriver</config-property-setting>
+          <config-property-setting name="ConnectionURL">jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</config-property-setting>
+          <connectionmanager>
+            <local-transaction/>
+            <single-pool>
+              <max-size>20</max-size>
+              <min-size>5</min-size>
+              <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+              <idle-timeout-minutes>0</idle-timeout-minutes>
+              <match-one/>
+            </single-pool>
+          </connectionmanager>
+        </connectiondefinition-instance>
+      </connection-definition>
+    </outbound-resourceadapter>
+  </resourceadapter>
+</connector>

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/hsqldb-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-ds.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-ds.xml (added)
+++ geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-ds.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,35 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+<!--  Datasource config for MySQL using 3.0.9 available from:
+http://www.mysql.com/downloads/api-jdbc-stable.html
+-->
+
+<datasources>
+
+  <local-tx-datasource>
+        <jndi-name>jdbc/TradeDB</jndi-name>
+        <connection-url>jdbc:mysql://localhost:3306/tradedb</connection-url>
+        <driver-class>com.mysql.jdbc.Driver</driver-class>
+        <user-name>root</user-name>
+        <password>password</password>
+        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>        
+  </local-tx-datasource>
+ </datasources>
+

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-ds.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-ds.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-geronimo-plan.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-geronimo-plan.xml (added)
+++ geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-geronimo-plan.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,56 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:moduleId>
+      <dep:artifactId>TradeDB</dep:artifactId>
+    </dep:moduleId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>mysql</dep:groupId>
+        <dep:artifactId>mysql-connector-java</dep:artifactId>
+        <dep:type>jar</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+  </dep:environment>
+  <resourceadapter>
+    <outbound-resourceadapter>
+      <connection-definition>
+        <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+        <connectiondefinition-instance>
+          <name>TradeDB</name>
+          <config-property-setting name="UserName">root</config-property-setting>
+          <config-property-setting name="Password">password</config-property-setting>
+          <config-property-setting name="Driver">com.mysql.jdbc.Driver</config-property-setting>
+          <config-property-setting name="ConnectionURL">jdbc:mysql://localhost:3306/tradedb</config-property-setting>
+          <connectionmanager>
+            <local-transaction/>
+            <single-pool>
+              <max-size>10</max-size>
+              <min-size>0</min-size>
+              <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+              <idle-timeout-minutes>30</idle-timeout-minutes>
+              <match-one/>
+            </single-pool>
+          </connectionmanager>
+        </connectiondefinition-instance>
+      </connection-definition>
+    </outbound-resourceadapter>
+  </resourceadapter>
+</connector>

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/mysql-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-ds.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-ds.xml (added)
+++ geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-ds.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,35 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+<!--  Datasource config for MySQL using 3.0.9 available from:
+http://www.mysql.com/downloads/api-jdbc-stable.html
+-->
+
+<datasources>
+
+  <local-tx-datasource>
+        <jndi-name>jdbc/TradeDB</jndi-name>
+        <connection-url>jdbc:oracle://localhost:3306/tradedb</connection-url>
+        <driver-class>oracle.jdbc.OracleDriver</driver-class>
+        <user-name>root</user-name>
+        <password>password</password>
+        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>        
+  </local-tx-datasource>
+ </datasources>
+

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-ds.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-ds.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-geronimo-plan.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-geronimo-plan.xml (added)
+++ geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-geronimo-plan.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,56 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:moduleId>
+      <dep:artifactId>TradeDB</dep:artifactId>
+    </dep:moduleId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>oracle</dep:groupId>
+        <dep:artifactId>oracle-jdbc</dep:artifactId>
+        <dep:type>jar</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+  </dep:environment>
+  <resourceadapter>
+    <outbound-resourceadapter>
+      <connection-definition>
+        <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+        <connectiondefinition-instance>
+          <name>TradeDB</name>
+          <config-property-setting name="UserName">root</config-property-setting>
+          <config-property-setting name="Password">password</config-property-setting>
+          <config-property-setting name="Driver">oracle.jdbc.OracleDriver</config-property-setting>
+          <config-property-setting name="ConnectionURL">jdbc:oracle://localhost:3306/tradedb</config-property-setting>
+          <connectionmanager>
+            <local-transaction/>
+            <single-pool>
+              <max-size>10</max-size>
+              <min-size>0</min-size>
+              <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+              <idle-timeout-minutes>30</idle-timeout-minutes>
+              <match-one/>
+            </single-pool>
+          </connectionmanager>
+        </connectiondefinition-instance>
+      </connection-definition>
+    </outbound-resourceadapter>
+  </resourceadapter>
+</connector>

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test-apps/ds/oracle-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/data-source-plugin/test/org/apache/apps/j2gmigrator/resources/ds/test/DSResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/data-source-plugin/test/org/apache/apps/j2gmigrator/resources/ds/test/DSResouresToolTestCase.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/data-source-plugin/test/org/apache/apps/j2gmigrator/resources/ds/test/DSResouresToolTestCase.java (added)
+++ geronimo/sandbox/j2g/src2/data-source-plugin/test/org/apache/apps/j2gmigrator/resources/ds/test/DSResouresToolTestCase.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,71 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.apps.j2gmigrator.resources.ds.test;
+
+import java.io.File;
+
+import org.apache.apps.j2gmigrator.resources.ResourcesTool;
+import org.apache.apps.j2gmigrator.resources.ds.DSResourcesTool;
+import org.apache.apps.j2gmigrator.resources.utils.Constants;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import junit.framework.TestCase;
+
+/**
+ * Test Case for the DSResouresTool
+ */
+public class DSResouresToolTestCase extends TestCase {
+    
+    
+    protected void setUp() throws Exception {
+        // To set the IOutput intialize the DescripterTool
+        ResourcesTool desTool = new ResourcesTool();
+        super.setUp();
+    }
+
+    // Test for the mysql
+    public void testDSResourcesFileMigration_mysql() {
+        File file = new File("test-apps/ds/mysql-ds.xml");
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        boolean result = dsResourcesTool.migrate(file);
+        assertTrue(result);
+    }
+
+    // Test for the oracle
+    public void testDSResourcesFileMigration_oracle() {
+        File file = new File("test-apps/ds/oracle-ds.xml");
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        boolean result = dsResourcesTool.migrate(file);
+        assertTrue(result);
+    }
+
+    // Test for the hsqldb
+    public void testDSResourcesFileMigration_hsqldb() {
+        File file = new File("test-apps/ds/hsqldb-ds.xml");
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        boolean result = dsResourcesTool.migrate(file);
+        assertTrue(result);
+    }
+
+    public void testMethod_createDefaultConnectionManagerElement() {
+        Namespace connectorNamespace = new Namespace("", Constants.NAMESPACE_CONNECTOR);
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        Element result = dsResourcesTool.createDefaultConnectionManagerElement(connectorNamespace);
+        assertNotNull(result);
+    }
+
+}

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test/org/apache/apps/j2gmigrator/resources/ds/test/DSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test/org/apache/apps/j2gmigrator/resources/ds/test/DSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/data-source-plugin/test/org/apache/apps/j2gmigrator/resources/ds/test/DSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/META-INF/MANIFEST.MF?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/META-INF/MANIFEST.MF (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/META-INF/MANIFEST.MF Mon Mar 19 10:43:27 2007
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ejb_cmp_migration_plugin Plug-in
+Bundle-SymbolicName: com.ibm.j2g.descriptors.cmp; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Vendor: ibm
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ com.ibm.j2g,
+ com.ibm.j2g.descriptors,
+ com.ibm.j2g.util
+Eclipse-LazyStart: true
+Bundle-ClassPath: .

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/build.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/build.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/build.properties (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/build.properties Mon Mar 19 10:43:27 2007
@@ -0,0 +1,21 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ source.. = src/
+output.. = classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/build.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/build.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/plugin.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/plugin.xml (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/plugin.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,23 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+	<extension point="com.ibm.j2g.descriptors.migrations">
+      <migration class="com.ibm.j2g.descriptors.cmp.CMPDescriptorTool"/>
+    </extension>
+</plugin>

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/commons-logging.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/commons-logging.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/commons-logging.properties (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/commons-logging.properties Mon Mar 19 10:43:27 2007
@@ -0,0 +1,30 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ # Set root logger level to DEBUG and its only appender to console.
+log4j.rootLogger=INFO
+
+#define loggers
+#pluging logger
+log4j.logger.com.ibm.j2g=DEBUG,console
+
+# console is set to be a ConsoleAppender.
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+
+# console uses PatternLayout.
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+#log4j.appender.console.layout.ConversionPattern=[%t] %-5p %l - %m%n
+log4j.appender.console.layout.ConversionPattern=[%t] %-5p - %m%n
\ No newline at end of file

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPDescriptorTool.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPDescriptorTool.java (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPDescriptorTool.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,437 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.apps.j2gmigrator.descriptors.cmp;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.HashMap;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.QName;
+import org.apache.apps.j2gmigrator.IFileMigration;
+import org.apache.apps.j2gmigrator.IOutput;
+import org.apache.apps.j2gmigrator.Tool;
+import org.apache.apps.j2gmigrator.descriptors.cmp.dto.EJBRelation;
+import org.apache.apps.j2gmigrator.descriptors.cmp.dto.EJBRelationshipRole;
+import org.apache.apps.j2gmigrator.descriptors.cmp.dto.Relationships;
+import org.apache.apps.j2gmigrator.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.apps.j2gmigrator.descriptors.util.Constants;
+import org.apache.apps.j2gmigrator.descriptors.xmlutil.XMLConversionHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+//import org.apache.log4j.Logger;
+
+public class CMPDescriptorTool implements IFileMigration {
+
+    private IOutput out = Tool.getCurrent().getOutput();
+
+    private Log logger = LogFactory.getLog(CMPDescriptorTool.class);
+
+    private EnvirionmentElementProcessor envirionmentElementProcessor;
+
+    private CMPEntityBeanMigrator cmpEntityBeanMigrator;
+
+    private String directoryName;
+
+    private Map ejbKeyColumnMapper;
+
+    public CMPDescriptorTool() {
+        envirionmentElementProcessor = new EnvirionmentElementProcessor();
+        cmpEntityBeanMigrator = new CMPEntityBeanMigrator();
+        ejbKeyColumnMapper = new HashMap();
+    }
+
+    public boolean migrate(File file) {
+        boolean migrated = false;
+        directoryName = file.getParent();
+        String jbossFileName = file.getName();
+        logger.debug("Directory Name ==> " + directoryName + " jboss file Name ==> "
+                + jbossFileName);
+
+        if (jbossFileName.equals(Constants.JBOSS_JBOSS_CMP_JDBC_XML_FILE)) {
+            out.info("Converting Jbosscmp-jdbc.xml file in " + directoryName);
+            try {
+                // check whether the jbosscmp-jdbc.xml file is present and
+                // if so load it and process it.
+                Document jbossDocument = XMLConversionHelper.getDocument(file);
+                Document geronimoDocument = XMLConversionHelper
+                        .getOpenEJBJarDocument(directoryName);
+                migrate(jbossDocument.getRootElement(), geronimoDocument.getRootElement());
+                String geronimoOpenEjbJarFileName = directoryName + File.separator
+                        + Constants.GERONIMO_OPEN_EJB_XML_FILE;
+                XMLConversionHelper.saveOpenEJBDocument(geronimoOpenEjbJarFileName,
+                        geronimoDocument);
+                migrated = true;
+                out.info("Successfully migrated the Jbosscmp-jdbc.xml file in "
+                        + directoryName + ", with the error and warning messages as shown");
+            } catch (DocumentException e) {
+            	out.error("Errors occurs while reading xml descriptor "
+						+ file.getAbsolutePath()
+						+ ". It is possible that the migrator cannot download an xml schema or xml file has a wrong syntax. Nested exception:"
+						+ e.getMessage());
+            } catch (IOException e) {
+                out.error("IO exception " + e.getMessage());
+            }
+        }
+        return migrated;
+    }
+
+    private void migrate(Element jbossRootElement, Element geronimoRootElement) {
+        Element jbossRootChildElement;
+        logger.debug("migrating the root elements");
+        for (Iterator iter = jbossRootElement.elements().iterator(); iter.hasNext();) {
+            jbossRootChildElement = (Element) iter.next();
+            if (jbossRootChildElement.getName().equals("defaults")) {
+                logger.debug("migrating the defaults");
+                migrateDefaults(jbossRootChildElement, geronimoRootElement);
+            } else if (jbossRootChildElement.getName().equals("enterprise-beans")) {
+                logger.debug("migrating the enterprise beans");
+                // process the enterprise bean element
+                // add enterprise beans element to geronimo
+                // this element is in the same name space as the root element
+                Element geronimoEnterpriseBean = XMLConversionHelper.getGeronimoElement(
+                        geronimoRootElement, "//ejb:enterprise-beans", "enterprise-beans",
+                        geronimoRootElement.getNamespace());
+                migrateEnterpriseBeans(jbossRootChildElement, geronimoEnterpriseBean);
+            } else if (jbossRootChildElement.getName().equals("relationships")) {
+                QName qname = new QName("relationships", geronimoRootElement.getNamespace());
+                Element geronimoReleationship = geronimoRootElement.addElement(qname);
+                migrateRelationships(jbossRootChildElement, geronimoReleationship);
+            } else {
+                out.warn("The Element '" + jbossRootChildElement.getName() + "' is not supported ",
+                        XMLConversionHelper.getLineNumber(jbossRootChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossRootChildElement));
+                logger.debug("The Element '" + jbossRootChildElement.getName()
+                        + "' is not supported ");
+            }
+        }
+    }
+
+    private void migrateRelationships(Element jbossRelationships, Element geronimoRelationships) {
+
+        Element jbossRelationshipsChildElement;
+        String fileName = directoryName + File.separator + Constants.EJB_JAR_XML_FILE;
+        EJBJarXmlProcessor ejbJarXmlProcessor = new EJBJarXmlProcessor(fileName);
+        try {
+            Relationships relationships = ejbJarXmlProcessor.getRelationships();
+            for (Iterator iter = jbossRelationships.elements().iterator(); iter.hasNext();) {
+                jbossRelationshipsChildElement = (Element) iter.next();
+                if (jbossRelationshipsChildElement.getName().equals("ejb-relation")) {
+                    QName qname = new QName("ejb-relation", geronimoRelationships.getNamespace());
+                    Element geronimoEJBRelation = geronimoRelationships.addElement(qname);
+
+                    Element ejbRelationName = jbossRelationshipsChildElement
+                            .element("ejb-relation-name");
+                    migrateEJBRelation(jbossRelationshipsChildElement, geronimoEJBRelation,
+                            relationships.getEJBRelation(ejbRelationName.getText().trim()));
+                }
+            }
+        } catch (DocumentException e) {
+            out.error("No ejb-jar.xml file exists can not migrate ralationships");
+        }
+    }
+
+    private void migrateEJBRelation(Element jbossEJBRelation, Element geronimoEJBRelation,
+                                    EJBRelation ejbRelation) {
+
+        Element jbossEJBRelationChildElement;
+        Element noKeyFieldsRelationshipRole = null;
+        Element noCmrFieldRelationshipRole = null;
+        boolean isRelationshipRoleMigrated = false;
+        for (Iterator iter = jbossEJBRelation.elements().iterator(); iter.hasNext();) {
+            jbossEJBRelationChildElement = (Element) iter.next();
+            if (jbossEJBRelationChildElement.getName().equals("ejb-relation-name")) {
+                QName qname = new QName("ejb-relation-name", geronimoEJBRelation.getNamespace());
+                Element geronimoEJBRelationName = geronimoEJBRelation.addElement(qname);
+                geronimoEJBRelationName.setText(jbossEJBRelationChildElement.getText());
+            } else if (jbossEJBRelationChildElement.getName().equals("relation-table-mapping")) {
+                QName qname = new QName("many-to-many-table-name", geronimoEJBRelation
+                        .getNamespace());
+                Element geronimoManyToMany = geronimoEJBRelation.addElement(qname);
+                migrateRelationTableMapping(jbossEJBRelationChildElement, geronimoManyToMany);
+            } else if (jbossEJBRelationChildElement.getName().equals("ejb-relationship-role")) {
+                Element keyFields = jbossEJBRelationChildElement.element("key-fields");
+                if ((keyFields == null) || (keyFields.elements().isEmpty())) {
+                    logger.debug("Key field is empty no neet to convert this element");
+                    // we store this element to process later if other ejb-relationship-role
+                    // does not have a cmr field.
+                    noKeyFieldsRelationshipRole = jbossEJBRelationChildElement;
+                } else {
+                    QName qname = new QName("ejb-relationship-role", geronimoEJBRelation
+                            .getNamespace());
+                    Element ejbRelationshipRoleName = jbossEJBRelationChildElement
+                            .element("ejb-relationship-role-name");
+                    EJBRelationshipRole ejbRelationshipRole =
+                            ejbRelation.getEJBRelationshipRole(ejbRelationshipRoleName.getText().trim());
+                    if (ejbRelationshipRole.getCmrFieldName() != null) {
+                        Element geronimoEJBRelationshipRole = geronimoEJBRelation.addElement(qname);
+
+                        migrateEJBRelationshipRole(jbossEJBRelationChildElement,
+                                geronimoEJBRelationshipRole, ejbRelationshipRole);
+                        isRelationshipRoleMigrated = true;
+                    } else {
+                        // we store this ejb-relationship-role element to process later
+                        noCmrFieldRelationshipRole = jbossEJBRelationChildElement;
+                    }
+                }
+            }
+        }
+
+        if (!isRelationshipRoleMigrated) {
+            // i.e. the ejbrelationship role which has the key fields does not contain a cmr field.
+            QName qname = new QName("ejb-relationship-role", geronimoEJBRelation
+                            .getNamespace());
+            Element geronimoEJBRelationshipRole = geronimoEJBRelation.addElement(qname);
+            migrateEJBRelationshipRole(noKeyFieldsRelationshipRole,
+                    noCmrFieldRelationshipRole,
+                    geronimoEJBRelationshipRole,
+                    ejbRelation);
+        }
+    }
+
+    private void migrateEJBRelationshipRole(Element jbossNoKeyEJBRelationshipRole,
+                                            Element jbossNoCmrEJBRelationshipRole,
+                                            Element geronimoEJBRelationshipRole,
+                                            EJBRelation ejbRelation) {
+
+        // adding ejb-relationship-role element
+        Element jbossNoKeyEJBRelationshipRoleName =
+                jbossNoKeyEJBRelationshipRole.element("ejb-relationship-role-name");
+        QName qname = new QName("ejb-relationship-role-name", geronimoEJBRelationshipRole
+                .getNamespace());
+        Element ejbRoleNameElement = geronimoEJBRelationshipRole.addElement(qname);
+        ejbRoleNameElement.setText(jbossNoKeyEJBRelationshipRoleName.getText());
+
+        EJBRelationshipRole ejbNoKeyRelationshipRole =
+                ejbRelation.getEJBRelationshipRole(jbossNoKeyEJBRelationshipRoleName.getText().trim());
+
+        // add the relationship role source
+        qname = new QName("relationship-role-source", geronimoEJBRelationshipRole
+                .getNamespace());
+        Element ejbRoleSourceElement = geronimoEJBRelationshipRole.addElement(qname);
+
+        qname = new QName("ejb-name", geronimoEJBRelationshipRole.getNamespace());
+        Element ejbNameElement = ejbRoleSourceElement.addElement(qname);
+        ejbNameElement.setText(ejbNoKeyRelationshipRole.getSource());
+
+        // add cmr field
+        // add the cmr field name field
+        if (ejbNoKeyRelationshipRole.getCmrFieldName() != null) {
+            qname = new QName("cmr-field", geronimoEJBRelationshipRole.getNamespace());
+            Element cmrFieldElement = geronimoEJBRelationshipRole.addElement(qname);
+
+            qname = new QName("cmr-field-name", geronimoEJBRelationshipRole.getNamespace());
+            Element cmrFieldName = cmrFieldElement.addElement(qname);
+            cmrFieldName.setText(ejbNoKeyRelationshipRole.getCmrFieldName());
+        } else {
+            out.error("No cmr field given to relation ship " + ejbRelation.getEjbRelationName());
+        }
+
+        // put foreign-key-column-on-source
+        if (ejbNoKeyRelationshipRole.getMultiplicity().equals("Many")){
+            qname = new QName("foreign-key-column-on-source", geronimoEJBRelationshipRole.getNamespace());
+            geronimoEJBRelationshipRole.addElement(qname);
+        }
+
+
+        // add role mapping
+        Element jbossNoCMREJBRelationshipRoleName =
+                jbossNoKeyEJBRelationshipRole.element("ejb-relationship-role-name");
+        EJBRelationshipRole ejbNoCmrRelationshipRole =
+                ejbRelation.getEJBRelationshipRole(jbossNoCMREJBRelationshipRoleName.getText().trim());
+
+        // add key fields
+        Element jbossNoCMRKeyFieles = jbossNoCmrEJBRelationshipRole.element("key-fields");
+        qname = new QName("role-mapping", geronimoEJBRelationshipRole.getNamespace());
+        Element geronimoRoleMapping = geronimoEJBRelationshipRole.addElement(qname);
+        migrateKeyFields(jbossNoCMRKeyFieles, geronimoRoleMapping,
+                (Map) ejbKeyColumnMapper.get(ejbNoCmrRelationshipRole.getSource()));
+
+
+    }
+
+    private void migrateEJBRelationshipRole(Element jbossEJBRelationshipRole,
+                                            Element geronimoEJBRelationshipRole, EJBRelationshipRole ejbRelationshipRole) {
+        Element jbossRelationshipChildElement;
+        String ejbName = null;
+        for (Iterator iter = jbossEJBRelationshipRole.elements().iterator(); iter.hasNext();) {
+            jbossRelationshipChildElement = (Element) iter.next();
+
+            if (jbossRelationshipChildElement.getName().equals("ejb-relationship-role-name")) {
+                // add ejb relationship element
+                QName qname = new QName("ejb-relationship-role-name", geronimoEJBRelationshipRole
+                        .getNamespace());
+                Element ejbRoleNameElement = geronimoEJBRelationshipRole.addElement(qname);
+                ejbRoleNameElement.setText(jbossRelationshipChildElement.getText());
+
+                // add the relationship role source
+                qname = new QName("relationship-role-source", geronimoEJBRelationshipRole
+                        .getNamespace());
+                Element ejbRoleSourceElement = geronimoEJBRelationshipRole.addElement(qname);
+
+                qname = new QName("ejb-name", geronimoEJBRelationshipRole.getNamespace());
+                Element ejbNameElement = ejbRoleSourceElement.addElement(qname);
+                ejbNameElement.setText(ejbRelationshipRole.getSource());
+
+                // add the cmr field name field
+                qname = new QName("cmr-field", geronimoEJBRelationshipRole.getNamespace());
+                Element cmrFieldElement = geronimoEJBRelationshipRole.addElement(qname);
+
+                qname = new QName("cmr-field-name", geronimoEJBRelationshipRole.getNamespace());
+                Element cmrFieldName = cmrFieldElement.addElement(qname);
+                cmrFieldName.setText(ejbRelationshipRole.getCmrFieldName());
+
+                ejbName = ejbRelationshipRole.getSource();
+
+
+            } else if (jbossRelationshipChildElement.getName().equals("key-fields")) {
+                QName qname = new QName("role-mapping", geronimoEJBRelationshipRole.getNamespace());
+                Element geronimoRoleMapping = geronimoEJBRelationshipRole.addElement(qname);
+                migrateKeyFields(jbossRelationshipChildElement, geronimoRoleMapping,
+                        (Map) ejbKeyColumnMapper.get(ejbName));
+            }
+        }
+
+    }
+
+    private void migrateKeyFields(Element jbossKeyField, Element geronimoRoleMapping,
+                                  Map keyFieldMap) {
+
+        Element jbossKeyFieldChild;
+        for (Iterator iter = jbossKeyField.elements().iterator(); iter.hasNext();) {
+            jbossKeyFieldChild = (Element) iter.next();
+            if (jbossKeyFieldChild.getName().equals("key-field")) {
+                QName qname = new QName("cmr-field-mapping", geronimoRoleMapping.getNamespace());
+                Element geronimoCMRFieldMapping = geronimoRoleMapping.addElement(qname);
+                migrateKeyField(jbossKeyFieldChild, geronimoCMRFieldMapping, keyFieldMap);
+            }
+        }
+    }
+
+    private void migrateKeyField(Element jbossKeyField, Element geronimoCMRFieldMapping,
+                                 Map keyFieldMap) {
+        Element jbossKeyFieldChild;
+        for (Iterator iter = jbossKeyField.elements().iterator(); iter.hasNext();) {
+            jbossKeyFieldChild = (Element) iter.next();
+            if (jbossKeyFieldChild.getName().equals("field-name")) {
+                QName qname = new QName("key-column", geronimoCMRFieldMapping.getNamespace());
+                Element geronimoKeyColumn = geronimoCMRFieldMapping.addElement(qname);
+                // get the table column name
+                geronimoKeyColumn.setText((String) keyFieldMap.get(jbossKeyFieldChild.getText().trim()));
+            } else if (jbossKeyFieldChild.getName().equals("column-name")) {
+                QName qname = new QName("foreign-key-column", geronimoCMRFieldMapping
+                        .getNamespace());
+                Element geronimoForegnKeyColumn = geronimoCMRFieldMapping.addElement(qname);
+                geronimoForegnKeyColumn.setText(jbossKeyFieldChild.getText());
+            }
+        }
+    }
+
+    /**
+     * this method may be use ful in future
+     *
+     * @param jbossTableMappingElement
+     * @param geronimoManytoManyTable
+     */
+
+    private void migrateRelationTableMapping(Element jbossTableMappingElement,
+                                             Element geronimoManytoManyTable) {
+
+        Element jbossTableMappingChildElement;
+        for (Iterator iter = jbossTableMappingElement.elements().iterator(); iter.hasNext();) {
+            jbossTableMappingChildElement = (Element) iter.next();
+            if (jbossTableMappingChildElement.getName().equals("table-name")) {
+                geronimoManytoManyTable.setText(jbossTableMappingChildElement.getText());
+            }
+        }
+    }
+
+    /**
+     * this migrates the enterprise-beans part
+     *
+     * @param jbossEnterpriseBeans
+     * @param geronimoEnterpriseBeans
+     */
+    private void migrateEnterpriseBeans(Element jbossEnterpriseBeans,
+                                        Element geronimoEnterpriseBeans) {
+
+        Element jbossEnterpriseBeanChildElement;
+        for (Iterator iter = jbossEnterpriseBeans.elements().iterator(); iter.hasNext();) {
+            jbossEnterpriseBeanChildElement = (Element) iter.next();
+            if (jbossEnterpriseBeanChildElement.getName().equals("entity")) {
+
+                // get the entity ejb name
+                Element ejbNameElement = jbossEnterpriseBeanChildElement.element("ejb-name");
+                String ejbName = ejbNameElement.getText().trim();
+                logger.debug("Converting ejb session with name ==> " + ejbName);
+                // create a session bean in geronimo
+                String xpath = "//ejb:enterprise-beans/ejb:entity[ejb:ejb-name/text() = '"
+                        + ejbName + "']";
+                logger.debug("Find existing ejb using query ==>" + xpath);
+                Element geronimoEntity = XMLConversionHelper.getGeronimoElement(
+                        geronimoEnterpriseBeans, xpath, "entity", geronimoEnterpriseBeans
+                        .getNamespace());
+                cmpEntityBeanMigrator.migrateBean(jbossEnterpriseBeanChildElement, geronimoEntity);
+                // put the key columns to hash map
+                ejbKeyColumnMapper.put(ejbName, cmpEntityBeanMigrator.getKeyColumnMap());
+            }
+        }
+    }
+
+    private void migrateDefaults(Element jbossDefaultsElement, Element geronimoRootElement) {
+
+        Element jbossDefaultsChildElement;
+        for (Iterator iter = jbossDefaultsElement.elements().iterator(); iter.hasNext();) {
+            jbossDefaultsChildElement = (Element) iter.next();
+            if (jbossDefaultsChildElement.getName().equals("datasource")) {
+                // creates the cmp connection factory element
+                logger.debug("migrating the datasource");
+                QName qname = new QName("cmp-connection-factory", geronimoRootElement
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoCMPConnectionFactoryElement = geronimoRootElement.addElement(qname);
+                logger.debug("cmp-connection-factory added to geromimo");
+                String jndiName = jbossDefaultsChildElement.getText();
+                String artifactID;
+                if (!envirionmentElementProcessor.isJndiNameProcessed(jndiName)) {
+                    artifactID = envirionmentElementProcessor.addDependencyModule(jndiName,
+                            geronimoCMPConnectionFactoryElement.getDocument().getRootElement());
+                } else {
+                    artifactID = envirionmentElementProcessor.getArtifactID(jndiName);
+                }
+                qname = new QName("resource-link", geronimoCMPConnectionFactoryElement
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoResourceLink = geronimoCMPConnectionFactoryElement
+                        .addElement(qname);
+                geronimoResourceLink.setText(artifactID);
+                logger.debug("resource-link added to geronimo");
+            } else {
+                out.warn("The Element '" + jbossDefaultsChildElement.getName()
+                        + "' is not supported", XMLConversionHelper
+                        .getLineNumber(jbossDefaultsChildElement), XMLConversionHelper
+                        .getColumnNumber(jbossDefaultsChildElement));
+                logger.debug("The Element '" + jbossDefaultsChildElement.getName()
+                        + "' is not supported");
+            }
+        }
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPDescriptorTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPDescriptorTool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPDescriptorTool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPEntityBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPEntityBeanMigrator.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPEntityBeanMigrator.java (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPEntityBeanMigrator.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,122 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.apps.j2gmigrator.descriptors.cmp;
+
+import org.dom4j.Element;
+import org.dom4j.QName;
+import org.apache.apps.j2gmigrator.IOutput;
+import org.apache.apps.j2gmigrator.Tool;
+import org.apache.apps.j2gmigrator.descriptors.xmlutil.XMLConversionHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.HashMap;
+
+
+public class CMPEntityBeanMigrator {
+
+    private IOutput out = Tool.getCurrent().getOutput();
+
+    private Log logger = LogFactory.getLog(CMPEntityBeanMigrator.class);
+
+    // this is used to keep the filed name and column name
+    // key field name vaue column name
+    private Map keyColumnMap;
+
+    public void migrateBean(Element jbossEntity, Element geronimoEntity) {
+
+        Element jbossEntityChildElement;
+        keyColumnMap = new HashMap();
+        for (Iterator iter = jbossEntity.elements().iterator(); iter.hasNext();) {
+            jbossEntityChildElement = (Element) iter.next();
+            if (jbossEntityChildElement.getName().equals("ejb-name")) {
+                // we have to check the ejb name since ejb name can put by the
+                // jboss.xml as well.
+                String xpath = "//ejb:ejb-name[text() ='" + jbossEntityChildElement.getText()
+                        + "']";
+                logger.debug("Find existing ejb names with xpath ==> " + xpath);
+                if (!XMLConversionHelper.isNodeAvailable(geronimoEntity, xpath)) {
+                    logger.debug("migrating the ejb name");
+                    QName qname = new QName("ejb-name", geronimoEntity.getNamespace());
+                    Element geronimoEJBName = geronimoEntity.addElement(qname);
+                    geronimoEJBName.setText(jbossEntityChildElement.getText());
+                    logger.debug("added ejb-name to geromimo");
+                }
+
+            } else if (jbossEntityChildElement.getName().equals("table-name")) {
+                logger.debug("migrating the table name");
+                QName qname = new QName("table-name", geronimoEntity.getNamespace());
+                Element geronimoTableName = geronimoEntity.addElement(qname);
+                geronimoTableName.setText(jbossEntityChildElement.getText());
+                logger.debug("added table name");
+            } else if (jbossEntityChildElement.getName().equals("cmp-field")) {
+                QName qname = new QName("cmp-field-mapping", geronimoEntity.getNamespace());
+                Element geronimoCMPFieldMapping = geronimoEntity.addElement(qname);
+                migrateCMPFieldMapping(jbossEntityChildElement, geronimoCMPFieldMapping);
+            } else {
+                out.warn("The Element '" + jbossEntityChildElement.getName() + "' is not suported",
+                        XMLConversionHelper.getLineNumber(jbossEntityChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossEntityChildElement));
+                logger.debug("The Element '" + jbossEntityChildElement.getName()
+                        + "' is not suported");
+            }
+
+        }
+    }
+
+    private void migrateCMPFieldMapping(Element jbossCMPField, Element geronimoCMPFieldMapping) {
+
+        Element jbossCMPFieldChild;
+        String fieldName = null;
+        String columnName = null;
+        for (Iterator iter = jbossCMPField.elements().iterator(); iter.hasNext();) {
+            jbossCMPFieldChild = (Element) iter.next();
+            if (jbossCMPFieldChild.getName().equals("field-name")) {
+                QName qname = new QName("cmp-field-name", geronimoCMPFieldMapping.getNamespace());
+                Element geronimoCMPFieldName = geronimoCMPFieldMapping.addElement(qname);
+                geronimoCMPFieldName.setText(jbossCMPFieldChild.getText());
+                fieldName = jbossCMPFieldChild.getText().trim();
+            } else if (jbossCMPFieldChild.getName().equals("column-name")) {
+                QName qname = new QName("table-column", geronimoCMPFieldMapping.getNamespace());
+                Element geronimoTableColumn = geronimoCMPFieldMapping.addElement(qname);
+                geronimoTableColumn.setText(jbossCMPFieldChild.getText());
+                columnName = jbossCMPFieldChild.getText().trim();
+            } else {
+               out.warn("The Element '" + jbossCMPFieldChild.getName() + "' is not suported",
+                        XMLConversionHelper.getLineNumber(jbossCMPFieldChild),
+                        XMLConversionHelper.getColumnNumber(jbossCMPFieldChild));
+               logger.debug("The Element '" + jbossCMPFieldChild.getName()
+                        + "' is not suported");
+            }
+        }
+
+        if ((fieldName != null) && (columnName != null)){
+            keyColumnMap.put(fieldName,columnName);
+        }
+    }
+
+    public Map getKeyColumnMap() {
+        return keyColumnMap;
+    }
+
+    public void setKeyColumnMap(Map keyColumnMap) {
+        this.keyColumnMap = keyColumnMap;
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPEntityBeanMigrator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPEntityBeanMigrator.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/CMPEntityBeanMigrator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/EJBJarXmlProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/EJBJarXmlProcessor.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/EJBJarXmlProcessor.java (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/EJBJarXmlProcessor.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,98 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.apps.j2gmigrator.descriptors.cmp;
+
+
+import org.apache.apps.j2gmigrator.descriptors.cmp.dto.EJBRelation;
+import org.apache.apps.j2gmigrator.descriptors.cmp.dto.EJBRelationshipRole;
+import org.apache.apps.j2gmigrator.descriptors.cmp.dto.Relationships;
+import org.apache.apps.j2gmigrator.descriptors.xmlutil.XMLConversionHelper;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+
+import java.io.File;
+import java.util.List;
+import java.util.Iterator;
+
+public class EJBJarXmlProcessor {
+
+    private String fileName;
+
+    public EJBJarXmlProcessor(String fileName) {
+        this.fileName = fileName;
+    }
+
+    /**
+     * @return relationships of the ejb jar xml file
+     */
+
+    public Relationships getRelationships() throws DocumentException {
+        Document document = XMLConversionHelper.getDocument(new File(fileName));
+        List ejbRelations = document.selectNodes("//relationships/ejb-relation");
+
+        Relationships relationships = new Relationships();
+
+        Element ejbRelationsChileElement;
+        for (Iterator iter = ejbRelations.iterator(); iter.hasNext();) {
+            ejbRelationsChileElement = (Element) iter.next();
+            if (ejbRelationsChileElement.getName().equals("ejb-relation")) {
+                relationships.addEJBRealtion(getEJBRelation(ejbRelationsChileElement));
+            }
+        }
+
+        return relationships;
+    }
+
+    private EJBRelation getEJBRelation(Element ejbRelationElement) {
+
+        EJBRelation ejbRelation = new EJBRelation();
+        Element ejbRelationChildElement;
+        for (Iterator iter = ejbRelationElement.elements().iterator(); iter.hasNext();) {
+            ejbRelationChildElement = (Element) iter.next();
+            if (ejbRelationChildElement.getName().equals("ejb-relation-name")) {
+                ejbRelation.setEjbRelationName(ejbRelationChildElement.getText().trim());
+            } else if (ejbRelationChildElement.getName().equals("ejb-relationship-role")) {
+                ejbRelation.addRelationshipRole(getEJBRelationshipRole(ejbRelationChildElement));
+            }
+        }
+        return ejbRelation;
+    }
+
+    private EJBRelationshipRole getEJBRelationshipRole(Element ejbRelationshipRoleElement) {
+
+        EJBRelationshipRole ejbRelationshipRole = new EJBRelationshipRole();
+        Element ejbRelationshipRoleChildElement;
+        for (Iterator iter = ejbRelationshipRoleElement.elements().iterator(); iter.hasNext();) {
+            ejbRelationshipRoleChildElement = (Element) iter.next();
+            if (ejbRelationshipRoleChildElement.getName().equals("ejb-relationship-role-name")) {
+                ejbRelationshipRole.setName(ejbRelationshipRoleChildElement.getText().trim());
+            } else if (ejbRelationshipRoleChildElement.getName().equals("multiplicity")) {
+                ejbRelationshipRole.setMultiplicity(ejbRelationshipRoleChildElement.getText().trim());
+            } else if (ejbRelationshipRoleChildElement.getName().equals("relationship-role-source")) {
+                Element ejbName = ejbRelationshipRoleChildElement.element("ejb-name");
+                ejbRelationshipRole.setSource(ejbName.getText().trim());
+            } else if (ejbRelationshipRoleChildElement.getName().equals("cmr-field")){
+                Element cmrFieldName = ejbRelationshipRoleChildElement.element("cmr-field-name");
+                ejbRelationshipRole.setCmrFieldName(cmrFieldName.getText().trim());
+            }
+        }
+        return ejbRelationshipRole;
+    }
+
+}

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/EJBJarXmlProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/EJBJarXmlProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/EJBJarXmlProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelation.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelation.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelation.java (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelation.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,56 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.apps.j2gmigrator.descriptors.cmp.dto;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * keep ejb relation details of the ejb-jar.xml file
+ * 
+ */
+public class EJBRelation {
+    private String ejbRelationName;
+
+    private Map ejbRelationshipRoles;
+
+    public EJBRelation(String ejbRelationName) {
+        this.ejbRelationName = ejbRelationName;
+        this.ejbRelationshipRoles = new HashMap();
+    }
+
+    public EJBRelation() {
+        this.ejbRelationshipRoles = new HashMap();
+    }
+
+    public void addRelationshipRole(EJBRelationshipRole ejbRelationshipRole) {
+        ejbRelationshipRoles.put(ejbRelationshipRole.getName(), ejbRelationshipRole);
+    }
+
+    public EJBRelationshipRole getEJBRelationshipRole(String name) {
+        return (EJBRelationshipRole) this.ejbRelationshipRoles.get(name);
+    }
+
+    public String getEjbRelationName() {
+        return ejbRelationName;
+    }
+
+    public void setEjbRelationName(String ejbRelationName) {
+        this.ejbRelationName = ejbRelationName;
+    }
+
+}

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelation.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelationshipRole.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelationshipRole.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelationshipRole.java (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelationshipRole.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,61 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.apps.j2gmigrator.descriptors.cmp.dto;
+
+public class EJBRelationshipRole {
+
+    private String name;
+
+    private String multiplicity;
+
+    private String source;
+
+    private String cmrFieldName;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getMultiplicity() {
+        return multiplicity;
+    }
+
+    public void setMultiplicity(String multiplicity) {
+        this.multiplicity = multiplicity;
+    }
+
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+    public String getCmrFieldName() {
+        return cmrFieldName;
+    }
+
+    public void setCmrFieldName(String cmrFieldName) {
+        this.cmrFieldName = cmrFieldName;
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelationshipRole.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelationshipRole.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/EJBRelationshipRole.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/Relationships.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/Relationships.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/Relationships.java (added)
+++ geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/Relationships.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,39 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.apps.j2gmigrator.descriptors.cmp.dto;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class Relationships {
+
+    private Map ejbRelations;
+
+    public Relationships() {
+        this.ejbRelations = new HashMap();
+    }
+
+    public void addEJBRealtion(EJBRelation ejbRelation) {
+        this.ejbRelations.put(ejbRelation.getEjbRelationName(), ejbRelation);
+    }
+
+    public EJBRelation getEJBRelation(String name) {
+        return (EJBRelation) this.ejbRelations.get(name);
+    }
+
+}

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/Relationships.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/Relationships.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/ejb-cmp-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/cmp/dto/Relationships.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message