User: dsundstrom
  Date: 01/11/02 13:20:29

  Modified:    src/main/org/jboss/ejb/plugins/cmp/jdbc/ejbql
                        EJBQLParser.java
  Log:
  Added support for input parameters in collection_member_expression as is
  required in the EJB 2.0 Final Draft.
  
  Revision  Changes    Path
  1.6       +23 -3     
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/ejbql/EJBQLParser.java
  
  Index: EJBQLParser.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/ejbql/EJBQLParser.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EJBQLParser.java  2001/09/01 22:03:17     1.5
  +++ EJBQLParser.java  2001/11/02 21:20:29     1.6
  @@ -497,12 +497,20 @@
         return emptyColCompExp;
      }
      
  -   // collection_member_expression ::= single_valued_path_expression [NOT ]MEMBER 
[OF ] collection_valued_path_expression
  +   // collection_member_expression ::=
  +   // {single_valued_navigation | identification_variable | input_parameter}
  +   // [NOT ]MEMBER [OF ] collection_valued_path_expression
      private Sequence colMemExp;
      protected Parser collectionMemberExpression() {
         if(colMemExp == null) {
            colMemExp = new Sequence();
  -         colMemExp.add(singleValuedPathExpression());
  +         
  +         Alternation varOrParam = new Alternation();
  +         varOrParam.add(singleValuedNavigation());
  +         varOrParam.add(identificationVariable());
  +         //varOrParam.add(inputParameter());
  +
  +         colMemExp.add(varOrParam);
            colMemExp.add(new Optional(new Literal("NOT")));
            colMemExp.add(new Literal("MEMBER").discard());
            colMemExp.add(new Optional(new Literal("OF").discard()));
  @@ -517,8 +525,19 @@
                     compareSymbol = "<>";
                     compareFromPath = a.pop().toString();
                  }
  +               
  +               String comparison;
  +               if("?".equals(compareFromPath)) {
  +                  comparison = target.getEntityWherePathToParameter(
  +                     compareFromPath,
  +                     compareSymbol);
  +               } else {
  +                  comparison = target.getEntityWherePathToPath(
  +                     compareFromPath,
  +                     compareSymbol,
  +                     compareTo);
  +               }
                  
  -               String comparison = target.getEntityWherePathToPath(compareFromPath, 
compareSymbol, compareTo);
                  if(comparison == null) {
                     a.setInvalid();
                  } else {
  @@ -775,6 +794,7 @@
         return entBeanVal;
      }
      
  +   // CHANGED in FD
      // entity_bean_expression ::= entity_bean_value | input_parameter
      private Alternation entBeanExp;
      protected Parser entityBeanExpression() {
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to