Package org.jboss.ejb.plugins.cmp.jdbc.metadata

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData


    * Type-mapping function translation
    */
   public Object visit(ASTMod node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.MOD);
      Object[] args = new Object[]{
         new NodeStringWrapper(node.jjtGetChild(0)),
         new NodeStringWrapper(node.jjtGetChild(1)),
      };
      function.getFunctionSql(args, buf);
      return buf;
   }
View Full Code Here


    * Type-mapping function translation
    */
   public Object visit(ASTSqrt node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.SQRT);
      Object[] args = new Object[]{
         new NodeStringWrapper(node.jjtGetChild(0))
      };
      function.getFunctionSql(args, buf);
      return buf;
   }
View Full Code Here

      // assemble sql
      StringBuffer sql = (StringBuffer) data;
      if(selectManager.getMetaData().hasRowLocking() && !(selectObject instanceof SelectFunction))
      {
         JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
         if(rowLockingTemplate == null)
         {
            throw new IllegalStateException("Row locking template is not defined for given mapping: " + typeMapping.getName());
         }

         boolean distinct = selectDistinct;

         Object args[] = new Object[]{
            distinct ? SQLUtil.DISTINCT + selectClause : selectClause.toString(),
            fromClause,
            whereClause == null || whereClause.length() == 0 ? null : whereClause,
            orderByClause == null || orderByClause.length() == 0 ? null : orderByClause
         };
         rowLockingTemplate.getFunctionSql(args, sql);
      }
      else
      {
         sql.append(SQLUtil.SELECT);
         if(selectDistinct)
View Full Code Here

   }

   public Object visit(ASTConcat node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.CONCAT);
      Object[] args = childrenToStringArr(2, node);
      function.getFunctionSql(args, buf);
      return data;
   }
View Full Code Here

   }

   public Object visit(ASTSubstring node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.SUBSTRING);
      Object[] args = childrenToStringArr(3, node);
      function.getFunctionSql(args, buf);
      return data;
   }
View Full Code Here

   }

   public Object visit(ASTUCase node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.UCASE);
      Object[] args = childrenToStringArr(1, node);
      function.getFunctionSql(args, buf);
      return data;
   }
View Full Code Here

   }

   public Object visit(ASTLCase node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.LCASE);
      Object[] args = childrenToStringArr(1, node);
      function.getFunctionSql(args, buf);
      return data;
   }
View Full Code Here

   }

   public Object visit(ASTLength node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.LENGTH);
      Object[] args = childrenToStringArr(1, node);
      function.getFunctionSql(args, buf);
      return data;
   }
View Full Code Here

   }

   public Object visit(ASTLocate node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.LOCATE);
      Object[] args = new Object[3];
      args[0] = node.jjtGetChild(0).jjtAccept(this, new StringBuffer()).toString();
      args[1] = node.jjtGetChild(1).jjtAccept(this, new StringBuffer()).toString();
      if(node.jjtGetNumChildren() == 3)
      {
         args[2] = node.jjtGetChild(2).jjtAccept(this, new StringBuffer()).toString();
      }
      else
      {
         args[2] = "1";
      }
      function.getFunctionSql(args, buf);
      return data;
   }
View Full Code Here

   }

   public Object visit(ASTAbs node, Object data)
   {
      StringBuffer buf = (StringBuffer) data;
      JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.ABS);
      Object[] args = childrenToStringArr(1, node);
      function.getFunctionSql(args, buf);
      return data;
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData

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.