/** * Gets the kernel delegate that is handles actual execution on behalf of this receiver. * * @return */ public org.apache.openjpa.kernel.Query getExecutableQuery() { return _delegate.getDelegate(); }
/** * Gets the kernel delegate that is handles actual execution on behalf of this receiver. * * @return */ public org.apache.openjpa.kernel.Query getExecutableQuery() { return _delegate.getDelegate(); }
/** * Return a cache key for the given query. */ private QueryKey toQueryKey(Query q) { QueryImpl impl = (QueryImpl) q; if (impl.hasPositionalParameters()) return QueryKey.newInstance(impl.getDelegate(), impl.getPositionalParameters()); return QueryKey.newInstance(impl.getDelegate(), impl.getNamedParameters()); }
/** * Return a cache key for the given query. */ private QueryKey toQueryKey(Query q) { QueryImpl impl = (QueryImpl) q; if (impl.hasPositionalParameters()) return QueryKey.newInstance(impl.getDelegate(), impl.getPositionalParameters()); return QueryKey.newInstance(impl.getDelegate(), impl.getNamedParameters()); }
/** * Return a cache key for the given query. */ private QueryKey toQueryKey(Query q) { QueryImpl impl = (QueryImpl) q; if (impl.hasPositionalParameters()) return QueryKey.newInstance(impl.getDelegate(), impl.getPositionalParameters()); return QueryKey.newInstance(impl.getDelegate(), impl.getNamedParameters()); }
/** * Return a cache key for the given query. */ private QueryKey toQueryKey(Query q) { QueryImpl impl = (QueryImpl) q; if (impl.hasPositionalParameters()) return QueryKey.newInstance(impl.getDelegate(), impl.getPositionalParameters()); return QueryKey.newInstance(impl.getDelegate(), impl.getNamedParameters()); }
/** * Return a cache key for the given query. */ private QueryKey toQueryKey(Query q) { QueryImpl impl = (QueryImpl) q; if (impl.hasPositionalParameters()) return QueryKey.newInstance(impl.getDelegate(), impl.getPositionalParameters()); return QueryKey.newInstance(impl.getDelegate(), impl.getNamedParameters()); }
public OpenJPAQuery createQuery(Query query) { if (query == null) return createQuery((String) null); assertNotCloseInvoked(); org.apache.openjpa.kernel.Query q = ((QueryImpl) query).getDelegate(); return new QueryImpl(this, ret, _broker.newQuery(q.getLanguage(), q)); }
public OpenJPAQuery createQuery(Query query) { if (query == null) return createQuery((String) null); assertNotCloseInvoked(); org.apache.openjpa.kernel.Query q = ((QueryImpl) query).getDelegate(); return newQueryImpl(_broker.newQuery(q.getLanguage(), q), null); }
@Override public void addNamedQuery(String name, Query query) { org.apache.openjpa.kernel.Query kernelQuery = ((QueryImpl<?>)query).getDelegate(); MetaDataRepository metaDataRepositoryInstance = _factory.getConfiguration().getMetaDataRepositoryInstance(); QueryMetaData metaData = metaDataRepositoryInstance.newQueryMetaData(null, null); metaData.setFrom(kernelQuery); metaDataRepositoryInstance.addQueryMetaData(metaData); }
@Override public void addNamedQuery(String name, Query query) { org.apache.openjpa.kernel.Query kernelQuery = ((QueryImpl<?>)query).getDelegate(); MetaDataRepository metaDataRepositoryInstance = _factory.getConfiguration().getMetaDataRepositoryInstance(); QueryMetaData metaData = metaDataRepositoryInstance.newQueryMetaData(null, null); metaData.setFrom(kernelQuery); metaDataRepositoryInstance.addQueryMetaData(metaData); }
public OpenJPAQuery createQuery(Query query) { if (query == null) return createQuery((String) null); assertNotCloseInvoked(); org.apache.openjpa.kernel.Query q = ((QueryImpl) query).getDelegate(); return newQueryImpl(_broker.newQuery(q.getLanguage(), q), null); }
public OpenJPAQuery createQuery(Query query) { if (query == null) return createQuery((String) null); assertNotCloseInvoked(); org.apache.openjpa.kernel.Query q = ((QueryImpl) query).getDelegate(); return newQueryImpl(_broker.newQuery(q.getLanguage(), q), null); }
public OpenJPAQuery createQuery(Query query) { if (query == null) return createQuery((String) null); assertNotCloseInvoked(); org.apache.openjpa.kernel.Query q = ((QueryImpl) query).getDelegate(); return newQueryImpl(_broker.newQuery(q.getLanguage(), q), null); }
/** * Record a key-value pair only only if the given key is supported. * * @return FALSE if the key is unrecognized. * null (i.e. MAY BE) if the key is recognized, but not supported. * TRUE if the key is supported. */ protected Boolean record(String hint, Object value) { if (hint == null) return Boolean.FALSE; if (_supportedHints.contains(hint)) { if (_hints == null) _hints = new TreeMap<String, Object>(); _hints.put(hint, value); return Boolean.TRUE; } if (isKnownPrefix(hint)) { Log log = owner.getDelegate().getBroker().getConfiguration().getLog(OpenJPAConfiguration.LOG_RUNTIME); String possible = StringDistance.getClosestLevenshteinDistance(hint, getSupportedHints()); if (log.isWarnEnabled()) log.warn(_loc.get("bad-query-hint", hint, possible)); return null; // possible but not registered } return Boolean.FALSE; // not possible }
/** * Record a key-value pair only only if the given key is supported. * * @return FALSE if the key is unrecognized. * null (i.e. MAY BE) if the key is recognized, but not supported. * TRUE if the key is supported. */ protected Boolean record(String hint, Object value) { if (hint == null) return Boolean.FALSE; if (_supportedHints.contains(hint)) { if (_hints == null) _hints = new TreeMap<String, Object>(); _hints.put(hint, value); return Boolean.TRUE; } if (isKnownPrefix(hint)) { Log log = owner.getDelegate().getBroker().getConfiguration().getLog(OpenJPAConfiguration.LOG_RUNTIME); String possible = StringDistance.getClosestLevenshteinDistance(hint, getSupportedHints()); if (log.isWarnEnabled()) log.warn(_loc.get("bad-query-hint", hint, possible)); return null; // possible but not registered } return Boolean.FALSE; // not possible }
/** * Record a key-value pair only only if the given key is supported. * * @return FALSE if the key is unrecognized. * null (i.e. MAY BE) if the key is recognized, but not supported. * TRUE if the key is supported. */ protected Boolean record(String hint, Object value) { if (hint == null) return Boolean.FALSE; if (_supportedHints.contains(hint)) { if (_hints == null) _hints = new TreeMap<String, Object>(); _hints.put(hint, value); return Boolean.TRUE; } if (isKnownPrefix(hint)) { Log log = owner.getDelegate().getBroker().getConfiguration().getLog(OpenJPAConfiguration.LOG_RUNTIME); String possible = StringDistance.getClosestLevenshteinDistance(hint, getSupportedHints()); if (log.isWarnEnabled()) log.warn(_loc.get("bad-query-hint", hint, possible)); return null; // possible but not registered } return Boolean.FALSE; // not possible }
/** * Record a key-value pair only only if the given key is supported. * * @return FALSE if the key is unrecognized. * null (i.e. MAY BE) if the key is recognized, but not supported. * TRUE if the key is supported. */ protected Boolean record(String hint, Object value) { if (hint == null) return Boolean.FALSE; if (_supportedHints.contains(hint)) { if (_hints == null) _hints = new TreeMap<String, Object>(); _hints.put(hint, value); return Boolean.TRUE; } if (isKnownPrefix(hint)) { Log log = owner.getDelegate().getBroker().getConfiguration().getLog(OpenJPAConfiguration.LOG_RUNTIME); String possible = StringDistance.getClosestLevenshteinDistance(hint, getSupportedHints()); if (log.isWarnEnabled()) log.warn(_loc.get("bad-query-hint", hint, possible)); return null; // possible but not registered } return Boolean.FALSE; // not possible }
ClassLoader loader = owner.getDelegate().getBroker().getClassLoader(); if (QueryHints.HINT_SUBCLASSES.equals(key)) { if (value instanceof String)
ClassLoader loader = owner.getDelegate().getBroker().getClassLoader(); if (QueryHints.HINT_SUBCLASSES.equals(key)) { if (value instanceof String)