本文整理了Java中org.apache.openjpa.kernel.QueryContext.getFetchConfiguration
方法的一些代码示例,展示了QueryContext.getFetchConfiguration
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryContext.getFetchConfiguration
方法的具体详情如下:
包路径:org.apache.openjpa.kernel.QueryContext
类名称:QueryContext
方法名:getFetchConfiguration
[英]Return the fetch configuration for this query.
[中]返回此查询的获取配置。
代码示例来源:origin: org.apache.openjpa/openjpa-all
public Object newCompilationKey() {
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration) ctx
.getFetchConfiguration();
return fetch.getJoinSyntax();
}
代码示例来源:origin: org.apache.openjpa/openjpa-jdbc
public Object newCompilationKey() {
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration) ctx
.getFetchConfiguration();
return fetch.getJoinSyntax();
}
代码示例来源:origin: org.apache.openejb.patch/openjpa-jdbc
public Object newCompilationKey() {
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration) ctx
.getFetchConfiguration();
return fetch.getJoinSyntax();
}
代码示例来源:origin: org.apache.openejb.patch/openjpa
public Object newCompilationKey() {
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration) ctx
.getFetchConfiguration();
return fetch.getJoinSyntax();
}
代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa
public Object newCompilationKey() {
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration) ctx
.getFetchConfiguration();
return Numbers.valueOf(fetch.getJoinSyntax());
}
代码示例来源:origin: org.apache.openjpa/openjpa-slice
List<SliceStoreManager> findTargets() {
FetchConfiguration fetch = owner.getContext()
.getFetchConfiguration();
return owner.getDistributedStore().getTargets(fetch);
}
代码示例来源:origin: org.apache.openejb.patch/openjpa-slice
List<SliceStoreManager> findTargets() {
FetchConfiguration fetch = owner.getContext().getFetchConfiguration();
return owner.getDistributedStore().getTargets(fetch);
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
List<SliceStoreManager> findTargets() {
FetchConfiguration fetch = owner.getContext().getFetchConfiguration();
return owner.getDistributedStore().getTargets(fetch);
}
代码示例来源:origin: org.apache.openejb.patch/openjpa
public Executor newDataStoreExecutor(ClassMetaData meta, boolean subs) {
Executor ex = _query.newDataStoreExecutor(meta, subs);
return new QueryCacheExecutor(ex, meta, subs,
getContext().getFetchConfiguration());
}
代码示例来源:origin: org.apache.openejb.patch/openjpa-slice
List<SliceStoreManager> findTargets() {
FetchConfiguration fetch = owner.getContext()
.getFetchConfiguration();
return owner.getDistributedStore().getTargets(fetch);
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
List<SliceStoreManager> findTargets() {
FetchConfiguration fetch = owner.getContext()
.getFetchConfiguration();
return owner.getDistributedStore().getTargets(fetch);
}
代码示例来源:origin: org.apache.openjpa/openjpa-kernel
public Executor newDataStoreExecutor(ClassMetaData meta, boolean subs) {
Executor ex = _query.newDataStoreExecutor(meta, subs);
return new QueryCacheExecutor(ex, meta, subs,
getContext().getFetchConfiguration());
}
代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel
public Executor newDataStoreExecutor(ClassMetaData meta, boolean subs) {
Executor ex = _query.newDataStoreExecutor(meta, subs);
return new QueryCacheExecutor(ex, meta, subs,
getContext().getFetchConfiguration());
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
public Executor newDataStoreExecutor(ClassMetaData meta, boolean subs) {
Executor ex = _query.newDataStoreExecutor(meta, subs);
return new QueryCacheExecutor(ex, meta, subs,
getContext().getFetchConfiguration());
}
代码示例来源:origin: org.apache.openjpa/openjpa-slice
List<SliceStoreManager> findTargets() {
FetchConfiguration fetch = owner.getContext().getFetchConfiguration();
return owner.getDistributedStore().getTargets(fetch);
}
代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa
public Executor newDataStoreExecutor(ClassMetaData meta, boolean subs) {
ParallelExecutor ex = new ParallelExecutor(this, meta, subs, _parser,
ctx.getCompilation());
FetchConfiguration fetch = getContext().getFetchConfiguration();
DistributedStoreManager store = (DistributedStoreManager)getContext()
.getStoreContext().getStoreManager().getInnermostDelegate();
List<SliceStoreManager> targets = store.getTargets(fetch);
for (StoreQuery q:_queries) {
if (targets.contains(((JDBCStoreQuery)q).getStore()))
ex.addExecutor(q.newDataStoreExecutor(meta, subs));
}
return ex;
}
代码示例来源:origin: org.apache.openjpa/openjpa-jdbc
@Override
public ResultObjectProvider executeQuery(StoreQuery q, Object[] params, Range range) {
try {
DBDictionary dict = _store.getDBDictionary();
Connection conn = _store.getConnection();
CallableStatement stmnt = conn.prepareCall(_proc.getCallSQL());
final StoredProcedureQuery spq = StoredProcedureQuery.class.cast(q);
for (Column c : spq.getProcedure().getInColumns()) {
dict.setUnknown(stmnt, c.getIndex() + 1, params[c.getIndex()], c);
}
for (Column c : spq.getProcedure().getInOutColumns()) {
final int index = c.getIndex() + 1;
stmnt.registerOutParameter(index, c.getType());
dict.setUnknown(stmnt, index, params[index - 1], c);
}
for (Column c : spq.getProcedure().getOutColumns()) {
stmnt.registerOutParameter(c.getIndex() + 1, c.getType());
}
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration)q.getContext().getFetchConfiguration();
ResultObjectProvider rop = new XROP(_resultMappings, _resultClasses, _store, fetch, stmnt);
rop.open();
return rop;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
@Override
public ResultObjectProvider executeQuery(StoreQuery q, Object[] params, Range range) {
try {
DBDictionary dict = _store.getDBDictionary();
Connection conn = _store.getConnection();
CallableStatement stmnt = conn.prepareCall(_proc.getCallSQL());
final StoredProcedureQuery spq = StoredProcedureQuery.class.cast(q);
for (Column c : spq.getProcedure().getInColumns()) {
dict.setUnknown(stmnt, c.getIndex() + 1, params[c.getIndex()], c);
}
for (Column c : spq.getProcedure().getInOutColumns()) {
final int index = c.getIndex() + 1;
stmnt.registerOutParameter(index, c.getType());
dict.setUnknown(stmnt, index, params[index - 1], c);
}
for (Column c : spq.getProcedure().getOutColumns()) {
stmnt.registerOutParameter(c.getIndex() + 1, c.getType());
}
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration)q.getContext().getFetchConfiguration();
ResultObjectProvider rop = new XROP(_resultMappings, _resultClasses, _store, fetch, stmnt);
rop.open();
return rop;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
public ResultObjectProvider executeQuery(StoreQuery q,
Object[] params, StoreQuery.Range range) {
if (_executors.length == 1)
return _executors[0].executeQuery(q, params, range);
// use lrs settings if we couldn't take advantage of the start index
// so that hopefully the skip to the start will be efficient
StoreQuery.Range ropRange = new StoreQuery.Range(0, range.end);
ropRange.lrs = range.lrs || (range.start > 0 && q.getContext().
getFetchConfiguration().getFetchBatchSize() >= 0);
// execute the query; we cannot use the lower bound of the result
// range, but we can take advantage of the upper bound
ResultObjectProvider[] rops =
new ResultObjectProvider[_executors.length];
for (int i = 0; i < _executors.length; i++)
rops[i] = _executors[i].executeQuery(q, params, ropRange);
boolean[] asc = _executors[0].getAscending(q);
ResultObjectProvider rop;
if (asc.length == 0)
rop = new MergedResultObjectProvider(rops);
else
rop = new OrderingMergedResultObjectProvider(rops, asc,
_executors, q, params);
// if there is a lower bound, wrap in range rop
if (range.start != 0)
rop = new RangeResultObjectProvider(rop, range.start,
range.end);
return rop;
}
代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa
public ResultObjectProvider executeQuery(StoreQuery q,
Object[] params, StoreQuery.Range range) {
if (_executors.length == 1)
return _executors[0].executeQuery(q, params, range);
// use lrs settings if we couldn't take advantage of the start index
// so that hopefully the skip to the start will be efficient
StoreQuery.Range ropRange = new StoreQuery.Range(0, range.end);
ropRange.lrs = range.lrs || (range.start > 0 && q.getContext().
getFetchConfiguration().getFetchBatchSize() >= 0);
// execute the query; we cannot use the lower bound of the result
// range, but we can take advantage of the upper bound
ResultObjectProvider[] rops =
new ResultObjectProvider[_executors.length];
for (int i = 0; i < _executors.length; i++)
rops[i] = _executors[i].executeQuery(q, params, ropRange);
boolean[] asc = _executors[0].getAscending(q);
ResultObjectProvider rop;
if (asc.length == 0)
rop = new MergedResultObjectProvider(rops);
else
rop = new OrderingMergedResultObjectProvider(rops, asc,
_executors, q, params);
// if there is a lower bound, wrap in range rop
if (range.start != 0)
rop = new RangeResultObjectProvider(rop, range.start,
range.end);
return rop;
}
内容来源于网络,如有侵权,请联系作者删除!