Package net.sf.jasperreports.engine.query

Examples of net.sf.jasperreports.engine.query.JRQueryExecuterFactory


  {
    List bundles = ExtensionsEnvironment.getExtensionsRegistry().getExtensions(QueryExecuterFactoryBundle.class);
    for (Iterator it = bundles.iterator(); it.hasNext();)
    {
      QueryExecuterFactoryBundle bundle = (QueryExecuterFactoryBundle)it.next();
      JRQueryExecuterFactory factory = bundle.getQueryExecuterFactory(language);
      if (factory != null)
      {
        return factory;
      }
    }
View Full Code Here


  {
    try
    {
      if (oldLanguage != null)
      {
        JRQueryExecuterFactory queryExecuterFactory = JRQueryExecuterUtils.getQueryExecuterFactory(oldLanguage);
        Object[] builtinParameters = queryExecuterFactory.getBuiltinParameters();
        if (builtinParameters != null)
        {
          removeBuiltinParameters(builtinParameters);
        }
      }

      if (newLanguage != null)
      {
        JRQueryExecuterFactory queryExecuterFactory = JRQueryExecuterUtils.getQueryExecuterFactory(newLanguage);
        Object[] builtinParameters = queryExecuterFactory.getBuiltinParameters();
        if (builtinParameters != null)
        {
          addBuiltinParameters(builtinParameters);
          sortSystemParamsFirst();
        }
View Full Code Here

  {
    JRQuery query = dataset.getQuery();
    if (query != null)
    {
      String language = query.getLanguage();
      JRQueryExecuterFactory queryExecuterFactory = null;
      if (language == null || language.length() == 0)
      {
        addBrokenRule("Query language not set.", query);
      }
      else
      {
        try
        {
          queryExecuterFactory = JRQueryExecuterUtils.getQueryExecuterFactory(query.getLanguage());
        }
        catch (JRException e1)
        {
          addBrokenRule("Query executer factory for " + language + " cannot be created.", query);
        }
      }


      JRQueryChunk[] chunks = query.getChunks();
      if (chunks != null && chunks.length > 0)
      {
        Map parametersMap = dataset.getParametersMap();

        for(int j = 0; j < chunks.length; j++)
        {
          JRQueryChunk queryChunk = chunks[j];
          switch (queryChunk.getType())
          {
            case JRQueryChunk.TYPE_PARAMETER :
            {
              JRParameter parameter = (JRParameter)parametersMap.get(queryChunk.getText());
              if ( parameter == null )
              {
                addBrokenRule("Query parameter not found : " + queryChunk.getText(), query);
              }
              else if (queryExecuterFactory != null)
              {
                String parameterType = null;
                try
                {
                  parameterType = parameter.getValueClassName();
                }
                catch (JRRuntimeException e)
                {
                  // ignore, already added when the parameter got verified
                }
                if (parameterType != null && !queryExecuterFactory.supportsQueryParameterType(parameterType))
                {
                  addBrokenRule("Parameter type not supported in query : " + queryChunk.getText() + " class " + parameterType, query);
                }
              }
View Full Code Here

      if (log.isDebugEnabled())
      {
        log.debug("Fill " + filler.fillerId + ": Creating " + query.getLanguage() + " query executer");
      }
     
      JRQueryExecuterFactory queryExecuterFactory = JRQueryExecuterUtils.getQueryExecuterFactory(query.getLanguage());
      queryExecuter = queryExecuterFactory.createQueryExecuter(parent, parametersMap);
      filler.fillContext.setRunningQueryExecuter(queryExecuter);
     
      return queryExecuter.createDatasource();
    }
    finally
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.query.JRQueryExecuterFactory

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.