/** * PUBLIC: * Use a CursoredStream as the result collection. * @param initialReadSize the initial number of objects to read * @param pageSize the number of objects to read when more objects * are needed from the database * @param sizeQuery a query that will return the size of the result set; * this must be set if an expression is not used (i.e. custom SQL) */ public void useCursoredStream(int initialReadSize, int pageSize, ValueReadQuery sizeQuery) { setContainerPolicy(new CursoredStreamPolicy(this, initialReadSize, pageSize, sizeQuery)); }
/** * INTERNAL: * Return the threshold for the stream. */ protected int getInitialReadSize() { return ((CursoredStreamPolicy)this.policy).getInitialReadSize(); }
/** * INTERNAL: * Return the page size for the stream. */ public int getPageSize() { return ((CursoredStreamPolicy)this.policy).getPageSize(); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
if (!((CursoredStreamPolicy)this.policy).hasSizeQuery()) { if (this.query.isCallQuery()) { throw QueryException.additionalSizeQueryNotSpecified(this.query); query.setSQLStatement(selectStatement); } else { query = ((CursoredStreamPolicy)this.policy).getSizeQuery();
/** * set the initial read size to match the page size */ public CursoredStreamPolicy(ReadQuery query, int pageSize) { super(query, pageSize); setInitialReadSize(pageSize); }
public CursoredStreamPolicy(ReadQuery query, int initialReadSize, int pageSize, ValueReadQuery sizeQuery) { this(query, initialReadSize, pageSize); setSizeQuery(sizeQuery); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
if (!((CursoredStreamPolicy)this.policy).hasSizeQuery()) { if (this.query.isCallQuery()) { throw QueryException.additionalSizeQueryNotSpecified(this.query); query.setSQLStatement(selectStatement); } else { query = ((CursoredStreamPolicy)this.policy).getSizeQuery();
/** * set the initial read size to match the page size */ public CursoredStreamPolicy(ReadQuery query, int pageSize) { super(query, pageSize); setInitialReadSize(pageSize); }
public CursoredStreamPolicy(ReadQuery query, int initialReadSize, int pageSize, ValueReadQuery sizeQuery) { this(query, initialReadSize, pageSize); setSizeQuery(sizeQuery); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object remoteExecute() { return ((DistributedSession)getQuery().getSession()).cursorSelectObjects(this); }
/** * PUBLIC: * Use a CursoredStream as the result collection. * @param initialReadSize the initial number of objects to read * @param pageSize the number of objects to read when more objects * are needed from the database */ public void useCursoredStream(int initialReadSize, int pageSize) { setContainerPolicy(new CursoredStreamPolicy(this, initialReadSize, pageSize)); }
if (!((CursoredStreamPolicy)getPolicy()).hasSizeQuery()) { if (getQuery().isCallQuery()) { throw QueryException.additionalSizeQueryNotSpecified(getQuery()); query.setSQLStatement(selectStatement); } else { query = ((CursoredStreamPolicy)getPolicy()).getSizeQuery();
/** * set the initial read size to match the page size */ public CursoredStreamPolicy(ReadQuery query, int pageSize) { super(query, pageSize); setInitialReadSize(pageSize); }
public CursoredStreamPolicy(ReadQuery query, int initialReadSize, int pageSize, ValueReadQuery sizeQuery) { this(query, initialReadSize, pageSize); setSizeQuery(sizeQuery); }
/** * INTERNAL: * Return the threshold for the stream. */ protected int getInitialReadSize() { return ((CursoredStreamPolicy)this.policy).getInitialReadSize(); }
/** * INTERNAL: * Return the page size for the stream. */ public int getPageSize() { return ((CursoredStreamPolicy)this.policy).getPageSize(); }
/** * INTERNAL: * Execute the cursored select and build the stream. */ public Object execute() { DatabaseCall call = getQuery().getQueryMechanism().cursorSelectAllRows(); // Create cursored stream CursoredStream stream = new CursoredStream(call, this); return stream; }
/** * PUBLIC: * Use a CursoredStream as the result collection. * @param initialReadSize the initial number of objects to read * @param pageSize the number of objects to read when more objects * are needed from the database * @param sizeQuery a query that will return the size of the result set; * this must be set if an expression is not used (i.e. custom SQL) */ public void useCursoredStream(int initialReadSize, int pageSize, ValueReadQuery sizeQuery) { setContainerPolicy(new CursoredStreamPolicy(this, initialReadSize, pageSize, sizeQuery)); }