Package org.jboss.ejb.plugins.cmp.bridge

Examples of org.jboss.ejb.plugins.cmp.bridge.CMPFieldBridge


    */
   private boolean isSelected(ASTPath path)
   {
      boolean selected = false;

      CMPFieldBridge cmpField = path.getCMPField();
      if(selectObject instanceof JDBCCMPFieldBridge && cmpField == selectObject)
      {
         selected = true;
      }
      else if(selectObject instanceof JDBCEntityBridge)
View Full Code Here


      // setup the from path
      ASTPath fromPath = (ASTPath) node.jjtGetChild(0);
      addInnerJoinPath(fromPath);
      String fromAlias = aliasManager.getAlias(fromPath.getPath(fromPath.size() - 2));
      CMPFieldBridge fromCMPField = (CMPFieldBridge) fromPath.getCMPField();

      Node toNode = node.jjtGetChild(1);
      if(toNode instanceof ASTParameter)
      {
         ASTParameter toParam = (ASTParameter) toNode;

         // can only compare like kind entities
         Class parameterType = getParameterType(toParam.number);
         if(!(fromCMPField.getFieldType().equals(parameterType)))
         {
            throw new IllegalStateException("Only like types can be " +
               "compared: from CMP field=" +
               fromCMPField.getFieldType() +
               " to parameter=" + parameterType);
         }

         inputParameters.addAll(QueryParameter.createParameters(toParam.number - 1, fromCMPField));
         SQLUtil.getWhereClause(fromCMPField.getJDBCType(), fromAlias, comparison, buf);
      }
      else
      {
         ASTPath toPath = (ASTPath) toNode;
         addInnerJoinPath(toPath);
         String toAlias = aliasManager.getAlias(toPath.getPath(toPath.size() - 2));
         JDBCCMPFieldBridge toCMPField = (JDBCCMPFieldBridge) toPath.getCMPField();

         // can only compare like kind entities
         if(!(fromCMPField.getFieldType().equals(toCMPField.getFieldType())))
         {
            throw new IllegalStateException("Only like types can be " +
               "compared: from CMP field=" +
               fromCMPField.getFieldType() +
               " to CMP field=" + toCMPField.getFieldType());
         }

         SQLUtil.getSelfCompareWhereClause(fromCMPField, toCMPField, fromAlias, toAlias, comparison, buf);
      }
View Full Code Here

      FieldBridge field = getCurrentSchema().getFieldByName(fieldName);
      if(field == null) {
         throwUnknownPath("Unknown terminal field", fieldName);
      }
      if(field instanceof CMPFieldBridge) {
         CMPFieldBridge cmpField = (CMPFieldBridge)field;
         switch(EJBQLTypes.getEJBQLType(cmpField.getFieldType())) {
            case EJBQLTypes.NUMERIC_TYPE:
               matchedToken.kind = NUMERIC_VALUED_PATH;
               break;
            case EJBQLTypes.STRING_TYPE:
               matchedToken.kind = STRING_VALUED_PATH;
View Full Code Here

    */
   private boolean isSelected(ASTPath path)
   {
      boolean selected = false;

      CMPFieldBridge cmpField = path.getCMPField();
      if(selectObject instanceof JDBCCMPFieldBridge && cmpField == selectObject)
      {
         selected = true;
      }
      else if(selectObject instanceof JDBCEntityBridge)
View Full Code Here

      FieldBridge field = getCurrentSchema().getFieldByName(fieldName);
      if(field == null) {
         throwUnknownPath("Unknown terminal field", fieldName);
      }
      if(field instanceof CMPFieldBridge) {
         CMPFieldBridge cmpField = (CMPFieldBridge)field;
         switch(EJBQLTypes.getEJBQLType(cmpField.getFieldType())) {
            case EJBQLTypes.NUMERIC_TYPE:
               matchedToken.kind = NUMERIC_VALUED_PATH;
               break;
            case EJBQLTypes.STRING_TYPE:
               matchedToken.kind = STRING_VALUED_PATH;
View Full Code Here

      // setup the from path
      ASTPath fromPath = (ASTPath) node.jjtGetChild(0);
      addInnerJoinPath(fromPath);
      String fromAlias = aliasManager.getAlias(fromPath.getPath(fromPath.size() - 2));
      CMPFieldBridge fromCMPField = (CMPFieldBridge) fromPath.getCMPField();

      Node toNode = node.jjtGetChild(1);
      if(toNode instanceof ASTParameter)
      {
         ASTParameter toParam = (ASTParameter) toNode;

         // can only compare like kind entities
         Class parameterType = getParameterType(toParam.number);
         if(!(fromCMPField.getFieldType().equals(parameterType)))
         {
            throw new IllegalStateException("Only like types can be " +
               "compared: from CMP field=" +
               fromCMPField.getFieldType() +
               " to parameter=" + parameterType);
         }

         inputParameters.addAll(QueryParameter.createParameters(toParam.number - 1, fromCMPField));
         SQLUtil.getWhereClause(fromCMPField.getJDBCType(), fromAlias, comparison, buf);
      }
      else
      {
         ASTPath toPath = (ASTPath) toNode;
         addInnerJoinPath(toPath);
         String toAlias = aliasManager.getAlias(toPath.getPath(toPath.size() - 2));
         JDBCCMPFieldBridge toCMPField = (JDBCCMPFieldBridge) toPath.getCMPField();

         // can only compare like kind entities
         if(!(fromCMPField.getFieldType().equals(toCMPField.getFieldType())))
         {
            throw new IllegalStateException("Only like types can be " +
               "compared: from CMP field=" +
               fromCMPField.getFieldType() +
               " to CMP field=" + toCMPField.getFieldType());
         }

         SQLUtil.getSelfCompareWhereClause(fromCMPField, toCMPField, fromAlias, toAlias, comparison, buf);
      }
View Full Code Here

/*      */
/*      */   private boolean isSelected(ASTPath path)
/*      */   {
/* 1833 */     boolean selected = false;
/*      */
/* 1835 */     CMPFieldBridge cmpField = path.getCMPField();
/* 1836 */     if (((this.selectObject instanceof JDBCCMPFieldBridge)) && (cmpField == this.selectObject))
/*      */     {
/* 1838 */       selected = true;
/*      */     }
/* 1840 */     else if ((this.selectObject instanceof JDBCEntityBridge))
View Full Code Here

/* 1926 */       FieldBridge field = getCurrentSchema().getFieldByName(fieldName);
/* 1927 */       if (field == null) {
/* 1928 */         throwUnknownPath("Unknown terminal field", fieldName);
/*      */       }
/* 1930 */       if ((field instanceof CMPFieldBridge)) {
/* 1931 */         CMPFieldBridge cmpField = (CMPFieldBridge)field;
/* 1932 */         switch (EJBQLTypes.getEJBQLType(cmpField.getFieldType())) {
/*      */         case 1:
/* 1934 */           matchedToken.kind = 83;
/* 1935 */           break;
/*      */         case 2:
/* 1937 */           matchedToken.kind = 84;
View Full Code Here

/*      */     }
/*      */
/*  934 */     ASTPath fromPath = (ASTPath)node.jjtGetChild(0);
/*  935 */     addInnerJoinPath(fromPath);
/*  936 */     String fromAlias = this.aliasManager.getAlias(fromPath.getPath(fromPath.size() - 2));
/*  937 */     CMPFieldBridge fromCMPField = fromPath.getCMPField();
/*      */
/*  939 */     Node toNode = node.jjtGetChild(1);
/*  940 */     if ((toNode instanceof ASTParameter))
/*      */     {
/*  942 */       ASTParameter toParam = (ASTParameter)toNode;
/*      */
/*  945 */       Class parameterType = getParameterType(toParam.number);
/*  946 */       if (!fromCMPField.getFieldType().equals(parameterType))
/*      */       {
/*  948 */         throw new IllegalStateException("Only like types can be compared: from CMP field=" + fromCMPField.getFieldType() + " to parameter=" + parameterType);
/*      */       }
/*      */
/*  954 */       this.inputParameters.addAll(QueryParameter.createParameters(toParam.number - 1, fromCMPField));
/*  955 */       SQLUtil.getWhereClause(fromCMPField.getJDBCType(), fromAlias, comparison, buf);
/*      */     }
/*      */     else
/*      */     {
/*  959 */       ASTPath toPath = (ASTPath)toNode;
/*  960 */       addInnerJoinPath(toPath);
/*  961 */       String toAlias = this.aliasManager.getAlias(toPath.getPath(toPath.size() - 2));
/*  962 */       JDBCCMPFieldBridge toCMPField = (JDBCCMPFieldBridge)toPath.getCMPField();
/*      */
/*  965 */       if (!fromCMPField.getFieldType().equals(toCMPField.getFieldType()))
/*      */       {
/*  967 */         throw new IllegalStateException("Only like types can be compared: from CMP field=" + fromCMPField.getFieldType() + " to CMP field=" + toCMPField.getFieldType());
/*      */       }
/*      */
/*  973 */       SQLUtil.getSelfCompareWhereClause(fromCMPField, toCMPField, fromAlias, toAlias, comparison, buf);
/*      */     }
/*      */
View Full Code Here

/* 1870 */       FieldBridge field = getCurrentSchema().getFieldByName(fieldName);
/* 1871 */       if (field == null) {
/* 1872 */         throwUnknownPath("Unknown terminal field", fieldName);
/*      */       }
/* 1874 */       if ((field instanceof CMPFieldBridge)) {
/* 1875 */         CMPFieldBridge cmpField = (CMPFieldBridge)field;
/* 1876 */         switch (EJBQLTypes.getEJBQLType(cmpField.getFieldType())) {
/*      */         case 1:
/* 1878 */           matchedToken.kind = 79;
/* 1879 */           break;
/*      */         case 2:
/* 1881 */           matchedToken.kind = 80;
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.bridge.CMPFieldBridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.