Index: topia/src/java/org/codelutin/topia/persistence/DistributedPersistenceHelper.java diff -u topia/src/java/org/codelutin/topia/persistence/DistributedPersistenceHelper.java:1.3 topia/src/java/org/codelutin/topia/persistence/DistributedPersistenceHelper.java:1.4 --- topia/src/java/org/codelutin/topia/persistence/DistributedPersistenceHelper.java:1.3 Fri Aug 6 17:48:52 2004 +++ topia/src/java/org/codelutin/topia/persistence/DistributedPersistenceHelper.java Wed Sep 15 14:36:04 2004 @@ -23,10 +23,10 @@ * Created: Jul 30, 2004 * * @author Cédric Pineau - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * - * Last update : $Date: 2004/08/06 17:48:52 $ - * by : $Author: bpoussin $ + * Last update : $Date: 2004/09/15 14:36:04 $ + * by : $Author: pineau $ */ package org.codelutin.topia.persistence; @@ -34,6 +34,7 @@ import java.util.List; import java.util.Properties; +import org.codelutin.topia.AsynchronousLoader; import org.codelutin.topia.TopiaArgument; import org.codelutin.topia.TopiaContext; import org.codelutin.topia.TopiaEntity; @@ -62,6 +63,28 @@ } /** + * Get a list of objects within a range for the given query. + * @param query request to execute + * @param startIndex index of the first element to return + * @param endIndex index of the last element to return + * @return a list og Objects + */ + public List findInRange(TopiaQuery query, int startIndex, int endIndex) throws TopiaException { + return (List) context.getDistributionHelper().call(PersistenceHelper.class,"find", new TopiaArgument().addArg(query).addArg(startIndex).addArg(endIndex)); + } + + /** + * Get a list of objects within a range for the given query. + * @param query request to execute + * @param startIndex index of the first element to return + * @param endIndex index of the last element to return + * @return a list og Objects + */ + public AsynchronousLoader findInRangeAsynchronously(TopiaQuery query, int startIndex, int endIndex) throws TopiaException { + return (AsynchronousLoader) context.getDistributionHelper().call(PersistenceHelper.class,"findInRangeAsynchronously", new TopiaArgument().addArg(query).addArg(startIndex).addArg(endIndex)); + } + + /** * Permet de récupéré une liste d'objet par rapport a une requete. * @param query la requete a executer * @return une List d'objets @@ -70,6 +93,15 @@ return (List) context.getDistributionHelper().call(PersistenceHelper.class,"find", new TopiaArgument().addArg(query)); } + /** + * Permet de récupéré une liste d'objet par rapport a une requete. + * @param query la requete a executer + * @return une List d'objets + */ + public AsynchronousLoader findAsynchronously(TopiaQuery query) throws TopiaException { + return (AsynchronousLoader) context.getDistributionHelper().call(PersistenceHelper.class,"findAsynchronously", new TopiaArgument().addArg(query)); + } + public int size(TopiaQuery query) throws TopiaException { return ((Integer) context.getDistributionHelper().call(PersistenceHelper.class,"size", new TopiaArgument().addArg(query))).intValue(); } @@ -88,5 +120,6 @@ return (String)context.getDistributionHelper().call(PersistenceHelper.class, "exportXML", null); } + } Index: topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java diff -u topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java:1.5 topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java:1.6 --- topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java:1.5 Fri Aug 6 18:02:38 2004 +++ topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java Wed Sep 15 14:36:04 2004 @@ -23,16 +23,17 @@ * Created: Aug 1, 2004 * * @author Cédric Pineau - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Last update : $Date: 2004/08/06 18:02:38 $ - * by : $Author: bpoussin $ + * Last update : $Date: 2004/09/15 14:36:04 $ + * by : $Author: pineau $ */ package org.codelutin.topia.persistence; import java.util.List; +import org.codelutin.topia.AsynchronousLoader; import org.codelutin.topia.TopiaEntity; import org.codelutin.topia.TopiaException; import org.codelutin.topia.TopiaQuery; @@ -60,6 +61,31 @@ * @return une List d'objets */ public List find(TopiaQuery query) throws TopiaException; + + /** + * Permet de récupéré de manière asynchrone une liste d'objet par rapport a une requete. + * @param query la requete a executer + * @return a JDOAsynchronousLoader + */ + public AsynchronousLoader findAsynchronously(TopiaQuery query) throws TopiaException; + + /** + * Get a list of objects within a range for the given query. + * @param query request to execute + * @param startIndex index of the first element to return + * @param endIndex index of the last element to return + * @return a list og Objects + */ + public List findInRange(TopiaQuery query, int startIndex, int endIndex) throws TopiaException; + + /** + * Get an asynchronous loader of objects within a range for the given query. + * @param query request to execute + * @param startIndex index of the first element to return + * @param endIndex index of the last element to return + * @return a JDOAsynchronousLoader + */ + public AsynchronousLoader findInRangeAsynchronously(TopiaQuery query, int startIndex, int endIndex) throws TopiaException; public int size(TopiaQuery query) throws TopiaException;