Package org.jboss.as.cmp.bridge

Examples of org.jboss.as.cmp.bridge.CMPFieldBridge


      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


      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

     * @return true  if the path is already in the SELECT clause.
     */
    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) {
            JDBCEntityBridge entity = (JDBCEntityBridge) selectObject;
            JDBCFieldBridge[] pkFields = entity.getPrimaryKeyFields();
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

     * @return true  if the path is already in the SELECT clause.
     */
    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) {
            JDBCEntityBridge entity = (JDBCEntityBridge) selectObject;
            JDBCFieldBridge[] pkFields = entity.getPrimaryKeyFields();
View Full Code Here

     * @return true  if the path is already in the SELECT clause.
     */
    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) {
            JDBCEntityBridge entity = (JDBCEntityBridge) selectObject;
            JDBCFieldBridge[] pkFields = entity.getPrimaryKeyFields();
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 CmpMessages.MESSAGES.onlyLikeTypesCanBeCompared(fromCMPField.getFieldType().getName(), parameterType.getName());
            }

            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 CmpMessages.MESSAGES.onlyLikeTypesCanBeCompared(fromCMPField.getFieldType().getName(), toCMPField.getFieldType().getName());
            }

            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

TOP

Related Classes of org.jboss.as.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.