Index: topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/PersistenceHelper.java Thu Jul 15 13:13:13 2004 @@ -0,0 +1,60 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceHelper.java + * + * Created: 3 juil. 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/15 13:13:13 $ + * par : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import org.codelutin.topia.TopiaQuery; +import org.codelutin.topia.TopiaEntity; +import org.codelutin.topia.TopiaException; +import java.util.List; + +/** +* La classe qui implante cette interface doit obligatoirement avoir un +* constructeur prenant en argument un {@org.codelutin.topia.TopiaContext} et +* une objet {@java.util.Properties} +*/ +public interface PersistenceHelper { // PersistenceHelper + + public TopiaEntity create(Class entityClass) throws TopiaException; + public TopiaEntity makePersistent(TopiaEntity entity) throws TopiaException; + public TopiaEntity update(TopiaEntity entity) throws TopiaException; + public void delete(TopiaEntity entity) throws TopiaException; + + /** + * 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 List find(TopiaQuery query) throws TopiaException; + public int size(TopiaQuery query) throws TopiaException; + +} // PersistenceHelper +