tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r525952 [2/2] - in /incubator/openejb/trunk/openejb3: ./ container/openejb-core/ container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ container/openejb-core/src/main/java/org/apache/openejb/config/ container/openejb-co...
Date Thu, 05 Apr 2007 20:11:51 GMT
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/daytrader/daytrader-orm.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/daytrader/daytrader-orm.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/daytrader/daytrader-orm.xml
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/daytrader/daytrader-orm.xml
Thu Apr  5 13:11:45 2007
@@ -33,13 +33,11 @@
             </basic>
             <many-to-one name="account">
                 <join-column referenced-column-name="accountID" name="account_accountID"/>
-                <cascade>
-                    <cascade-all/>
-                </cascade>
             </many-to-one>
             <many-to-one name="quote">
                 <join-column referenced-column-name="symbol" name="quote_symbol"/>
             </many-to-one>
+            <one-to-one name="Orders_holding" mapped-by="holding"/>
         </attributes>
     </entity>
     <entity name="AccountProfile" class="openejb.org.apache.geronimo.samples.daytrader.ejb.AccountProfile">
@@ -70,11 +68,7 @@
             <basic name="fullName">
                 <column name="fullName"/>
             </basic>
-            <one-to-one name="account" mapped-by="profile">
-                <cascade>
-                    <cascade-all/>
-                </cascade>
-            </one-to-one>
+            <one-to-one name="account" mapped-by="profile"/>
         </attributes>
     </entity>
     <entity name="Quote" class="openejb.org.apache.geronimo.samples.daytrader.ejb.Quote">
@@ -126,7 +120,12 @@
             <basic name="change">
                 <column name="change1"/>
             </basic>
-            <one-to-many name="orders" mapped-by="quote"/>
+            <one-to-many name="Holding_quote" mapped-by="quote"/>
+            <one-to-many name="orders" mapped-by="quote">
+                <cascade>
+                    <cascade-all/>
+                </cascade>
+            </one-to-many>
         </attributes>
     </entity>
     <entity name="KeyGen" class="openejb.org.apache.geronimo.samples.daytrader.ejb.KeyGen">
@@ -184,10 +183,21 @@
             <basic name="loginCount">
                 <column name="loginCount"/>
             </basic>
-            <one-to-many name="orders" mapped-by="account"/>
-            <one-to-many name="holdings" mapped-by="account"/>
+            <one-to-many name="orders" mapped-by="account">
+                <cascade>
+                    <cascade-all/>
+                </cascade>
+            </one-to-many>
+            <one-to-many name="holdings" mapped-by="account">
+                <cascade>
+                    <cascade-all/>
+                </cascade>
+            </one-to-many>
             <one-to-one name="profile">
                 <join-column referenced-column-name="userID" name="profile_userID"/>
+                <cascade>
+                    <cascade-all/>
+                </cascade>
             </one-to-one>
         </attributes>
     </entity>
@@ -236,18 +246,15 @@
             </basic>
             <many-to-one name="account">
                 <join-column referenced-column-name="accountID" name="account_accountID"/>
-                <cascade>
-                    <cascade-all/>
-                </cascade>
             </many-to-one>
             <many-to-one name="quote">
                 <join-column referenced-column-name="symbol" name="quote_symbol"/>
-                <cascade>
-                    <cascade-all/>
-                </cascade>
             </many-to-one>
             <one-to-one name="holding">
                 <join-column referenced-column-name="holdingID" name="holding_holdingID"/>
+                <cascade>
+                    <cascade-all/>
+                </cascade>
             </one-to-one>
         </attributes>
     </entity>

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/manytomany/simplepk/unidirectional-orm.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/manytomany/simplepk/unidirectional-orm.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/manytomany/simplepk/unidirectional-orm.xml
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/manytomany/simplepk/unidirectional-orm.xml
Thu Apr  5 13:11:45 2007
@@ -34,6 +34,7 @@
             <basic name="field3">
                 <column name="fka1"/>
             </basic>
+            <many-to-many name="manytomanyA_b" mapped-by="b"/>
         </attributes>
     </entity>
 </entity-mappings>

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/many-unidirectional-orm.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/many-unidirectional-orm.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/many-unidirectional-orm.xml
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/many-unidirectional-orm.xml
Thu Apr  5 13:11:45 2007
@@ -13,6 +13,11 @@
             <basic name="field2">
                 <column name="a2"/>
             </basic>
+            <one-to-many name="onetomanyB_a" mapped-by="a">
+                <cascade>
+                    <cascade-all/>
+                </cascade>
+            </one-to-many>
         </attributes>
     </entity>
     <entity name="onetomanyB" class="openejb.org.apache.openejb.deployment.entity.cmp.cmr.onetomany.onetomanyB">
@@ -33,9 +38,6 @@
             </basic>
             <many-to-one name="a">
                 <join-column referenced-column-name="a1" name="fka1"/>
-                <cascade>
-                    <cascade-all/>
-                </cascade>
             </many-to-one>
         </attributes>
     </entity>

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/one-unidirectional-orm.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/one-unidirectional-orm.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/one-unidirectional-orm.xml
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/one-unidirectional-orm.xml
Thu Apr  5 13:11:45 2007
@@ -13,8 +13,10 @@
             <basic name="field2">
                 <column name="a2"/>
             </basic>
-            <one-to-many name="b">
-                <join-column referenced-column-name="a1" name="fka1"/>
+            <one-to-many name="b" mapped-by="onetomanyA_b">
+                <cascade>
+                    <cascade-all/>
+                </cascade>
             </one-to-many>
         </attributes>
     </entity>
@@ -34,6 +36,9 @@
             <basic name="field3">
                 <column name="fka1"/>
             </basic>
+            <many-to-one name="onetomanyA_b">
+                <join-column referenced-column-name="a1" name="fka1"/>
+            </many-to-one>
         </attributes>
     </entity>
 </entity-mappings>

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/orm.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/orm.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/orm.xml
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetomany/simplepk/orm.xml
Thu Apr  5 13:11:45 2007
@@ -13,7 +13,11 @@
             <basic name="field2">
                 <column name="a2"/>
             </basic>
-            <one-to-many name="b" mapped-by="a"/>
+            <one-to-many name="b" mapped-by="a">
+                <cascade>
+                    <cascade-all/>
+                </cascade>
+            </one-to-many>
         </attributes>
     </entity>
     <entity name="onetomanyB" class="openejb.org.apache.openejb.deployment.entity.cmp.cmr.onetomany.onetomanyB">
@@ -34,9 +38,6 @@
             </basic>
             <many-to-one name="a">
                 <join-column referenced-column-name="a1" name="fka1"/>
-                <cascade>
-                    <cascade-all/>
-                </cascade>
             </many-to-one>
         </attributes>
     </entity>

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/orm.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/orm.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/orm.xml
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/orm.xml
Thu Apr  5 13:11:45 2007
@@ -13,11 +13,7 @@
             <basic name="field2">
                 <column name="a2"/>
             </basic>
-            <one-to-one name="b" mapped-by="a">
-                <cascade>
-                    <cascade-all/>
-                </cascade>
-            </one-to-one>
+            <one-to-one name="b" mapped-by="a"/>
         </attributes>
     </entity>
     <entity name="OneToOneB" class="openejb.org.apache.openejb.deployment.entity.cmp.cmr.onetoone.OneToOneB">
@@ -38,6 +34,9 @@
             </basic>
             <one-to-one name="a">
                 <join-column referenced-column-name="a1" name="fka1"/>
+                <cascade>
+                    <cascade-all/>
+                </cascade>
             </one-to-one>
         </attributes>
     </entity>

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/unidirectional-orm.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/unidirectional-orm.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/unidirectional-orm.xml
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/resources/convert/oej2/cmp/onetoone/simplepk/unidirectional-orm.xml
Thu Apr  5 13:11:45 2007
@@ -13,6 +13,7 @@
             <basic name="field2">
                 <column name="a2"/>
             </basic>
+            <one-to-one name="OneToOneB_a" mapped-by="a"/>
         </attributes>
     </entity>
     <entity name="OneToOneB" class="openejb.org.apache.openejb.deployment.entity.cmp.cmr.onetoone.OneToOneB">
@@ -33,6 +34,9 @@
             </basic>
             <one-to-one name="a">
                 <join-column referenced-column-name="a1" name="fka1"/>
+                <cascade>
+                    <cascade-all/>
+                </cascade>
             </one-to-one>
         </attributes>
     </entity>

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/CmrField.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/CmrField.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/CmrField.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/CmrField.java
Thu Apr  5 13:11:45 2007
@@ -59,6 +59,14 @@
     @XmlID
     protected String id;
 
+    public CmrField() {
+    }
+
+    public CmrField(String cmrFieldName, CmrFieldType cmrFieldType) {
+        this.cmrFieldName = cmrFieldName;
+        this.cmrFieldType = cmrFieldType;
+    }
+
     public List<Text> getDescription() {
         if (description == null) {
             description = new ArrayList<Text>();

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToMany.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToMany.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToMany.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToMany.java
Thu Apr  5 13:11:45 2007
@@ -90,6 +90,8 @@
     protected String targetEntity;
     @XmlTransient
     protected RelationField relatedField;
+    @XmlTransient
+    protected boolean syntheticField;
 
     /**
      * Gets the value of the orderBy property.
@@ -302,5 +304,23 @@
      */
     public void setRelatedField(RelationField value) {
         this.relatedField = value;
+    }
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    public boolean isSyntheticField() {
+        return syntheticField;
+    }
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    public void setSyntheticField(boolean syntheticField) {
+        this.syntheticField = syntheticField;
     }
 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToOne.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToOne.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToOne.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/ManyToOne.java
Thu Apr  5 13:11:45 2007
@@ -89,7 +89,9 @@
     protected String targetEntity;
     @XmlTransient
     protected RelationField relatedField;
-
+    @XmlTransient
+    protected boolean syntheticField;
+   
     /**
      * Gets the value of the joinColumn property.
      *
@@ -286,5 +288,23 @@
      */
     public void setRelatedField(RelationField value) {
         this.relatedField = value;
+    }
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    public boolean isSyntheticField() {
+        return syntheticField;
+    }
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    public void setSyntheticField(boolean syntheticField) {
+        this.syntheticField = syntheticField;
     }
 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToMany.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToMany.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToMany.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToMany.java
Thu Apr  5 13:11:45 2007
@@ -97,7 +97,9 @@
     protected String targetEntity;
     @XmlTransient
     protected RelationField relatedField;
-
+    @XmlTransient
+    protected boolean syntheticField;
+    
     /**
      * Gets the value of the orderBy property.
      *
@@ -334,5 +336,23 @@
      */
     public void setRelatedField(RelationField value) {
         this.relatedField = value;
+    }
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    public boolean isSyntheticField() {
+        return syntheticField;
+    }
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    public void setSyntheticField(boolean syntheticField) {
+        this.syntheticField = syntheticField;
     }
 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToOne.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToOne.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToOne.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/OneToOne.java
Thu Apr  5 13:11:45 2007
@@ -97,6 +97,8 @@
     protected String targetEntity;
     @XmlTransient
     protected RelationField relatedField;
+    @XmlTransient
+    protected boolean syntheticField;
 
     /**
      * Gets the value of the primaryKeyJoinColumn property.
@@ -339,5 +341,13 @@
      */
     public void setRelatedField(RelationField value) {
         this.relatedField = value;
+    }
+
+    public boolean isSyntheticField() {
+        return syntheticField;
+    }
+
+    public void setSyntheticField(boolean syntheticField) {
+        this.syntheticField = syntheticField;
     }
 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/RelationField.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/RelationField.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/RelationField.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/RelationField.java
Thu Apr  5 13:11:45 2007
@@ -57,4 +57,18 @@
      * @param value field on the target entity for this relationship.
      */
     void setRelatedField(RelationField value);
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    boolean isSyntheticField();
+
+    /**
+     * This is only used for xml converters and will normally return false.
+     * A true value indicates that this field was generated for CMR back references.
+     * @return true if this field was generated for CMR back references.
+     */
+    void setSyntheticField(boolean syntheticField);
 }

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/QueryDataBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/QueryDataBean.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/QueryDataBean.java
(original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/entity/ejbql/QueryDataBean.java
Thu Apr  5 13:11:45 2007
@@ -53,7 +53,7 @@
 
     public Integer ejbCreate(int value) {
         setId(value);
-        setBooleanField(value % 2 != 0);
+        setBooleanField(value == 2);
         setCharField((char) ('0' + value));
         setByteField((byte) value);
         setShortField((short) value);

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=525952&r1=525951&r2=525952
==============================================================================
--- 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
Thu Apr  5 13:11:45 2007
@@ -5319,7 +5319,6 @@
     <ejb-relation>
       <ejb-relationship-role>
         <multiplicity>One</multiplicity>
-        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>License</ejb-name>
         </relationship-role-source>
@@ -5329,7 +5328,7 @@
       </ejb-relationship-role>
       <ejb-relationship-role>
         <multiplicity>One</multiplicity>
-        <!--<cascade-delete/>-->
+        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>Person</ejb-name>
         </relationship-role-source>
@@ -5350,10 +5349,10 @@
           <cmr-field-name>performed</cmr-field-name>
           <cmr-field-type>java.util.Set</cmr-field-type>
         </cmr-field>
-        <cascade-delete/>
       </ejb-relationship-role>
       <ejb-relationship-role>
         <multiplicity>Many</multiplicity>
+        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>Song</ejb-name>
         </relationship-role-source>
@@ -5397,10 +5396,10 @@
           <cmr-field-name>platforms</cmr-field-name>
           <cmr-field-type>java.util.Set</cmr-field-type>
         </cmr-field>
-        <cascade-delete/>
       </ejb-relationship-role>
       <ejb-relationship-role>
         <multiplicity>Many</multiplicity>
+        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>Platform</ejb-name>
         </relationship-role-source>
@@ -5415,7 +5414,6 @@
     <ejb-relation>
       <ejb-relationship-role>
         <multiplicity>One</multiplicity>
-        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>ComplexLicense</ejb-name>
         </relationship-role-source>
@@ -5425,6 +5423,7 @@
       </ejb-relationship-role>
       <ejb-relationship-role>
         <multiplicity>One</multiplicity>
+        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>ComplexPerson</ejb-name>
         </relationship-role-source>
@@ -5446,10 +5445,10 @@
           <cmr-field-name>performed</cmr-field-name>
           <cmr-field-type>java.util.Set</cmr-field-type>
         </cmr-field>
-        <cascade-delete/>
       </ejb-relationship-role>
       <ejb-relationship-role>
         <multiplicity>Many</multiplicity>
+        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>ComplexSong</ejb-name>
         </relationship-role-source>
@@ -5493,10 +5492,10 @@
           <cmr-field-name>platforms</cmr-field-name>
           <cmr-field-type>java.util.Set</cmr-field-type>
         </cmr-field>
-        <cascade-delete/>
       </ejb-relationship-role>
       <ejb-relationship-role>
         <multiplicity>Many</multiplicity>
+        <cascade-delete/>
         <relationship-role-source>
           <ejb-name>ComplexPlatform</ejb-name>
         </relationship-role-source>

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyComplexPkTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyComplexPkTests.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyComplexPkTests.java
(original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyComplexPkTests.java
Thu Apr  5 13:11:45 2007
@@ -451,7 +451,7 @@
         Connection c = ds.getConnection();
         Statement s = c.createStatement();
 
-        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM ComplexGame_ComplexPlatform WHERE
id=" + platformId);
+        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM ComplexGame_ComplexPlatform WHERE
Platforms_id=" + platformId);
         assertTrue(rs.next());
         assertEquals(0, rs.getInt(1));
         rs.close();
@@ -482,7 +482,7 @@
         Connection c = ds.getConnection();
         Statement s = c.createStatement();
 
-        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM ComplexGame_ComplexPlatform WHERE
id = " + platformId + " AND Games_id = " + gameId);
+        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM ComplexGame_ComplexPlatform WHERE
Platforms_id = " + platformId + " AND Games_id = " + gameId);
         assertTrue(rs.next());
         assertEquals(1, rs.getInt(1));
         rs.close();

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyTests.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyTests.java
(original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/ManyToManyTests.java
Thu Apr  5 13:11:45 2007
@@ -448,7 +448,7 @@
         Connection c = ds.getConnection();
         Statement s = c.createStatement();
 
-        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM Game_Platform WHERE id=" + platformId);
+        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM Game_Platform WHERE Platforms_id="
+ platformId);
         assertTrue(rs.next());
         assertEquals(0, rs.getInt(1));
         rs.close();
@@ -479,7 +479,7 @@
         Connection c = ds.getConnection();
         Statement s = c.createStatement();
 
-        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM Game_Platform WHERE id = " +
platformId + " AND Games_id = " + gameId);
+        ResultSet rs = s.executeQuery("SELECT COUNT(*) FROM Game_Platform WHERE Platforms_id
= " + platformId + " AND Games_id = " + gameId);
         assertTrue(rs.next());
         assertEquals(1, rs.getInt(1));
         rs.close();

Modified: incubator/openejb/trunk/openejb3/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/pom.xml?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/pom.xml (original)
+++ incubator/openejb/trunk/openejb3/pom.xml Thu Apr  5 13:11:45 2007
@@ -614,8 +614,8 @@
       <dependency>
         <groupId>org.apache.openjpa</groupId>
         <artifactId>openjpa-persistence-jdbc</artifactId>
-        <!--version>0.9.7-incubating-SNAPSHOT</version-->
-        <version>0.9.6-incubating</version>
+        <version>0.9.7-incubating-SNAPSHOT</version>
+        <!--version>0.9.6-incubating</version-->
         <exclusions>
           <exclusion>
             <groupId>org.apache.geronimo.specs</groupId>

Modified: incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EntityEJBHomeHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EntityEJBHomeHandler.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EntityEJBHomeHandler.java
(original)
+++ incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EntityEJBHomeHandler.java
Thu Apr  5 13:11:45 2007
@@ -55,10 +55,14 @@
 
             case ResponseCodes.EJB_OK_FOUND:
                 primKey = res.getResult();
-                handler = EJBObjectHandler.createEJBObjectHandler(ejb, server, client, primKey);
-                handler.setEJBHomeProxy((EJBHomeProxy) proxy);
-                registerHandler(ejb.deploymentID + ":" + primKey, handler);
-                return handler.createEJBObjectProxy();
+                if (primKey == null) {
+                    return null;
+                } else {
+                    handler = EJBObjectHandler.createEJBObjectHandler(ejb, server, client,
primKey);
+                    handler.setEJBHomeProxy((EJBHomeProxy) proxy);
+                    registerHandler(ejb.deploymentID + ":" + primKey, handler);
+                    return handler.createEJBObjectProxy();
+                }
 
             case ResponseCodes.EJB_OK_FOUND_COLLECTION:
 
@@ -66,10 +70,12 @@
 
                 for (int i = 0; i < primaryKeys.length; i++) {
                     primKey = primaryKeys[i];
-                    handler = EJBObjectHandler.createEJBObjectHandler(ejb, server, client,
primKey);
-                    handler.setEJBHomeProxy((EJBHomeProxy) proxy);
-                    registerHandler(ejb.deploymentID + ":" + primKey, handler);
-                    primaryKeys[i] = handler.createEJBObjectProxy();
+                    if (primKey != null) {
+                        handler = EJBObjectHandler.createEJBObjectHandler(ejb, server, client,
primKey);
+                        handler.setEJBHomeProxy((EJBHomeProxy) proxy);
+                        registerHandler(ejb.deploymentID + ":" + primKey, handler);
+                        primaryKeys[i] = handler.createEJBObjectProxy();
+                    }
                 }
                 return java.util.Arrays.asList(primaryKeys);
             case ResponseCodes.EJB_OK_FOUND_ENUMERATION:
@@ -78,10 +84,12 @@
 
                 for (int i = 0; i < primaryKeys.length; i++) {
                     primKey = primaryKeys[i];
-                    handler = EJBObjectHandler.createEJBObjectHandler(ejb, server, client,
primKey);
-                    handler.setEJBHomeProxy((EJBHomeProxy) proxy);
-                    registerHandler(ejb.deploymentID + ":" + primKey, handler);
-                    primaryKeys[i] = handler.createEJBObjectProxy();
+                    if (primKey != null) {
+                        handler = EJBObjectHandler.createEJBObjectHandler(ejb, server, client,
primKey);
+                        handler.setEJBHomeProxy((EJBHomeProxy) proxy);
+                        registerHandler(ejb.deploymentID + ":" + primKey, handler);
+                        primaryKeys[i] = handler.createEJBObjectProxy();
+                    }
                 }
 
                 return new ArrayEnumeration(java.util.Arrays.asList(primaryKeys));

Modified: incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/Main.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/Main.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/Main.java
(original)
+++ incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/Main.java
Thu Apr  5 13:11:45 2007
@@ -17,7 +17,6 @@
 package org.apache.openejb.client;
 
 import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import javax.naming.NameNotFoundException;
 import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;

Modified: incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java?view=diff&rev=525952&r1=525951&r2=525952
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java
(original)
+++ incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java
Thu Apr  5 13:11:45 2007
@@ -20,6 +20,7 @@
 import java.io.ObjectOutputStream;
 import java.rmi.RemoteException;
 import java.util.Collection;
+import java.util.ArrayList;
 
 import javax.ejb.EJBHome;
 import javax.ejb.EJBObject;
@@ -287,7 +288,12 @@
             Object [] primaryKeys = ((Collection) result).toArray();
 
             for (int i = 0; i < primaryKeys.length; i++) {
-                primaryKeys[i] = ((ProxyInfo) primaryKeys[i]).getPrimaryKey();
+                ProxyInfo proxyInfo = ((ProxyInfo) primaryKeys[i]);
+                if (proxyInfo == null) {
+                    primaryKeys[i] = null;
+                } else {
+                    primaryKeys[i] = proxyInfo.getPrimaryKey();
+                }
             }
 
             res.setResponse(ResponseCodes.EJB_OK_FOUND_COLLECTION, primaryKeys);
@@ -295,17 +301,24 @@
         } else if (result instanceof java.util.Enumeration) {
 
             java.util.Enumeration resultAsEnum = (java.util.Enumeration) result;
-            java.util.List listOfPKs = new java.util.ArrayList();
+            java.util.List<Object> listOfPKs = new ArrayList<Object>();
             while (resultAsEnum.hasMoreElements()) {
-                listOfPKs.add(((ProxyInfo) resultAsEnum.nextElement()).getPrimaryKey());
+                ProxyInfo proxyInfo = ((ProxyInfo) resultAsEnum.nextElement());
+                if (proxyInfo == null) {
+                    listOfPKs.add(null);
+                } else {
+                    listOfPKs.add(proxyInfo.getPrimaryKey());
+                }
             }
 
             res.setResponse(ResponseCodes.EJB_OK_FOUND_ENUMERATION, listOfPKs.toArray(new
Object[listOfPKs.size()]));
             /* Single instance found */
         } else if (result instanceof ProxyInfo) {
-            result = ((ProxyInfo) result).getPrimaryKey();
+            ProxyInfo proxyInfo = ((ProxyInfo) result);
+            result = proxyInfo.getPrimaryKey();
             res.setResponse(ResponseCodes.EJB_OK_FOUND, result);
-
+        } else if (result == null) {
+            res.setResponse(ResponseCodes.EJB_OK_FOUND, null);
         } else {
 
             final String message = "The bean is not EJB compliant. " +



Mime
View raw message