this.query = delegate;
this.cacheKey = cacheKey;
}
public QueryMetadata getMetaData(EntityResolver resolver) {
final QueryMetadata metadata = query.getMetaData(resolver);
// the way paginated queries work on the server is that they are never cached
// (IncrementalFaultList interception happens before cache interception). So
// overriding caching settings in the metadata will only affect
// ClientServerChannel behavior
return new QueryMetadata() {
public String getCacheKey() {
return cacheKey;
}
public SQLResultSetMapping getResultSetMapping() {
return metadata.getResultSetMapping();
}
public String[] getCacheGroups() {
return metadata.getCacheGroups();
}
public String getCachePolicy() {
return metadata.getCachePolicy();
}
public DataMap getDataMap() {
return metadata.getDataMap();
}
public DbEntity getDbEntity() {
return metadata.getDbEntity();
}
public int getFetchLimit() {
return metadata.getFetchLimit();
}
public int getFetchStartIndex() {
return metadata.getFetchStartIndex();
}
public ObjEntity getObjEntity() {
return metadata.getObjEntity();
}
public ClassDescriptor getClassDescriptor() {
return metadata.getClassDescriptor();
}
public int getPageSize() {
return metadata.getPageSize();
}
public PrefetchTreeNode getPrefetchTree() {
return metadata.getPrefetchTree();
}
public Procedure getProcedure() {
return metadata.getProcedure();
}
public boolean isFetchingDataRows() {
return metadata.isFetchingDataRows();
}
public boolean isRefreshingObjects() {
return metadata.isRefreshingObjects();
}
public boolean isResolvingInherited() {
return metadata.isResolvingInherited();
}
};
}