Index: topia/src/java/org/codelutin/topia/persistence/PersistenceStorageJDBC.java diff -u topia/src/java/org/codelutin/topia/persistence/PersistenceStorageJDBC.java:1.5 topia/src/java/org/codelutin/topia/persistence/PersistenceStorageJDBC.java:1.6 --- topia/src/java/org/codelutin/topia/persistence/PersistenceStorageJDBC.java:1.5 Mon Aug 1 17:10:15 2005 +++ topia/src/java/org/codelutin/topia/persistence/PersistenceStorageJDBC.java Tue Aug 2 15:00:11 2005 @@ -23,10 +23,10 @@ * Created: 20 juillet 2005 15:25:06 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Last update: $Date: 2005/08/01 17:10:15 $ - * by : $Author: thimel $ + * Last update: $Date: 2005/08/02 15:00:11 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -217,6 +217,8 @@ SQL = SQL_MYSQL; } else if(driver.indexOf("mckoi") != -1){ SQL = SQL_MCKOI; + } else if(driver.indexOf("oracle") != -1){ + SQL = SQL_ORACLE; } else { SQL = SQL_POSTGRESQL; } Index: topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java diff -u topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java:1.3 topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java:1.4 --- topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java:1.3 Tue Jul 26 14:32:06 2005 +++ topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java Tue Aug 2 15:00:11 2005 @@ -23,9 +23,9 @@ * Created: 16 juillet 2005 23:52:35 CEST * * @author Benjamin POUSSIN -* @version $Revision: 1.3 $ +* @version $Revision: 1.4 $ * -* Last update: $Date: 2005/07/26 14:32:06 $ +* Last update: $Date: 2005/08/02 15:00:11 $ * by : $Author: bpoussin $ */ @@ -54,6 +54,7 @@ import org.codelutin.topia.TopiaEntityOperation; import org.codelutin.topia.TopiaException; import org.codelutin.topia.TopiaId; +import org.codelutin.topia.TopiaNotFoundException; import org.codelutin.topia.TopiaPersistenceService; import org.codelutin.topia.TopiaQuery; import org.codelutin.util.ArrayUtil; @@ -302,13 +303,33 @@ TopiaEntity entity = (TopiaEntity)proxy; String methodName = method.getName(); + // on ne permet pas la surcharge des methodes utiles au framework + if("get_topiaId_".equals(methodName)){ + return getObject().getManagement().getId(); + } + // TODO mettre ici les autres methodes declarees sur TopiaEntity + // on commence par regarder si l'utilisateur n'a pas implanté la // méthode dans l'objet des operations - TopiaEntityOperation op = ph.getContext().getEntityOperation(interfacez); - Class [] argsType = (Class[])ArrayUtil.concat(new Class[]{interfacez}, - method.getParameterTypes()); - Method m = MethodUtils.getAccessibleMethod(op.getClass(), methodName, - argsType); + Method m = null; + TopiaEntityOperation op = null; + try{ + op = ph.getContext().getEntityOperation(interfacez); + Class [] argsType = (Class[])ArrayUtil.concat(new Class[]{interfacez}, + method.getParameterTypes()); + m = MethodUtils.getAccessibleMethod(op.getClass(), methodName, + argsType); + }catch(TopiaNotFoundException eee){ + } + + if(m == null && MethodInfoHelper.type(method) == MethodType.OPERATION){ + // la methode est une operation, il faut absolument la trouver + // dans l'objet operation, il faut donc que l'objet operation + // existe + throw new UnsupportedOperationException("This proxy don't support this operation: " + method + + ". But this operation must exists on " + interfacez.getName() + "Operation class"); + } + if(m != null){ // on a retrouvé la méthode sur les operations, // on peut donc l'appeler