0 Replies Latest reply: Sep 14, 2011 10:28 AM by 867403 RSS

    Help: IllegalExpressionException vs. EJB 2.1 many-to-many relationship

    867403
      Using Oracle WebLogic 11g (10.3.4). The appc tool is generating a warning regarding an illegal EJB QL expression for a many-to-may relationship in an EJB 2 Bean.

      Details:
      * Entity Bean "MSProduktKonfiguration"
      * Entity Bean "MSAngebot"
      * n-m relationship betwenn these two Entites, from MSProduktKonfiguration to MSAngebot by cmr field angebotLocal, from MSAngebot to MSProduktKonfiguration by cmr field produktKonfigurationenLocal
      * Join table "MS_PRODUKT.ANGEBOT_POSITION"

      Warnings from appc:

      [java] Warning: [EJB:013094]The SELECT clause of this query contains an identifier 'bean.angebotLocal' that ends in a cmr-field. The EJB 2.1 specification section 11.2.7.1 requires that any related null objects belonging to the set corresponding to this cmr-field must be returned by this query however the database that will be used to execute this query does not sufficiently support SQL outer joins, therefore this query will not return any null objects that might otherwise be returned.

      [java] Warning: [EJB:013094]The SELECT clause of this query contains an identifier 'bean.produktKonfigurationenLocal' that ends in a cmr-field. The EJB 2.1 specification section 11.2.7.1 requires that any related null objects belonging to the set corresponding to this cmr-field must be returned by this query however the database that will be used to execute this query does not sufficiently support SQL outer joins, therefore this query will not return any null objects that might otherwise be returned.

      I have no clue what's going on there. Maybe someone can help me out.

      Snippet from the ejb-jar.xml Deployment Descriptor:
      <ejb-relation id="EJBRelation_9">
      <ejb-relation-name>Angebot-ProduktKonfiguration</ejb-relation-name>

      <ejb-relationship-role id="EJBRelationshipRole_17">
      <ejb-relationship-role-name>ProduktKonfigurationen-Have-Angebote</ejb-relationship-role-name>
      <multiplicity>Many</multiplicity>
      <relationship-role-source id="RoleSource_17">
      <ejb-name>MSProduktKonfiguration</ejb-name>
      </relationship-role-source>
      <cmr-field id="CMRField_9">
      <cmr-field-name>angebotLocal</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role id="EJBRelationshipRole_18">
      <ejb-relationship-role-name>Angebote-Have-ProduktKonfigurationen</ejb-relationship-role-name>
      <multiplicity>Many</multiplicity>
      <relationship-role-source id="RoleSource_18">
      <ejb-name>MSAngebot</ejb-name>
      </relationship-role-source>
      <cmr-field id="CMRField_10">
      <cmr-field-name>produktKonfigurationenLocal</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>

      Snippet from the weblogic-cmp-rdbms-jar.xml Deployment Descriptor:

      <weblogic-rdbms-relation>
      <relation-name>Angebot-ProduktKonfiguration</relation-name>
      <table-name>MS_PRODUKT.ANGEBOT_POSITION</table-name>
      <weblogic-relationship-role>

      <relationship-role-name>Angebote-Have-ProduktKonfigurationen</relationship-role-name>
      <relationship-role-map>
      <column-map>
      <foreign-key-column>angebot_id</foreign-key-column>
      <key-column>angebot_id</key-column>
      </column-map>
      </relationship-role-map>
      </weblogic-relationship-role>
      <weblogic-relationship-role>
      <relationship-role-name>ProduktKonfigurationen-Have-Angebote</relationship-role-name>
      <relationship-role-map>
      <column-map>
      <foreign-key-column>produkt_konfiguration_id</foreign-key-column>
      <key-column>produkt_konfiguration_id</key-column>
      </column-map>
      </relationship-role-map>
      </weblogic-relationship-role>
      </weblogic-rdbms-relation>