Gets the JQL declared.

@return the JQL declared
188270
private String getJQLDeclared() {
		ModelAnnotation inserAnnotation = this.getAnnotation(BindSqlInsert.class);
		ModelAnnotation updateAnnotation = this.getAnnotation(BindSqlUpdate.class);
		ModelAnnotation selectAnnotation = this.getAnnotation(BindSqlSelect.class);
		ModelAnnotation deleteAnnotation = this.getAnnotation(BindSqlDelete.class);

		String jql = null;
		int counter = 0;

		if (selectAnnotation != null) {
			jql = selectAnnotation.getAttribute(AnnotationAttributeType.JQL);

			if (StringUtils.hasText(jql)) {
				counter++;

				AssertKripton.assertTrue(selectAnnotation.getAttributeCount() > 1, "Annotation %s in method %s.%s have more than one annotation with JQL attribute", selectAnnotation.getSimpleName(),
						this.getParent().getName(), this.getName());
			}
		}

		if (inserAnnotation != null) {
			jql = inserAnnotation.getAttribute(AnnotationAttributeType.JQL);
			if (StringUtils.hasText(jql)) {
				counter++;

				AssertKripton.assertTrue(inserAnnotation.getAttributeCount() > 1, "Annotation %s in method %s.%s have more than one annotation with JQL attribute", inserAnnotation.getSimpleName(),
						this.getParent().getName(), this.getName());
			}
		}

		if (updateAnnotation != null) {
			jql = updateAnnotation.getAttribute(AnnotationAttributeType.JQL);
			if (StringUtils.hasText(jql)) {
				counter++;

				AssertKripton.assertTrue(updateAnnotation.getAttributeCount() > 1, "Annotation %s in method %s.%s have more than one annotation with JQL attribute", updateAnnotation.getSimpleName(),
						this.getParent().getName(), this.getName());
			}
		}

		if (deleteAnnotation != null) {
			jql = deleteAnnotation.getAttribute(AnnotationAttributeType.JQL);
			if (StringUtils.hasText(jql)) {
				counter++;

				AssertKripton.assertTrue(deleteAnnotation.getAttributeCount() > 1, "Annotation %s in method %s.%s have more than one annotation with JQL attribute", deleteAnnotation.getSimpleName(),
						this.getParent().getName(), this.getName());
			}
		}

		AssertKripton.assertTrue(counter <= 1, "Method %s.%s have more than one annotation with JQL attribute", this.getParent().getName(), this.getName());

		// remove unscape charater (example \'%\' -> '%')
		jql = StringEscapeUtils.unescapeEcmaScript(jql);
		return jql;

	}
760600
public CmsSolrQuery getInitialQuery() {

        Map<String, String[]> queryParams = new HashMap<String, String[]>();
        if (!m_cms.getRequestContext().getCurrentProject().isOnlineProject() && m_config.isShowExpired()) {
            queryParams.put("fq", new String[] {"released:[* TO *]", "expired:[* TO *]"});
        }
        return new CmsSolrQuery(null, queryParams);
    }
1154907
public Object getReturn() {
        Object result = null;

        if (this.containsKey(QUERY_PARAMS_RETURN) == true) {
            result = this.getValue(QUERY_PARAMS_RETURN);
        }

        return result;
    }
648920
public InstanceQuery getQuery()
    {
        if (this.query == null) {
            try {
                this.query = new InstanceQuery(this.typeUUID)
                                .setIncludeChildTypes(isIncludeChildTypes())
                                .setCompanyDependent(isCompanyDependent());
                prepareQuery();
            } catch (final EFapsException e) {
                QueryBuilder.LOG.error("Could not open InstanceQuery for uuid: {}", this.typeUUID);
            }
        }
        return (InstanceQuery) this.query;
    }
867437
public HsqlName getSubqueryTableName() {

        HsqlName hsqlName = new HsqlName(this, SqlInvariants.SYSTEM_SUBQUERY,
                                         false, SchemaObject.TABLE);

        hsqlName.schema = SqlInvariants.SYSTEM_SCHEMA_HSQLNAME;

        return hsqlName;
    }
1082343
private Connection getConn() {
        Connection connection = localConnection.get();
        return ifNotNullReturn(connection, connection, this.getSql2o().open());
    }
1046260
public String getSQLState()
    {
        String state = null;
        try {
            state = new String(m_sqlState, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        return state;
    }
358918
public function getSql()
    {
        if ($this->builtSql === null) {
            $this->builtSql = $this->buildSql();
        }

        return $this->builtSql;
    }
281629
public Statement toStatement() {
    Statement statement = new Statement();
    statement.setQuery(queryBuilder.buildQuery());
    statement.getValues().addAll(
        Maps.toList(queryBuilder.getBindVariableMap(), StringValueMapEntry.class));
    return statement;
  }
265744
public Query<Object> build() {
    QueryBean<Object> queryBean = new QueryBean<Object>();
    queryBean.setStatement(toQueryString());
    queryBean.setParams(CollectUtils.newHashMap(getParams()));
    if (null != limit) {
      queryBean.setLimit(new PageLimit(limit.getPageIndex(), limit.getPageSize()));
    }
    queryBean.setCountStatement(toCountString());
    queryBean.setCacheable(cacheable);
    queryBean.setLang(getLang());
    return queryBean;
  }
1263838
private String getSubQuerySQL(Query subQuery)
    {
        ClassDescriptor cld = getRoot().cld.getRepository().getDescriptorFor(subQuery.getSearchClass());
        String sql;

        if (subQuery instanceof QueryBySQL)
        {
            sql = ((QueryBySQL) subQuery).getSql();
        }
        else
        {
            sql = new SqlSelectStatement(this, m_platform, cld, subQuery, m_logger).getStatement();
        }

        return sql;
    }
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();
  }
545328
protected function getCurrentSQL() {
        $cloneQuery = clone $this->query;
        $cloneQuery = $this->loadElements($cloneQuery);
        return $cloneQuery->compile();
    }
693886
public String getDefaultSQL() {

        String ddl = null;

        ddl = defaultExpression == null ? null
                                        : defaultExpression.getSQL();

        return ddl;
    }
1253045
public String buildSQL() {
        mTables = new Hashtable();
        mColumns = new Vector();

        String key = null;
        for (Enumeration keys = mPropertiesMap.keys(); keys.hasMoreElements();) {
            key = (String) keys.nextElement();
    
            // Get columns to select
            String column = (String) mPropertiesMap.get(key);
            mColumns.addElement(column);
    
            tableJoins(column, false);
        }

        // All data read, build SQL query string
        return buildSelectClause() + buildFromClause() 
            + buildWhereClause(); 
    }
1018921
public function getSql()
    {
        $table = $this->table;

        if ($this->hasTable($table)) {
            $this->isChange = true;
        }

        $columnSql = $this->getCreateDefinition();

        if ($this->isChange) {
            $sql = "ALTER TABLE $table" . $columnSql;
        } else {
            $sql = "CREATE TABLE $table ($columnSql)";
            $sql .= $this->getTableOptionSql();
        }

        return $sql;
    }
41853
protected final int getMeq(){
		if(meq < 0){
			meq = (this.request.getA()==null)? 0 : this.request.getA().rows();
		}
		return meq;
	}