/** * PUBLIC: * Return a new read all query. * A reference class must be specified before execution. * It is better to provide the class and expression builder on construction to ensure a single expression builder is used. * If no selection criteria is specified this will read all objects of the class from the database. */ public ReadAllQuery() { super(); setContainerPolicy(ContainerPolicy.buildDefaultPolicy()); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface. * <p>jdk1.1.x: The container class must be a subclass of Vector. */ public void useCollectionClass(Class concreteClass) { // Set container policy. setContainerPolicy(ContainerPolicy.buildPolicyFor(concreteClass)); }
/** * ADVANCED: * Configure the mapping to use a container policy. * The policy manages the access to the collection. */ public void setContainerPolicy(ContainerPolicy containerPolicy) { this.containerPolicy = containerPolicy; ((ReadAllQuery)getSelectionQuery()).setContainerPolicy(containerPolicy); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface. * <p>jdk1.1.x: The container class must be a subclass of Vector. */ public void useCollectionClass(Class concreteClass) { // Set container policy. setContainerPolicy(ContainerPolicy.buildPolicyFor(concreteClass)); }
/** * PUBLIC: * Use a ScrollableCursor as the result collection. * @param pageSize the number of elements to be read into a the cursor * when more elements are needed from the database. */ public void useScrollableCursor(int pageSize) { setContainerPolicy(new ScrollableCursorPolicy(this, pageSize)); }
/** * PUBLIC: * Use a ScrollableCursor as the result collection. * @param pageSize the number of elements to be read into a the cursor * when more elements are needed from the database. */ public void useScrollableCursor(int pageSize) { setContainerPolicy(new ScrollableCursorPolicy(this, pageSize)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * PUBLIC: * Return a new read all query. * A reference class must be specified before execution. * It is better to provide the class and expression builder on construction to ensure a single expression builder is used. * If no selection criteria is specified this will read all objects of the class from the database. */ public ReadAllQuery() { super(); setContainerPolicy(ContainerPolicy.buildDefaultPolicy()); }
/** * INTERNAL: * Set the container policy on the selection query for this mapping. This * method is overridden in DirectCollectionMapping since its selection * query is a DataReadQuery. */ protected void setSelectionQueryContainerPolicy(ContainerPolicy containerPolicy) { ((ReadAllQuery) getSelectionQuery()).setContainerPolicy(containerPolicy); }
/** * PUBLIC: * Return a new read all query. * A reference class must be specified before execution. * It is better to provide the class and expression builder on construction to ensure a single expression builder is used. * If no selection criteria is specified this will read all objects of the class from the database. */ public ReadAllQuery() { super(); setContainerPolicy(ContainerPolicy.buildDefaultPolicy()); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface. * <p>jdk1.1.x: The container class must be a subclass of Vector. */ public void useCollectionClass(Class concreteClass) { // Set container policy. setContainerPolicy(ContainerPolicy.buildPolicyFor(concreteClass)); }
/** * ADVANCED: * Configure the mapping to use a container policy. * The policy manages the access to the collection. */ public void setContainerPolicy(ContainerPolicy containerPolicy) { this.containerPolicy = containerPolicy; ((ReadAllQuery)getSelectionQuery()).setContainerPolicy(containerPolicy); }
/** * 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)); }
/** * PUBLIC: * Use a ScrollableCursor as the result collection. * @param pageSize the number of elements to be read into a the cursor * when more elements are needed from the database. */ public void useScrollableCursor(int pageSize) { setContainerPolicy(new ScrollableCursorPolicy(this, pageSize)); }
/** * PUBLIC: * Use a ScrollableCursor as the result collection. * @param policy the scrollable cursor policy allows for additional result set options. * Example:<p> * ScrollableCursorPolicy policy = new ScrollableCursorPolicy()<p> * policy.setResultSetType(ScrollableCursorPolicy.TYPE_SCROLL_INSENSITIVE);<p> * query.useScrollableCursor(policy);<p> */ public void useScrollableCursor(ScrollableCursorPolicy policy) { policy.setQuery(this); setContainerPolicy(policy); }
/** * ADVANCED: * Configure the mapping to use a container policy. * The policy manages the access to the collection. */ public void setContainerPolicy(ContainerPolicy containerPolicy) { this.containerPolicy = containerPolicy; ((ReadAllQuery)getSelectionQuery()).setContainerPolicy(containerPolicy); }
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { ReadAllQuery customReadQuery = (ReadAllQuery)customQuery; customReadQuery.setContainerPolicy(getContainerPolicy()); customReadQuery.setCascadePolicy(getCascadePolicy()); customReadQuery.setShouldRefreshIdentityMapResult(shouldRefreshIdentityMapResult()); customReadQuery.setShouldMaintainCache(shouldMaintainCache()); customReadQuery.setShouldUseWrapperPolicy(shouldUseWrapperPolicy()); }