Index: topia/src/java/org/codelutin/topia/TopiaId.java diff -u topia/src/java/org/codelutin/topia/TopiaId.java:1.7 topia/src/java/org/codelutin/topia/TopiaId.java:1.8 --- topia/src/java/org/codelutin/topia/TopiaId.java:1.7 Thu Dec 8 09:40:45 2005 +++ topia/src/java/org/codelutin/topia/TopiaId.java Fri Dec 9 10:27:22 2005 @@ -23,9 +23,9 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * - * Mise a jour: $Date: 2005/12/08 09:40:45 $ + * Mise a jour: $Date: 2005/12/09 10:27:22 $ * par : $Author: thimel $ */ @@ -71,7 +71,11 @@ if(!clazz.isInterface()){ throw new IllegalArgumentException("Only interface is permit to create id: " + clazz); } - return clazz.getName() + "#" + System.currentTimeMillis() + "#" + Math.random(); + double random = Math.random(); + while (Double.toString(random).contains("E-")) { + random = Math.random(); + } + return clazz.getName() + "#" + System.currentTimeMillis() + "#" + random; } /** @@ -94,7 +98,7 @@ */ public static boolean isValidId(String topiaId){ try{ - if(topiaId.matches(".*?#[0-9]+#[0-9.[E-]]+")){ + if(topiaId.matches(".*?#[0-9]+#[0-9.]+")){ getClassName(topiaId); return true; } Index: topia/src/java/org/codelutin/topia/TopiaEntity.java diff -u topia/src/java/org/codelutin/topia/TopiaEntity.java:1.20 topia/src/java/org/codelutin/topia/TopiaEntity.java:1.21 --- topia/src/java/org/codelutin/topia/TopiaEntity.java:1.20 Wed Sep 7 15:34:59 2005 +++ topia/src/java/org/codelutin/topia/TopiaEntity.java Fri Dec 9 10:27:22 2005 @@ -23,10 +23,10 @@ * * @author Cédric Pineau * Copyright Code Lutin -* @version $Revision: 1.20 $ +* @version $Revision: 1.21 $ * -* Last update : $Date: 2005/09/07 15:34:59 $ -* by : $Author: bpoussin $ +* Last update : $Date: 2005/12/09 10:27:22 $ +* by : $Author: thimel $ */ package org.codelutin.topia; @@ -80,7 +80,23 @@ @MethodInfo ( type = MethodType.GENERATED ) public Iterator iterator_dependentEntities_() throws TopiaException; - @MethodInfo ( type = MethodType.GENERATED ) + @MethodInfo ( type = MethodType.GENERATED ) public String toXML() throws TopiaException; + /** + * Add to a transient map the given couple of key/value + * @param key + * @param value + */ + @MethodInfo ( type = MethodType.GENERATED ) + public void setTransient(Object key, Object value); + + /** + * Returns the value associated with the given key from the transient map + * @param key + * @return the value if exists, else null + */ + @MethodInfo ( type = MethodType.GENERATED ) + public Object getTransient(Object key); + } // TopiaEntity