��ȡ�Ƿ�ҳ��ݼ�¼
@param bizId ҵ��id
@param tableName �����
@param bizCol ҵ�������
@return
@throws Exception
497061
private List getInfoListAllServiceInnerEx(Map requestParamMap,String tableName,Map sortMap,String cusWhere,String cusSelect,String modelName,int limit,List cusPlaceList) throws Exception{
		String tempKeyId=calcuIdKey();

		String sort=(String) sortMap.get("sort");
		String order=(String) sortMap.get("order");
		String cusSort=(String) sortMap.get("cusSort");
		
		if(modelName==null || "".equals(modelName)){
			modelName=tableName;
		}
		
		//add 201807 ning
		//Map requestParamMap=changeCase4Param(requestParamMap0);		
		
		String id=(String) requestParamMap.get(tempKeyId);

		String where="";
		
		if(cusWhere !=null && !"".equals(cusWhere)){
			where="where "+cusWhere;
		}
		
		if(modelName==null || "".equals(modelName)){
			modelName=tableName;
		}
		
		String whereCols="";		
	
		
		Map whereColsMap=requestParamMap;
		if(whereColsMap!=null && !whereColsMap.isEmpty()){
			StringBuilder sb=new StringBuilder("");
			Set<String> keySet=whereColsMap.keySet();
			int i=0;
			for(String key:keySet){
				if(!key.contains(".")){
					continue;
				}
				if(key.contains("dbcol_")){
					continue;
				}
				String colName=key;
				String realColName=colName.replace(".", CheckModelTypeUtil.DUMMY_SPLIT);
				String colsStr=colName+" as "+realColName;
				if(i==0){
					sb.append(colsStr);	
				}else{
					sb.append(",").append(colsStr);
				}
				i++;
			}
			whereCols=sb.toString();
		}		
		
		Map modelEntryMap=getModelEntryMap(requestParamMap,tableName,modelName,dbName,whereCols);
		List placeList=new ArrayList();
		String whereInStr=createWhereInStr(requestParamMap,modelEntryMap,placeList);
		if(cusPlaceList==null){
			cusPlaceList=new ArrayList();
		}
		List realPlaceList=new ArrayList();
		realPlaceList.addAll(placeList);
		realPlaceList.addAll(cusPlaceList);
		if(whereInStr!=null && !"".equals(whereInStr)){
			if(!where.equals("")){
				where=where+" and "+whereInStr;
			}else{
				where="where "+whereInStr;
			}
		}
	
		String select="";
		if(cusSelect!=null && !"".equals(cusSelect)){
			select="select "+cusSelect+" from "+tableName+" "+where;
		}else{
			select="select * from "+tableName+" "+where;
		}
		//String orderSql="order by ";
		String orderSql="";
		if(cusSort!=null && !"".equals(cusSort)){
			orderSql="order by "+cusSort;
		}else if(sort!=null && !sort.equals("")){
			orderSql="order by "+sort+" "+order;
		}
/*		String orderSql="";
		if(sort!=null && !sort.equals("")){
			orderSql="order by "+sort+" "+order;
		}*/
/*		else{
			orderSql=orderSql+"id desc";
		}*/
		List infoList=null;
		String sql=select+" "+orderSql;
		if(limit>=0){

			infoList=getInnerDao().queryLimitObjJoinByCondition(sql,realPlaceList.toArray(),limit);
		}else{
			infoList=getInnerDao().queryObjJoinByCondition(sql,realPlaceList.toArray());			
		}

		

		if(infoList==null){
			return null;
		}
		CheckModelTypeUtil.addMetaCols(infoList);
		//CheckModelTypeUtil.changeDateCols(infoList);
		CheckModelTypeUtil.changeNoStrCols(infoList);
		return infoList;
	}
687194
public void open() throws DBException
    {
        super.open();
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
            {
                table.open();
            }
        }
    }
685195
@Deprecated
  public void addColumn(String tableName, HColumnDescriptor column) throws IOException {
    addColumn(TableName.valueOf(tableName), column);
  }
788708
protected void initializeBatch(String databaseName, String table)
      throws SQLException {
    this.insertStmtPrefix = createInsertStatementStr(databaseName, table);
    this.insertPstmtForFixedBatch =
        this.conn.prepareStatement(createPrepareStatementStr(this.batchSize));
    LOG.info(String.format("Initialized for %s insert " + this, (this.batchSize > 1) ? "batch" : ""));
  }
248517
@Override
    public java.util.concurrent.Future<DeleteTableResult> deleteTableAsync(String tableName) {

        return deleteTableAsync(new DeleteTableRequest().withTableName(tableName));
    }
86830
public static void main(String[] args) throws Exception {
        if (args.length == 6) {
            DriverShim.loadAndRegister(new File(args[0]), args[1]);
            Connection conn =
                    DriverManager.getConnection(args[2], args[3], args[4]);
            String tbl = args[5];
            PreparedStatement st = conn.prepareStatement("SELECT COUNT(*) FROM ?");
            st.setString(1, tbl);
            ResultSet rs = st.executeQuery();
            rs.next();
            System.out.println("The " + tbl + " table has " + rs.getInt(1)
                    + " rows.");
            rs.close();
            st.close();
            conn.close();
        } else {
            System.out.println("Usage: java -cp . DriverShim someDriver.jar"
                    + " org.SomeDriver jdbcURL name pwd tbl");
            System.exit(1);
        }
    }
1358804
@Deprecated
  public void deleteColumn(String tableName, byte[] columnName) throws IOException {
    deleteColumn(TableName.valueOf(tableName), columnName);
  }
400275
@Override
    public <E> List<E> getColumnsById(String schemaName, String tableName, String pKeyColumnName, String columnName,
        Object pKeyColumnValue, Class columnJavaType) {
        // select columnName from tableName where pKeyColumnName =
        // pKeyColumnValue
        List results = new ArrayList();
        CQLTranslator translator = new CQLTranslator();
        String selectQuery = translator.SELECT_QUERY;
        selectQuery = StringUtils.replace(selectQuery, CQLTranslator.COLUMN_FAMILY,
            translator.ensureCase(new StringBuilder(), tableName, false).toString());
        selectQuery = StringUtils.replace(selectQuery, CQLTranslator.COLUMNS,
            translator.ensureCase(new StringBuilder(), columnName, false).toString());

        StringBuilder selectQueryBuilder = new StringBuilder(selectQuery);

        selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);

        translator.buildWhereClause(selectQueryBuilder, columnJavaType, pKeyColumnName, pKeyColumnValue,
            CQLTranslator.EQ_CLAUSE, false);
        selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),
            selectQueryBuilder.length());

        ResultSet rSet = execute(selectQueryBuilder.toString(), null);

        Iterator<Row> rowIter = rSet.iterator();
        while (rowIter.hasNext()) {
            Row row = rowIter.next();
            DataType dataType = row.getColumnDefinitions().getType(columnName);
            Object columnValue =
                DSClientUtilities.assign(row, null, null, dataType.getName(), null, columnName, null, null);
            results.add(columnValue);
        }
        return results;
    }
543369
@Override
    public <E> List<E> getColumnsById(String schemaName, String tableName, String pKeyColumnName, String columnName,
            Object pKeyColumnValue, Class columnJavaType)
    {
        // search using index on pkey column
        List<E> foreignKeys = new ArrayList<E>();

        Table schemaTable = tableAPI.getTable(tableName);
        Index index = schemaTable.getIndex(pKeyColumnName);
        IndexKey indexKey = index.createIndexKey();

        // StringBuilder indexNamebuilder = new StringBuilder();
        NoSqlDBUtils.add(schemaTable.getField(pKeyColumnName), indexKey, pKeyColumnValue, pKeyColumnName);
        KunderaCoreUtils.printQuery(
                "Get columns by id from:" + tableName + " for column:" + columnName + " where value:" + pKeyColumnValue,
                showQuery);
        Iterator<Row> rowsIter = tableAPI.tableIterator(indexKey, null, null);

        while (rowsIter.hasNext())
        {
            Row row = rowsIter.next();
            FieldDef fieldMetadata = schemaTable.getField(columnName);
            FieldValue value = row.get(columnName);
            foreignKeys.add((E) NoSqlDBUtils.get(fieldMetadata, value, null));
        }

        return foreignKeys;

    }
295191
@Override
    protected void create(List<TableInfo> tableInfos)
    {
        List dbList = r.dbList().run(connection);
        
        if(!dbList.contains(databaseName)){
            r.dbCreate(databaseName).run(connection);
        }
        
        List listTables = r.db(databaseName).tableList().run(connection);

        for (TableInfo tableInfo : tableInfos)
        {
            try
            {
                if (listTables.contains(tableInfo.getTableName()))
                {
                    r.db(databaseName).tableDrop(tableInfo.getTableName()).run(connection);
                }
            }
            catch (Exception e)
            {
                logger.error("Cannot check table existence for table " + tableInfo.getTableName() + ". Caused By: " + e);
                throw new KunderaException("Cannot check table existence for table " + tableInfo.getTableName()
                        + ". Caused By: " + e);
            }
            r.db(databaseName).tableCreate(tableInfo.getTableName()).run(connection);
        }

    }
1089992
@Given("^I create a Cassandra index named '(.+?)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)'$")
    public void createBasicMapping(String index_name, String table, String column, String keyspace) throws Exception {
        String query = "CREATE INDEX " + index_name + " ON " + table + " (" + column + ");";
        commonspec.getCassandraClient().executeQuery(query);
    }
1140138
public function create()
        {
            $sql = $this->generateCreateSql();
            $query = new RawQuery($sql);
            try {
                $this->drop();
                return Statement::getPreparedStatement($query)->execute();
            } catch (\Exception $e) {
                throw new Exception('Error creating table ' . $this->getB2DBName() . ': ' . $e->getMessage(), $sql);
            }
        }
230186
public Blob open_blob( String db, String table, String column, long row, boolean rw ) throws jsqlite.Exception {
        synchronized (this) {
            Blob blob = new Blob();
            _open_blob(db, table, column, row, rw, blob);
            return blob;
        }
    }
979958
public static boolean createTableIfNotExists(final Connection conn, final String tableName, final String schema) {
        if (doesTableExist(conn, tableName)) {
            return false;
        }

        try {
            execute(conn, schema);

            return true;
        } catch (SQLException e) {
            return false;
        }
    }
906954
protected void createUserDataTable(CmsSetupDb dbCon) throws SQLException {

        System.out.println(new Exception().getStackTrace()[0].toString());
        String createStatement = readQuery(QUERY_CREATE_TABLE_USERDATA);
        dbCon.updateSqlStatement(createStatement, null, null);
    }
699303
public Map<String, Object> queryObjJoinByBizId(String tableName,Object bizId,String condition) {

		//String tableName=changeTableNameCase(otableName);
		String where="where "+condition+"=?";
		String limitStr="";
		String tempType=calcuDbType();
		if(tempType!=null && tempType.equals("mysql")){		
		//if(dbType!=null && dbType.equals("mysql")){
			limitStr="limit 1";
		}else{
			limitStr="and rownum=1";
		}		
		

		String select="select * from "+tableName+" "+where+" "+limitStr;
		String sql=select+" ";
		logger.debug(sql);
		Object[] paramArray=new Object[1];
		paramArray[0]=bizId;
		List infoList=queryObjJoinByCondition(sql,paramArray);
		//init by null
		Map retMap0=null;
		if(infoList!=null && infoList.size()>0){
			retMap0=(Map) infoList.get(0);
		}		
		//add 201807 ning
		//Map retMap=changeOutKeyCase(retMap0);	
		
		//add 201902 ning
		Map retMap=ignoreKeyCase(retMap0);
		
		return retMap;
	}
1144135
@Override
    public Object[] findIdsByColumn(String schemaName, String tableName, String pKeyName, String columnName,
            Object columnValue, Class entityClazz)
    {
        Object connection = null;

        try
        {
            connection = getConnection();
            String valueAsStr = PropertyAccessorHelper.getString(columnValue);

            Set<String> results = null;

            if (resource != null && resource.isActive())
            {
                Response response = ((Transaction) connection).zrangeByScore(getHashKey(tableName, valueAsStr),
                        getDouble(valueAsStr), getDouble(valueAsStr));
                // ((Transaction) connection).exec();
                ((RedisTransaction) resource).onExecute(((Transaction) connection));

                results = (Set<String>) response.get();
            }
            else
            {
                results = ((Jedis) connection).zrangeByScore(getHashKey(tableName, valueAsStr), getDouble(valueAsStr),
                        getDouble(valueAsStr));

            }

            List returnResults = new ArrayList();
            returnResults = fetchColumn(pKeyName, connection, returnResults, results);
            if (returnResults != null)
            {

                return returnResults.toArray(new Object[0]);
            }

        }
        finally
        {
            onCleanup(connection);
        }

        return null;
    }