Get Resource Url for CreateDBValue
@param dbEntryQuery The database entry string to create.
@return   String Resource Url
497442
public static MozuUrl createDBValueUrl(String dbEntryQuery)
	{
		UrlFormatter formatter = new UrlFormatter("/api/platform/tenantdata/{dbEntryQuery}");
		formatter.formatUrl("dbEntryQuery", dbEntryQuery);
		return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
	}
20462
protected void writeDataSourceNameEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
        String name = execInfo.getDataSourceName();
        sb.append("\"name\":\"");
        sb.append(name == null ? "" : escapeSpecialCharacter(name));
        sb.append("\", ");
    }
437813
private static String getSourceNameParameter(WorkspaceEntry wsEntry) throws DBCleanException
   {
      try
      {
         return wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
      }
      catch (RepositoryConfigurationException e)
      {
         throw new DBCleanException(e);
      }
   }
843069
private String createQueryString() {
        QueryChunk[] chunks = query.getChunks();
		if ((chunks == null) || (chunks.length == 0)) {
			// no query chunks
			return "";
		}

		StringBuffer sb = new StringBuffer();
        QueryChunk chunk = null;
        int position = 1;
        for (int i = 0; i < chunks.length; i++) {
			chunk = chunks[i];
			//System.out.println("chunk = " + chunk);
			switch (chunk.getType()) {
				case QueryChunk.PARAMETER_TYPE: {
                    position++;
                    String paramName = chunk.getText();
					QueryParameter param = parameters.get(paramName);					
					if (QueryParameter.MULTIPLE_SELECTION.equals(param.getSelection())) {
						if (QueryUtil.isProcedureCall(query.getText())) {		
							sb.append("?");
						} else {
							Object[] paramValue = (Object[]) parameterValues.get(paramName);						
							sb.append('(');
							for (int j = 0; j < paramValue.length; j++) {
								if (j > 0) {
									sb.append(',');
								}
								sb.append('?');
							}
							sb.append(')');
						}
					} else {
						sb.append("?");
					}
					break;
				}
				case QueryChunk.TEXT_TYPE:
                    if (chunk.getText().contains("?")) {
                        outputParameterPosition = position;                        
                    }
                default: {
					sb.append(chunk.getText());
					break;
				}
			}
		}        
        return sb.toString();
	}
247325
public static SQLDialect getDialect(DataSource dataSource) {
		if (dataSource == null) {
			return SQLDialect.DEFAULT;
		}
		try {
			String url = JdbcUtils.extractDatabaseMetaData(dataSource, "getURL");
			SQLDialect sqlDialect = JDBCUtils.dialect(url);
			if (sqlDialect != null) {
				return sqlDialect;
			}
		}
		catch (MetaDataAccessException ex) {
			logger.warn("Unable to determine jdbc url from datasource", ex);
		}
		return SQLDialect.DEFAULT;
	}
753292
@Override
    public Map<String, DbColumnType> getQueryMetadata(Expression query) throws DatabaseEngineException {
        final String queryString = translate(query);
        logger.trace(queryString);
        return getQueryMetadata(queryString);
    }
807551
public java.lang.String getUrlQueryParameter() {
    java.lang.Object ref = urlQueryParameter_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      urlQueryParameter_ = s;
      return s;
    }
  }
944109
@Override
  public String buildQuery() {
    validateQuery();

    StringBuilder stringBuilder = new StringBuilder();
    if (!Strings.isNullOrEmpty(select)) {
      stringBuilder = stringBuilder.append(SELECT).append(" ").append(select).append(" ");
    }
    if (!Strings.isNullOrEmpty(from)) {
      stringBuilder = stringBuilder.append(FROM).append(" ").append(from).append(" ");
    }
    if (!Strings.isNullOrEmpty(where)) {
      stringBuilder = stringBuilder.append(WHERE).append(" ").append(where).append(" ");
    }
    if (!Strings.isNullOrEmpty(orderBy)) {
      stringBuilder = stringBuilder.append(ORDER_BY).append(" ").append(orderBy).append(" ");
    }
    if (limit != null) {
      stringBuilder = stringBuilder.append(LIMIT).append(" ").append(limit).append(" ");
    }
    if (offset != null) {
      stringBuilder = stringBuilder.append(OFFSET).append(" ").append(offset).append(" ");
    }
    return stringBuilder.toString().trim();
  }
476646
@Override
    public void mapResourceNameToCodeBaseEntry(String resourceName, ICodeBaseEntry codeBaseEntry) {
        codeBaseEntryMap.put(resourceName, codeBaseEntry);
    }
733066
public String determineUrl() {
		if (StringUtils.hasText(this.url)) {
			return this.url;
		}
		String databaseName = determineDatabaseName();
		String url = (databaseName != null)
				? this.embeddedDatabaseConnection.getUrl(databaseName) : null;
		if (!StringUtils.hasText(url)) {
			throw new DataSourceBeanCreationException(
					"Failed to determine suitable jdbc url", this,
					this.embeddedDatabaseConnection);
		}
		return url;
	}
1182563
public String getSQLDelete(boolean bUseCurrentValues)
    {
        String strRecordset = this.getBaseRecord().makeTableNames(false);

        KeyArea keyArea = this.getKeyArea(0); // Primary index
        boolean bIsQueryRecord = this.isQueryRecord();
        boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea.isNull(DBConstants.TEMP_KEY_AREA, false);
        String sFilter = "?";
        sFilter = keyArea.addSelectParams("=", DBConstants.TEMP_KEY_AREA, false, bIsQueryRecord, bUseCurrentKeyValues, null, true, false);    // Always add!?
        if (sFilter.length() > 0)
            sFilter = " WHERE " + sFilter;

        strRecordset = "DELETE FROM " + strRecordset + sFilter;

        return strRecordset;
    }
869843
@Override
    public String getPageSql(MappedStatement ms, BoundSql boundSql, Object parameterObject, RowBounds rowBounds, CacheKey pageKey) {
        String sql = boundSql.getSql();
        Page page = this.getLocalPage();
        String orderBy = page.getOrderBy();
        if (StringUtil.isNotEmpty(orderBy)) {
            pageKey.update(orderBy);
            sql = this.replaceSql.replace(sql);
            sql = OrderByParser.converToOrderBySql(sql, orderBy);
            sql = this.replaceSql.restore(sql);
        }

        return page.isOrderByOnly() ? sql : this.getPageSql(sql, page, pageKey);
    }
771628
public String getSQLQuery(boolean bUseCurrentValues, Vector<BaseField> vParamList)
    {
        String strRecordset = this.makeTableNames(false);
        String strFields = this.getSQLFields(DBConstants.SQL_SELECT_TYPE, bUseCurrentValues);
        boolean bIsQueryRecord = this.isQueryRecord();
        String strSortParams = this.addSortParams(bIsQueryRecord, true);

        this.handleInitialKey();        // Set up the smaller key
        String strStartRange = this.addSelectParams(">=", DBConstants.START_SELECT_KEY, true, bIsQueryRecord, bUseCurrentValues, vParamList, true, false);   // Add only if changed
        this.handleEndKey();            // Set up the larger key
        String strEndRange = this.addSelectParams("<=", DBConstants.END_SELECT_KEY, true, bIsQueryRecord, bUseCurrentValues, vParamList, true, false);   // Add only if changed
        String strWhere = DBConstants.BLANK;
        if (strStartRange.length() == 0)
            strWhere = strEndRange;
        else
        {
            if (strEndRange.length() == 0)
                strWhere = strStartRange;
            else
                strWhere = strStartRange + " AND " + strEndRange;
        }
        //      Next, get the recordset filter
            StringBuffer strbFilter = new StringBuffer();
            this.handleRemoteCriteria(strbFilter, bIsQueryRecord, vParamList);  // Add any selection criteria (from behaviors)
            if (strbFilter.length() > 0)
            {
                if (strWhere.length() == 0)
                    strWhere = strbFilter.toString();
                else
                    strWhere += " AND (" + strbFilter.toString() + ")";
            }

        if (strWhere.length() > 0)
            strWhere = " WHERE " + strWhere;
        strRecordset = "SELECT" + strFields + " FROM " + strRecordset + strWhere + strSortParams;
        return strRecordset;
    }
279134
@Override
    public ICodeBaseEntry lookupResource(String resourceName) {
        // Translate resource name, in case a resource name
        // has been overridden and the resource is being accessed
        // using the overridden name.
        resourceName = translateResourceName(resourceName);

        File file = getFullPathOfResource(resourceName);
        if (!file.exists()) {
            return null;
        }
        return new DirectoryCodeBaseEntry(this, resourceName);
    }
1288562
public Map getModelEntryMap(Map requestParamMap,String tableName,String modelName,String dbName) throws Exception{
		return getModelEntryMap( requestParamMap, tableName, modelName, dbName,"");
	}
374993
private static String initCreateEntityQuery(EntityKeyMetadata entityKeyMetadata) {
		StringBuilder queryBuilder = new StringBuilder( "CREATE " );
		appendEntityNode( ENTITY_ALIAS, entityKeyMetadata, queryBuilder );
		queryBuilder.append( " RETURN " );
		queryBuilder.append( ENTITY_ALIAS );
		return queryBuilder.toString();
	}
1374494
protected String getQueryUrl(String hostOrKey, String index, String type, String id, Object query) {
        return getElasticSearchUrl(hostOrKey) + formatQueryUrl(index, type, id, query);
    }