Index: topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java diff -u topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java:1.20 topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java:1.21 --- topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java:1.20 Fri Oct 14 17:15:00 2005 +++ topia/src/java/org/codelutin/topia/persistence/TopiaPersistenceProxy.java Thu Oct 27 12:21:03 2005 @@ -23,10 +23,10 @@ * Created: 16 juillet 2005 23:52:35 CEST * * @author Benjamin POUSSIN -* @version $Revision: 1.20 $ +* @version $Revision: 1.21 $ * -* Last update: $Date: 2005/10/14 17:15:00 $ -* by : $Author: thimel $ +* Last update: $Date: 2005/10/27 12:21:03 $ +* by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -463,7 +463,16 @@ + ". But this operation must exists on " + interfacez.getName() + "Operation class"); } - if(m != null){ + // on ne permet pas la surcharge des accesseurs aux champs sinon, on + // ne peut plus jamais y acceder :(. TODO: une autre solution serait + // d'avoir une autre methode d'acces au champs par exemple avoir une + // deuxieme methode commencant par _ pour indiquer que c la methode + // d'acces au champs qui ne doit pas etre surchargée et qui pourrait + // etre utilisée dans la methode surchargé d'acces au champs pour + // recuperer la valeur du champs. + if(m != null && MethodInfoHelper.type(method) == MethodType.FIELD_ACCESSOR){ + log.warn("Attribute access method overwriten in Operation implementation class is not allow."); + } else if (m != null) { // on a retrouvé la méthode sur les operations, // on peut donc l'appeler Object [] argsObject = ArrayUtil.concat(new Object[]{proxy}, args); @@ -533,7 +542,7 @@ //on cherche à obtenir un instance de classe d'association String thisField = ClassInfoHelper.associationField(partyA, assoClass); String otherField = ClassInfoHelper.associationField(!partyA, assoClass); - + if (args != null && args.length == 1 && ((TopiaEntity)args[0]).getEntityClass().equals(ClassInfoHelper.fieldType(assoClass, thisField))) { methodName = "findByAttributes"; Class firstClass = ((partyA) ? ClassInfoHelper.fieldType(assoClass, thisField) : ClassInfoHelper.fieldType(assoClass, otherField)); @@ -549,7 +558,7 @@ } else { methodName = "find"; if (thisCardinality[1] != 1) { - methodName += "All"; + methodName += "All"; } methodName += "By" + StringUtils.capitalize(otherField); m = MethodUtils.getAccessibleMethod(assoPS.getClass(), methodName, ClassInfoHelper.fieldType(assoClass, otherField));