You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by da...@apache.org on 2006/12/08 17:43:44 UTC

svn commit: r484656 [3/6] - in /incubator/openejb/trunk/openejb3: container/openejb-core/src/main/java/org/apache/openejb/alt/config/ container/openejb-core/src/main/java/org/apache/openejb/core/ container/openejb-core/src/test/java/org/apache/openejb/...

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BBean.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BBean.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BBean.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,90 @@
+/**
+ * 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.openejb.test.entity.cmr.onetoone;
+
+import javax.ejb.CreateException;
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import javax.ejb.RemoveException;
+
+import org.apache.openejb.test.entity.cmr.CompoundPK;
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public abstract class BBean implements EntityBean {
+
+    private EntityContext context;
+
+    // CMP
+    public abstract Integer getField1();
+    public abstract void setField1(Integer field1);
+
+    public abstract String getField2();
+    public abstract void setField2(String field2);
+
+    public abstract Integer getField3();
+    public abstract void setField3(Integer field3);
+
+    public abstract String getField4();
+    public abstract void setField4(String field4);
+
+    // CMR
+    public abstract ALocal getA();
+    public abstract void setA(ALocal b);
+    
+    public Integer ejbCreate(Integer field1)  throws CreateException {
+        setField1(field1);
+        return null;
+    }
+
+    public void ejbPostCreate(Integer field1) {
+    }
+
+    public CompoundPK ejbCreate(CompoundPK primaryKey)  throws CreateException {
+        setField1(primaryKey.field1);
+        setField2(primaryKey.field2);
+        return null;
+    }
+
+    public void ejbPostCreate(CompoundPK primaryKey) {
+    }
+
+    public void setEntityContext(EntityContext ctx) {
+        context = ctx;
+    }
+
+    public void unsetEntityContext() {
+        context = null;
+    }
+
+    public void ejbActivate() {
+    }
+
+    public void ejbPassivate() {
+    }
+
+    public void ejbLoad() {
+    }
+
+    public void ejbStore() {
+    }
+
+    public void ejbRemove() throws RemoveException {
+    }
+}

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocal.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocal.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocal.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocal.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,44 @@
+/**
+ * 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.openejb.test.entity.cmr.onetoone;
+
+import javax.ejb.EJBLocalObject;
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public interface BLocal extends EJBLocalObject {
+
+    // CMP
+    public Integer getField1();
+    public void setField1(Integer field1);
+
+    public String getField2();
+    public void setField2(String field2);
+
+    public Integer getField3();
+    public void setField3(Integer field3);
+
+    public String getField4();
+    public void setField4(String field4);
+
+    // CMR
+    public ALocal getA();
+    public void setA(ALocal a);
+    
+}

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocalHome.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocalHome.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocalHome.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/cmr/onetoone/BLocalHome.java Fri Dec  8 08:43:38 2006
@@ -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.openejb.test.entity.cmr.onetoone;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalHome;
+import javax.ejb.FinderException;
+
+import org.apache.openejb.test.entity.cmr.CompoundPK;
+
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public interface BLocalHome extends EJBLocalHome {
+
+    // Create
+    public BLocal create(Integer field1) throws CreateException;
+    public BLocal create(CompoundPK primaryKey) throws CreateException;
+
+    // Finder
+    public BLocal findByPrimaryKey(Integer primaryKey) throws FinderException;
+    public BLocal findByPrimaryKey(CompoundPK primaryKey) throws FinderException;
+}

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ABean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ABean.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ABean.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ABean.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,89 @@
+/**
+ * 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.openejb.test.entity.ejbql;
+
+
+import javax.ejb.CreateException;
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import javax.ejb.FinderException;
+import javax.ejb.RemoveException;
+
+import org.apache.openejb.test.entity.cmr.CompoundPK;
+
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public abstract class ABean implements EntityBean {
+
+    private EntityContext context;
+    
+    // CMP
+    public abstract Integer getField1();
+    public abstract void setField1(Integer field1);
+
+    public abstract String getField2();
+    public abstract void setField2(String field2);
+    
+    public Integer ejbCreate(Integer field1)  throws CreateException {
+        setField1(field1);
+        return null;
+    }
+
+    public void ejbPostCreate(Integer field1) {
+    }
+
+    public CompoundPK ejbCreate(CompoundPK compoundPK)  throws CreateException {
+        setField1(compoundPK.field1);
+        setField2(compoundPK.field2);
+        return null;
+    }
+
+    public void ejbPostCreate(CompoundPK compoundPK) {
+    }
+
+    public void setEntityContext(EntityContext ctx) {
+        context = ctx;
+    }
+
+    public void unsetEntityContext() {
+        context = null;
+    }
+
+    public void ejbActivate() {
+    }
+
+    public void ejbPassivate() {
+    }
+
+    public void ejbLoad() {
+    }
+
+    public void ejbStore() {
+    }
+
+    public void ejbRemove() throws RemoveException {
+    }
+    
+    public ALocal ejbHomeSelectTest(String test) throws FinderException {
+        return ejbSelectTest(test);
+    }
+    
+    public abstract ALocal ejbSelectTest(String test) throws FinderException;
+}

Propchange: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ABean.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/AHome.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/AHome.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/AHome.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/AHome.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,42 @@
+/**
+ * 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.openejb.test.entity.ejbql;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+import javax.ejb.FinderException;
+
+import org.apache.openejb.test.entity.cmr.CompoundPK;
+
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public interface AHome extends EJBHome {
+
+    // Create
+    public ARemote create(Integer field1) throws CreateException, RemoteException;
+    public ARemote create(CompoundPK primaryKey) throws CreateException, RemoteException;
+
+    // Finder
+    public ARemote findByPrimaryKey(Integer primaryKey) throws FinderException, RemoteException;
+    public ARemote findTest(String value) throws FinderException, RemoteException;
+    
+}

Propchange: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/AHome.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocal.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocal.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocal.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocal.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,34 @@
+/**
+ * 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.openejb.test.entity.ejbql;
+
+import javax.ejb.EJBLocalObject;
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public interface ALocal extends EJBLocalObject {
+
+    // CMP
+    public Integer getField1();
+    public void setField1(Integer field1);
+
+    public String getField2();
+    public void setField2(String field2);
+    
+}

Propchange: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocal.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocalHome.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocalHome.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocalHome.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocalHome.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,42 @@
+/**
+ * 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.openejb.test.entity.ejbql;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalHome;
+import javax.ejb.FinderException;
+
+import org.apache.openejb.test.entity.cmr.CompoundPK;
+
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public interface ALocalHome extends EJBLocalHome {
+
+    // Create
+    public ALocal create(Integer field1) throws CreateException;
+    public ALocal create(CompoundPK primaryKey) throws CreateException;
+
+    // Finder
+    public ALocal findByPrimaryKey(Integer primaryKey) throws FinderException;
+    public ALocal findTest(String value) throws FinderException;
+
+    public ALocal selectTest(String test) throws FinderException; 
+    
+}

Propchange: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ALocalHome.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ARemote.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ARemote.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ARemote.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ARemote.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,36 @@
+/**
+ * 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.openejb.test.entity.ejbql;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ *
+ * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
+ */
+public interface ARemote extends EJBObject {
+
+    // CMP
+    public Integer getField1() throws RemoteException;
+    public void setField1(Integer field1) throws RemoteException;
+
+    public String getField2() throws RemoteException;
+    public void setField2(String field2) throws RemoteException;
+    
+}

Propchange: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/ARemote.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml?view=diff&rev=484656&r1=484655&r2=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/ejb-jar.xml Fri Dec  8 08:43:38 2006
@@ -20,7 +20,12 @@
 
 <!-- $Rev$ $Date$ -->
 
-<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0" metadata-complete="true">
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                  http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+              version="3.0" metadata-complete="true">
+
     <description>
     This ejb-jar file contains assembled enterprise beans that are
     part of employee self-service application.
@@ -54,6 +59,7 @@
             <remote>org.apache.openejb.test.entity.cmp.BasicCmpObject</remote>
             <ejb-class>org.apache.openejb.test.entity.cmp.BasicCmpBean</ejb-class>
             <persistence-type>Container</persistence-type>
+            <cmp-version>1.x</cmp-version>
             <prim-key-class>java.lang.Integer</prim-key-class>
             <reentrant>False</reentrant>
             <primkey-field>primaryKey</primkey-field>
@@ -67,6 +73,30 @@
 
         <!--
         ########################################################
+        ID:  client/tests/entity/cmp2/BasicCmpHome
+        ########################################################
+        -->
+
+        <entity>
+            <ejb-name>BasicCmp2Bean</ejb-name>
+            <home>org.apache.openejb.test.entity.cmp.BasicCmpHome</home>
+            <remote>org.apache.openejb.test.entity.cmp.BasicCmpObject</remote>
+            <ejb-class>org.apache.openejb.test.entity.cmp.BasicCmp2Bean$JPA</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <cmp-version>1.x</cmp-version>
+            <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>False</reentrant>
+            <primkey-field>id</primkey-field>
+            <resource-ref>
+                <description>This is a reference to a JDBC database.</description>
+                <res-ref-name>jdbc/basic/entityDatabase</res-ref-name>
+                <res-type>javax.sql.DataSource</res-type>
+                <res-auth>Container</res-auth>
+            </resource-ref>
+        </entity>
+
+        <!--
+        ########################################################
         ID:  client/tests/entity/cmp/allowed_operations/EntityHome
         ########################################################
         -->
@@ -80,6 +110,7 @@
             <remote>org.apache.openejb.test.entity.cmp.BasicCmpObject</remote>
             <ejb-class>org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean</ejb-class>
             <persistence-type>Container</persistence-type>
+            <cmp-version>1.x</cmp-version>
             <prim-key-class>java.lang.Integer</prim-key-class>
             <reentrant>False</reentrant>
             <primkey-field>primaryKey</primkey-field>
@@ -95,6 +126,35 @@
 
         <!--
         ########################################################
+        ID:  client/tests/entity/cmp2/allowed_operations/EntityHome
+        ########################################################
+        -->
+
+        <entity>
+            <description>
+             blah, blah, blah
+            </description>
+            <ejb-name>AOBasicCmp2Bean</ejb-name>
+            <home>org.apache.openejb.test.entity.cmp.BasicCmpHome</home>
+            <remote>org.apache.openejb.test.entity.cmp.BasicCmpObject</remote>
+            <ejb-class>org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean$JPA</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <cmp-version>1.x</cmp-version>
+            <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>False</reentrant>
+            <primkey-field>id</primkey-field>
+            <resource-ref>
+                <description>
+                This is a reference to a JDBC database.
+                </description>
+                <res-ref-name>jdbc/basic/entityDatabase</res-ref-name>
+                <res-type>javax.sql.DataSource</res-type>
+                <res-auth>Container</res-auth>
+            </resource-ref>
+        </entity>
+
+        <!--
+        ########################################################
         ID:  client/tests/entity/cmp/EncBean
         ########################################################
         -->
@@ -108,6 +168,7 @@
             <remote>org.apache.openejb.test.entity.cmp.EncCmpObject</remote>
             <ejb-class>org.apache.openejb.test.entity.cmp.EncCmpBean</ejb-class>
             <persistence-type>Container</persistence-type>
+            <cmp-version>1.x</cmp-version>
             <prim-key-class>java.lang.Integer</prim-key-class>
             <reentrant>False</reentrant>
             <primkey-field>primaryKey</primkey-field>
@@ -189,6 +250,97 @@
             </resource-ref>
         </entity>
 
+        <!--
+        ########################################################
+        ID:  client/tests/entity/cmp2/EncBean
+        ########################################################
+        -->
+
+        <entity>
+            <description>
+             blah, blah, blah
+            </description>
+            <ejb-name>EncCmp2Bean</ejb-name>
+            <home>org.apache.openejb.test.entity.cmp.EncCmpHome</home>
+            <remote>org.apache.openejb.test.entity.cmp.EncCmpObject</remote>
+            <ejb-class>org.apache.openejb.test.entity.cmp.EncCmp2Bean$JPA</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <cmp-version>2.x</cmp-version>
+            <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>False</reentrant>
+            <primkey-field>id</primkey-field>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/Boolean</env-entry-name>
+                <env-entry-type>java.lang.Boolean</env-entry-type>
+                <env-entry-value>true</env-entry-value>
+            </env-entry>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/String</env-entry-name>
+                <env-entry-type>java.lang.String</env-entry-type>
+                <env-entry-value>1</env-entry-value>
+            </env-entry>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/Double</env-entry-name>
+                <env-entry-type>java.lang.Double</env-entry-type>
+                <env-entry-value>1</env-entry-value>
+            </env-entry>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/Long</env-entry-name>
+                <env-entry-type>java.lang.Long</env-entry-type>
+                <env-entry-value>1</env-entry-value>
+            </env-entry>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/Float</env-entry-name>
+                <env-entry-type>java.lang.Float</env-entry-type>
+                <env-entry-value>1</env-entry-value>
+            </env-entry>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/Integer</env-entry-name>
+                <env-entry-type>java.lang.Integer</env-entry-type>
+                <env-entry-value>1</env-entry-value>
+            </env-entry>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/Short</env-entry-name>
+                <env-entry-type>java.lang.Short</env-entry-type>
+                <env-entry-value>1</env-entry-value>
+            </env-entry>
+            <env-entry>
+                <env-entry-name>entity/cmp/references/Byte</env-entry-name>
+                <env-entry-type>java.lang.Byte</env-entry-type>
+                <env-entry-value>1</env-entry-value>
+            </env-entry>
+            <ejb-ref>
+                <ejb-ref-name>entity/cmp/beanReferences/cmp_entity</ejb-ref-name>
+                <ejb-ref-type>Entity</ejb-ref-type>
+                <home>org.apache.openejb.test.entity.cmp.BasicCmpHome</home>
+                <remote>org.apache.openejb.test.entity.cmp.BasicCmpObject</remote>
+                <ejb-link>BasicCmpBean</ejb-link>
+            </ejb-ref>
+            <ejb-ref>
+                <ejb-ref-name>entity/cmp/beanReferences/stateful</ejb-ref-name>
+                <ejb-ref-type>Session</ejb-ref-type>
+                <home>org.apache.openejb.test.stateful.BasicStatefulHome</home>
+                <remote>org.apache.openejb.test.stateful.BasicStatefulObject</remote>
+                <ejb-link>BasicStatefulBean</ejb-link>
+            </ejb-ref>
+            <ejb-ref>
+                <ejb-ref-name>entity/cmp/beanReferences/stateless</ejb-ref-name>
+                <ejb-ref-type>Session</ejb-ref-type>
+                <home>org.apache.openejb.test.stateless.BasicStatelessHome</home>
+                <remote>org.apache.openejb.test.stateless.BasicStatelessObject</remote>
+                <ejb-link>BasicStatelessBean</ejb-link>
+            </ejb-ref>
+            <resource-ref>
+                <res-ref-name>datasource</res-ref-name>
+                <res-type>javax.sql.DataSource</res-type>
+                <res-auth>Container</res-auth>
+            </resource-ref>
+            <resource-ref>
+                <res-ref-name>jdbc/basic/entityDatabase</res-ref-name>
+                <res-type>javax.sql.DataSource</res-type>
+                <res-auth>Container</res-auth>
+            </resource-ref>
+        </entity>
 
         <!--
         ########################################################
@@ -301,6 +453,7 @@
             <remote>org.apache.openejb.test.entity.cmp.RmiIiopCmpObject</remote>
             <ejb-class>org.apache.openejb.test.entity.cmp.RmiIiopCmpBean</ejb-class>
             <persistence-type>Container</persistence-type>
+            <cmp-version>1.x</cmp-version>
             <prim-key-class>java.lang.Integer</prim-key-class>
             <reentrant>False</reentrant>
             <primkey-field>primaryKey</primkey-field>
@@ -319,6 +472,103 @@
 
         <!--
         ########################################################
+        ID:  client/tests/entity/cmp2/RMI-over-IIOP/EJBHome
+        ########################################################
+        -->
+
+        <entity>
+            <description>
+             blah, blah, blah
+            </description>
+            <ejb-name>Cmp2 RMI-IIOP Bean</ejb-name>
+            <home>org.apache.openejb.test.entity.cmp.RmiIiopCmpHome</home>
+            <remote>org.apache.openejb.test.entity.cmp.RmiIiopCmpObject</remote>
+            <ejb-class>org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean$JPA</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <cmp-version>2.x</cmp-version>
+            <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>False</reentrant>
+            <primkey-field>id</primkey-field>
+            <ejb-ref>
+                <ejb-ref-name>cmp/rmi-iiop/home</ejb-ref-name>
+                <ejb-ref-type>Entity</ejb-ref-type>
+                <home>org.apache.openejb.test.entity.cmp.EncCmpHome</home>
+                <remote>org.apache.openejb.test.entity.cmp.EncCmpObject</remote>
+                <ejb-link>EncCmpBean</ejb-link>
+            </ejb-ref>
+            <security-role-ref>
+                <role-name>TheMan</role-name>
+                <role-link>Executive</role-link>
+            </security-role-ref>
+        </entity>
+
+        <entity>
+            <ejb-name>OneOwningSideBean</ejb-name>
+            <local-home>org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideLocalHome</local-home>
+            <local>org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideLocal</local>
+            <ejb-class>org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean$JPA</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <!--<prim-key-class>org.apache.openejb.test.entity.cmr.cmrmapping.CompoundPK</prim-key-class>-->
+            <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>false</reentrant>
+            <cmp-version>2.x</cmp-version>
+            <abstract-schema-name>Order</abstract-schema-name>
+            <cmp-field>
+                <field-name>id</field-name>
+            </cmp-field>
+            <cmp-field>
+                <field-name>field1</field-name>
+            </cmp-field>
+            <primkey-field>id</primkey-field>
+        </entity>
+
+        <entity>
+            <ejb-name>OneInverseSideBean</ejb-name>
+            <local-home>org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideLocalHome</local-home>
+            <local>org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideLocal</local>
+            <ejb-class>org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean$JPA</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>false</reentrant>
+            <cmp-version>2.x</cmp-version>
+            <abstract-schema-name>Order</abstract-schema-name>
+            <cmp-field>
+                <field-name>id</field-name>
+            </cmp-field>
+            <primkey-field>id</primkey-field>
+        </entity>
+
+        <entity>
+            <ejb-name>ManyOwningSideBean</ejb-name>
+            <local-home>org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideLocalHome</local-home>
+            <local>org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideLocal</local>
+            <ejb-class>org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean$JPA</ejb-class>
+            <persistence-type>Container</persistence-type>
+            <!--<prim-key-class>org.apache.openejb.test.entity.cmr.cmrmapping.CompoundPK</prim-key-class>-->
+           <prim-key-class>java.lang.Integer</prim-key-class>
+            <reentrant>false</reentrant>
+            <cmp-version>2.x</cmp-version>
+            <abstract-schema-name>Order</abstract-schema-name>
+            <cmp-field>
+                <field-name>id</field-name>
+            </cmp-field>
+            <cmp-field>
+                <field-name>field1</field-name>
+            </cmp-field>
+            <primkey-field>id</primkey-field>
+            <query>
+                <query-method>
+                    <method-name>ejbSelectSomething</method-name>
+                    <method-params>
+                        <method-param>java.lang.Integer</method-param>
+                    </method-params>
+                </query-method>
+                <ejb-ql>SELECT m.oneInverseSide FROM Order m WHERE m.id = ?1</ejb-ql>
+            </query>
+        </entity>
+
+        <!--
+        ########################################################
         ########################################################
         ####  S T A T E F U L   S E S S I O N   B E A N S  #####
         ########################################################
@@ -1405,6 +1655,49 @@
         </entity>
     </enterprise-beans>
 
+    <relationships>
+        <ejb-relation>
+            <ejb-relationship-role>
+                <multiplicity>One</multiplicity>
+                <relationship-role-source>
+                    <ejb-name>OneOwningSideBean</ejb-name>
+                </relationship-role-source>
+                <cmr-field>
+                    <cmr-field-name>oneInverseSide</cmr-field-name>
+                </cmr-field>
+            </ejb-relationship-role>
+            <ejb-relationship-role>
+                <multiplicity>One</multiplicity>
+                <relationship-role-source>
+                    <ejb-name>OneInverseSideBean</ejb-name>
+                </relationship-role-source>
+                <cmr-field>
+                    <cmr-field-name>oneOwningSide</cmr-field-name>
+                </cmr-field>
+            </ejb-relationship-role>
+        </ejb-relation>
+        <ejb-relation>
+            <ejb-relationship-role>
+                <multiplicity>Many</multiplicity>
+                <relationship-role-source>
+                    <ejb-name>ManyOwningSideBean</ejb-name>
+                </relationship-role-source>
+                <cmr-field>
+                    <cmr-field-name>oneInverseSide</cmr-field-name>
+                </cmr-field>
+            </ejb-relationship-role>
+            <ejb-relationship-role>
+                <multiplicity>One</multiplicity>
+                <relationship-role-source>
+                    <ejb-name>OneInverseSideBean</ejb-name>
+                </relationship-role-source>
+                <cmr-field>
+                    <cmr-field-name>manyOwningSide</cmr-field-name>
+                </cmr-field>
+            </ejb-relationship-role>
+        </ejb-relation>
+    </relationships>
+
     <assembly-descriptor>
         <security-role>
             <description>The description</description>
@@ -1483,6 +1776,27 @@
         <container-transaction>
             <method>
                 <ejb-name>Cmp RMI-IIOP Bean</ejb-name>
+                <method-name>*</method-name>
+            </method>
+            <trans-attribute>Required</trans-attribute>
+        </container-transaction>
+        <container-transaction>
+            <method>
+                <ejb-name>OneOwningSideBean</ejb-name>
+                <method-name>*</method-name>
+            </method>
+            <trans-attribute>Required</trans-attribute>
+        </container-transaction>
+        <container-transaction>
+            <method>
+                <ejb-name>OneInverseSideBean</ejb-name>
+                <method-name>*</method-name>
+            </method>
+            <trans-attribute>Required</trans-attribute>
+        </container-transaction>
+        <container-transaction>
+            <method>
+                <ejb-name>ManyOwningSideBean</ejb-name>
                 <method-name>*</method-name>
             </method>
             <trans-attribute>Required</trans-attribute>

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/jpa.mapping.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/jpa.mapping.xml?view=diff&rev=484656&r1=484655&r2=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/jpa.mapping.xml (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/jpa.mapping.xml Fri Dec  8 08:43:38 2006
@@ -1,5 +1,51 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
 <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" version="1.0">
+
+  <!--<table-generator name="id_gen"-->
+      <!--pk-column-name="name"-->
+      <!--value-column-name="value"-->
+      <!--pk-column-value="entity">-->
+  <!--</table-generator>-->
+
+  <entity class="org.apache.openejb.test.entity.cmp2.Employee">
+    <description>Simple Entity Bean</description>
+
+    <table name="employee"/>
+
+    <attributes>
+      <id name="id">
+        <column name="id"/>
+        <generated-value strategy="AUTO"/>
+      </id>
+      <basic name="firstName">
+        <column name="first_name"/>
+      </basic>
+      <basic name="lastName">
+        <column name="last_name"/>
+      </basic>
+    </attributes>
+  </entity>
+
   <entity class="org.apache.openejb.test.entity.cmp.BasicCmpBean" access="FIELD">
     <description>Simple Entity Bean</description>
 
@@ -8,6 +54,7 @@
     <attributes>
       <id name="primaryKey">
         <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
       </id>
       <basic name="firstName">
         <column name="first_name"/>
@@ -19,7 +66,25 @@
     </attributes>
   </entity>
 
-  <!--  Mapping for AllowedOperationsCmpBean  -->
+  <entity name="BasicCmp2Bean" class="org.apache.openejb.test.entity.cmp.BasicCmp2Bean$JPA" access="PROPERTY">
+    <description>Simple Entity Bean</description>
+
+    <table name="entity"/>
+
+    <attributes>
+      <id name="id">
+        <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
+      </id>
+      <basic name="firstName">
+        <column name="first_name"/>
+      </basic>
+      <basic name="lastName">
+        <column name="last_name"/>
+      </basic>
+    </attributes>
+  </entity>
+
   <entity class="org.apache.openejb.test.entity.cmp.AllowedOperationsCmpBean">
     <description>Simple Entity Bean</description>
 
@@ -28,6 +93,7 @@
     <attributes>
       <id name="primaryKey">
         <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
       </id>
       <basic name="firstName">
         <column name="first_name"/>
@@ -39,6 +105,25 @@
     </attributes>
   </entity>
 
+  <entity name="AllowedOperationsCmp2Bean" class="org.apache.openejb.test.entity.cmp.AllowedOperationsCmp2Bean$JPA" access="PROPERTY">
+    <description>Simple Entity Bean</description>
+
+    <table name="entity"/>
+
+    <attributes>
+      <id name="id">
+        <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
+      </id>
+      <basic name="firstName">
+        <column name="first_name"/>
+      </basic>
+      <basic name="lastName">
+        <column name="last_name"/>
+      </basic>
+    </attributes>
+  </entity>
+
   <entity class="org.apache.openejb.test.entity.cmp.EncCmpBean">
     <description>Simple Entity Bean</description>
 
@@ -47,6 +132,7 @@
     <attributes>
       <id name="primaryKey">
         <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
       </id>
       <basic name="firstName">
         <column name="first_name"/>
@@ -59,7 +145,6 @@
 
   <entity class="org.apache.openejb.test.entity.cmp.ContextLookupCmpBean">
     <description>Simple Entity Bean</description>
-
     <table name="entity"/>
 
     <attributes>
@@ -75,6 +160,24 @@
     </attributes>
   </entity>
 
+  <entity name="EncCmp2Bean" class="org.apache.openejb.test.entity.cmp.EncCmp2Bean$JPA" access="PROPERTY">
+    <description>Simple Entity Bean</description>
+
+    <table name="entity"/>
+
+    <attributes>
+      <id name="id">
+        <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
+      </id>
+      <basic name="firstName">
+        <column name="first_name"/>
+      </basic>
+      <basic name="lastName">
+        <column name="last_name"/>
+      </basic>
+    </attributes>
+  </entity>
 
   <entity class="org.apache.openejb.test.entity.cmp.RmiIiopCmpBean">
     <description>Simple Entity Bean</description>
@@ -83,12 +186,64 @@
     <attributes>
       <id name="primaryKey">
         <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
+      </id>
+      <basic name="firstName">
+        <column name="first_name"/>
+      </basic>
+      <basic name="lastName">
+        <column name="last_name"/>
+      </basic>
+    </attributes>
+  </entity>
+
+  <entity name="RmiIiopCmp2Bean" class="org.apache.openejb.test.entity.cmp.RmiIiopCmp2Bean$JPA" access="PROPERTY">
+    <description>Simple Entity Bean</description>
+
+    <table name="entity"/>
+    <attributes>
+      <id name="id">
+        <column name="id"/>
+        <!--<generated-value strategy="TABLE" generator="id_gen"/>-->
       </id>
       <basic name="firstName">
         <column name="first_name"/>
       </basic>
       <basic name="lastName">
         <column name="last_name"/>
+      </basic>
+    </attributes>
+  </entity>
+
+  <entity name="OneOwningSideBean" class="org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideBean$JPA" access="PROPERTY">
+    <table name="OneOwning"/>
+    <attributes>
+      <id name="id">
+        <column name="col_id"/>
+      </id>
+      <basic name="field1">
+        <column name="col_field1"/>
+      </basic>
+    </attributes>
+  </entity>
+
+  <entity name="OneInverseSideBean" class="org.apache.openejb.test.entity.cmr.cmrmapping.OneInverseSideBean$JPA" access="PROPERTY">
+    <table name="OneInverse"/>
+    <attributes>
+      <id name="id">
+        <column name="col_id"/>
+      </id>
+    </attributes>
+  </entity>
+
+  <entity name="ManyOwning" class="org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideBean$JPA" access="PROPERTY">
+    <table name="ManyOwning"/>
+    <attributes>
+      <id name="id">
+        <column name="col_id"/>
+      </id>
+      <basic name="field1">
+        <column name="col_field1"/>
       </basic>
     </attributes>
   </entity>

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml?view=diff&rev=484656&r1=484655&r2=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/resources/META-INF/openejb-jar.xml Fri Dec  8 08:43:38 2006
@@ -39,7 +39,30 @@
             SELECT o FROM BasicCmpBean o WHERE 'true' = 'false'
         </object-ql>
     </query>
-    </ejb-deployment>
+  </ejb-deployment>
+  <ejb-deployment ejb-name="BasicCmp2Bean" deployment-id="client/tests/entity/cmp2/BasicCmpHome" container-id="Default CMP Container">
+    <resource-link res-ref-name="jdbc/basic/entityDatabase" res-id="Default JDBC Database"/>
+    <query>
+        <query-method>
+            <method-name>findByLastName</method-name>
+            <method-params>
+                <method-param>java.lang.String</method-param>
+            </method-params>
+        </query-method>
+        <object-ql>
+            SELECT o FROM BasicCmp2Bean o WHERE o.lastName = ?1
+        </object-ql>
+    </query>
+    <query>
+        <query-method>
+            <method-name>findEmptyCollection</method-name>
+            <method-params/>
+        </query-method>
+        <object-ql>
+            SELECT o FROM BasicCmp2Bean o WHERE 'true' = 'false'
+        </object-ql>
+    </query>
+  </ejb-deployment>
 	<ejb-deployment ejb-name="AOBasicCmpBean" deployment-id="client/tests/entity/cmp/allowed_operations/EntityHome" container-id="Default CMP Container">
 		<resource-link res-ref-name="jdbc/basic/entityDatabase" res-id="Default JDBC Database"/>
     <query>
@@ -63,15 +86,46 @@
         </object-ql>
     </query>
 	</ejb-deployment>
+  <ejb-deployment ejb-name="AOBasicCmp2Bean" deployment-id="client/tests/entity/cmp2/allowed_operations/EntityHome" container-id="Default CMP Container">
+    <resource-link res-ref-name="jdbc/basic/entityDatabase" res-id="Default JDBC Database"/>
+    <query>
+        <query-method>
+            <method-name>findByLastName</method-name>
+            <method-params>
+                <method-param>java.lang.String</method-param>
+            </method-params>
+        </query-method>
+        <object-ql>
+            SELECT o FROM AllowedOperationsCmp2Bean o WHERE o.lastName = ?1
+        </object-ql>
+    </query>
+    <query>
+        <query-method>
+            <method-name>findEmptyCollection</method-name>
+            <method-params/>
+        </query-method>
+        <object-ql>
+            SELECT o FROM AllowedOperationsCmp2Bean o WHERE 'true' = 'false'
+        </object-ql>
+    </query>
+  </ejb-deployment>
 	<ejb-deployment ejb-name="EncCmpBean" deployment-id="client/tests/entity/cmp/EncBean" container-id="Default CMP Container">
 		<resource-link res-ref-name="datasource" res-id="Default JDBC Database"/>
 		<resource-link res-ref-name="jdbc/basic/entityDatabase" res-id="Default JDBC Database"/>
-    </ejb-deployment>
+  </ejb-deployment>
+  <ejb-deployment ejb-name="EncCmp2Bean" deployment-id="client/tests/entity/cmp2/EncBean" container-id="Default CMP Container">
+    <resource-link res-ref-name="datasource" res-id="Default JDBC Database"/>
+    <resource-link res-ref-name="jdbc/basic/entityDatabase" res-id="Default JDBC Database"/>
+  </ejb-deployment>
 	<ejb-deployment ejb-name="ContextLookupCmpBean" deployment-id="client/tests/entity/cmp/ContextLookupCmpBean" container-id="Default CMP Container">
 		<resource-link res-ref-name="datasource" res-id="Default JDBC Database"/>
 		<resource-link res-ref-name="jdbc/basic/entityDatabase" res-id="Default JDBC Database"/>
     </ejb-deployment>
 	<ejb-deployment ejb-name="Cmp RMI-IIOP Bean" deployment-id="client/tests/entity/cmp/RMI-over-IIOP/EJBHome" container-id="Default CMP Container"/>
+	<ejb-deployment ejb-name="Cmp2 RMI-IIOP Bean" deployment-id="client/tests/entity/cmp2/RMI-over-IIOP/EJBHome" container-id="Default CMP Container"/>
+	<ejb-deployment ejb-name="OneOwningSideBean" deployment-id="client/tests/entity/cmp2/OneOwningSideBean/EJBHome" container-id="Default CMP Container"/>
+	<ejb-deployment ejb-name="OneInverseSideBean" deployment-id="client/tests/entity/cmp2/OneInverseSideBean/EJBHome" container-id="Default CMP Container"/>
+	<ejb-deployment ejb-name="ManyOwningSideBean" deployment-id="client/tests/entity/cmp2/ManyOwningSideBean/EJBHome" container-id="Default CMP Container"/>
 	<ejb-deployment ejb-name="BasicStatefulBean" deployment-id="client/tests/stateful/BasicStatefulHome" container-id="Default Stateful Container"/>
 	<ejb-deployment ejb-name="BasicStatefulPojoBean" deployment-id="client/tests/stateful/BasicStatefulPojoHome" container-id="Default Stateful Container"/>
 	<ejb-deployment ejb-name="Basic BMT StatefulBean" deployment-id="client/tests/stateful/BeanManagedBasicStatefulHome" container-id="Default Stateful Container"/>

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java?view=diff&rev=484656&r1=484655&r2=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/InstantDbTestDatabase.java Fri Dec  8 08:43:38 2006
@@ -41,69 +41,75 @@
     private static String _createEntity = "CREATE TABLE entity ( id INT PRIMARY KEY AUTO INCREMENT, first_name CHAR(20), last_name CHAR(20) )";    
     private static String _dropEntity   = "DROP TABLE entity";
 
+    private static final String CREATE_ONE_OWNING = "CREATE TABLE oneowning (col_id INTEGER, col_field1 INTEGER)";
+
+    private static final String DROP_ONE_OWNING = "DROP TABLE oneowning";
+
+    private static final String CREATE_ONE_INVERSE = "CREATE TABLE oneinverse (col_id INTEGER)";
+
+    private static final String DROP_ONE_INVERSE = "DROP TABLE oneinverse";
+
+    private static final String CREATE_MANY_OWNING = "CREATE TABLE manyowning (col_id INTEGER, col_field1 INTEGER)";
+
+    private static final String DROP_MANY_OWNING = "DROP TABLE manyowning";
+
     static{
         System.setProperty("noBanner", "true");
     }
     
 
     public void createEntityTable() throws java.sql.SQLException {
-        try{
-            try{
-                database.execute(_dropEntity);
-            } catch (Exception e){
-                // not concerned
-            }
-            database.execute(_createEntity);
-        } catch (RemoteException re){
-            if (re.detail != null && re.detail instanceof java.sql.SQLException) {
-                throw (java.sql.SQLException)re.detail;
-            } else {
-                throw new java.sql.SQLException("Cannot create entity table: "+re.getMessage(), _createEntity);
-            }
-        }
+        createTable(_createEntity, _dropEntity);
+        createTable(CREATE_ONE_OWNING, DROP_ONE_OWNING);
+        createTable(CREATE_ONE_INVERSE, DROP_ONE_INVERSE);
+        createTable(CREATE_MANY_OWNING, DROP_MANY_OWNING);
     }
+
     public void dropEntityTable() throws java.sql.SQLException {
-        try {
-            database.execute(_dropEntity);
-        } catch (RemoteException re){
-            if (re.detail != null && re.detail instanceof java.sql.SQLException) {
-                throw (java.sql.SQLException)re.detail;
-            } else {
-                throw new java.sql.SQLException("Unable to drop entity table: "+re.getMessage(), _dropEntity);
-            }
-        }
+        dropTable(_dropEntity);
+        dropTable(DROP_ONE_OWNING);
+        dropTable(DROP_ONE_INVERSE);
+        dropTable(DROP_MANY_OWNING);
     }
-    
-    
+
     public void createAccountTable() throws java.sql.SQLException {
+        createTable(_createAccount, _dropAccount);
+    }
+
+    public void dropAccountTable() throws java.sql.SQLException {
+        dropTable(_dropAccount);
+    }
+
+    private void createTable(String create, String drop) throws java.sql.SQLException {
         try{
             try{
-                database.execute(_dropAccount);
+                database.execute(drop);
             } catch (Exception e){
                 // not concerned
             }
-            database.execute(_createAccount);
+            database.execute(create);
         } catch (RemoteException re){
             if (re.detail != null && re.detail instanceof java.sql.SQLException) {
                 throw (java.sql.SQLException)re.detail;
             } else {
-                throw new java.sql.SQLException("Cannot create account table: "+re.getMessage(), _createAccount);
+                throw new java.sql.SQLException("Cannot create table: "+re.getMessage(), create);
             }
         }
     }
-    
-    public void dropAccountTable() throws java.sql.SQLException {
+
+    private void dropTable(String drop) throws java.sql.SQLException {
         try {
-            database.execute(_dropAccount);
+            database.execute(drop);
         } catch (RemoteException re){
             if (re.detail != null && re.detail instanceof java.sql.SQLException) {
                 throw (java.sql.SQLException)re.detail;
             } else {
-                throw new java.sql.SQLException("Cannot drop account table: "+re.getMessage(), _dropAccount);
+                throw new java.sql.SQLException("Unable to drop table: "+re.getMessage(), drop);
             }
         }
     }
-    
+
+
     public void start() throws IllegalStateException {
         try {
             Properties properties = TestManager.getServer().getContextEnvironment();

Added: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp2/BasicCmp2TestClient.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp2/BasicCmp2TestClient.java?view=auto&rev=484656
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp2/BasicCmp2TestClient.java (added)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmp2/BasicCmp2TestClient.java Fri Dec  8 08:43:38 2006
@@ -0,0 +1,34 @@
+/**
+ * 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.openejb.test.entity.cmp2;
+
+import org.apache.openejb.test.entity.cmp.BasicCmpHome;
+import org.apache.openejb.test.entity.cmp.BasicCmpObject;
+
+/**
+ * 
+ */
+public abstract class BasicCmp2TestClient extends Cmp2TestClient {
+
+    protected BasicCmpHome ejbHome;
+    protected BasicCmpObject ejbObject;
+
+    public BasicCmp2TestClient(String name) {
+        super(name);
+    }
+}
+