Creates a new instance of an {@link AbstractQueryImpl} which is not
initialized.

@return an new query instance.
@throws RepositoryException
if an error occurs while creating a new query instance.
974350
protected AbstractQueryImpl createQueryInstance() throws RepositoryException
   {
      try
      {
         String queryImplClassName = handler.getQueryClass();
         Object obj = ClassLoading.forName(queryImplClassName, this).newInstance();
         if (obj instanceof AbstractQueryImpl)
         {
            return (AbstractQueryImpl)obj;
         }
         else
         {
            throw new IllegalArgumentException(queryImplClassName + " is not of type "
               + AbstractQueryImpl.class.getName());
         }
      }
      catch (Throwable t) //NOSONAR
      {
         throw new RepositoryException("Unable to create query: " + t.toString(), t);
      }
   }
1368071
@Override
    public Query prepareQuery(String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
        return prepareQuery(QueryLanguage.SPARQL, queryString, baseURI);
    }
582552
protected <O> CriteriaQuery<O> createCriteriaQuery(Class<O> clazz)
	{
		return getCriteriaBuilder().createQuery(clazz);
	}
1031241
@Override
	public void initialize() throws RepositoryException{
		initialized = true;
		try {

			queryEngine = configuration.loadQueryEngine();
			queryEngine.connect();
		}
		catch (Exception e){
			throw new RepositoryException(e);
		}
	}
1153011
protected RepositoryConfig createRepositoryConfiguration() throws ConfigurationException, IOException {

        final File jcrHome = getOuterRule().getRoot();
        final URL cfgUrl = this.getConfigUrl();
        assertNotNull("No Repository Configuration found", cfgUrl);

        return RepositoryConfig.create(cfgUrl.openStream(), jcrHome.getAbsolutePath());
    }
430290
@Override
    public <T> Query<T> createSqlQuery(Class<T> entityType, String sql) {
        Assert.notNull(entityType, "entityType must not null");
        Assert.hasText(sql, "sql must has text");
        RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
        return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
    }
592798
@Override
    public Query createNativeQuery(String sqlString, String resultSetMapping)
    {
        try
        {
            return ivEm.createNativeQuery(sqlString, resultSetMapping);
        } finally
        {
            if (!inJTATransaction())
            {
                ivEm.clear();
            }
        }
    }
730025
@Override
    public Query createNativeQuery(String sqlString, String resultSetMapping)
    {
        return ivEm.createNativeQuery(sqlString, resultSetMapping);
    }
198664
@Deprecated
    public static <T extends RepositoryBrowser>
    T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException {
        List<Descriptor<RepositoryBrowser<?>>> list = filter(type);
        String value = req.getParameter(fieldName);
        if(value==null || value.equals("auto"))
            return null;

        // TODO: There was a TODO in the original code, which presumes passing something meaningful to the newInstance() JSON param
        // Now we just pass empty JSON in order to make the code compliant with the defined interface
        final JSONObject emptyJSON = new JSONObject();
        return type.cast(list.get(Integer.parseInt(value)).newInstance(req, emptyJSON));
    }
121498
protected final <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
        return this.getEntityManager().createQuery(criteriaQuery);
    }
91019
public static Repository newInstance(String uid)
    {
        Repository repository = new Repository();
        repository.setUid(uid);
        return repository;
    }
236601
public NamedQuery<OrmDescriptor> getOrCreateNamedQuery()
   {
      List<Node> nodeList = model.get("named-query");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new NamedQueryImpl<OrmDescriptor>(this, "named-query", model, nodeList.get(0));
      }
      return createNamedQuery();
   }
48992
private Collection<String> createEnablesQuery() {
        Collection<String> query = null;
        Collection<String> requiredFeatures = getRequireFeature();
        if (requiredFeatures != null) {
            query = new ArrayList<String>();
            for (String required : requiredFeatures) {
                String temp = "wlpInformation.provideFeature=" + required;

                String version = findVersion();
                if (version != null) {
                    temp += "&wlpInformation.appliesToFilterInfo.minVersion.value=";
                    temp += version;
                }

                temp += "&type=";
                temp += getType().getValue(); // get the long name of the Type
                query.add(temp);
            }
        }
        return query;
    }
105016
private OntopConnection getOntopConnection() throws RepositoryException {
		if(!initialized)
			throw new RepositoryException("The OntopVirtualRepository must be initialized before getConnection can be run.");
		try {
			return queryEngine.getConnection();
		} catch (Exception e) {
			throw new RepositoryException(e);
		}

	}
1042003
@Override
    public QueryResult execute( String query,
                                String language ) throws RepositoryException {
        logger.trace("Executing query: {0}", query);

        // Create the query ...

        final Query jcrQuery = getLocalSession().getSession().getWorkspace().getQueryManager().createQuery(query, language);
        return jcrQuery.execute();
    }
716204
public RepositoryException toRepositoryException(Throwable e) {
        RepositoryException re = transformIntoRepositoryException(e);
        if (re != null) {
            return re;
        }

        Throwable cause = e.getCause();
        if (cause != null) {
            re = transformIntoRepositoryException(cause);
            if (re != null) {
                return re;
            }
        } else {
            cause = e;
        }

        return new RepositoryException(cause);
    }
964985
@Override
    public <T> Query<T> createQuery(Class<T> entityType) {
        Assert.notNull(entityType, "entityType must not null");
        return ebeanServer.find(entityType);
    }