Index: topia/src/java/org/codelutin/topia/persistence/jdo/AbstractJDOEntity.java diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/jdo/AbstractJDOEntity.java:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/AbstractJDOEntity.java Thu Jul 15 13:13:13 2004 @@ -0,0 +1,127 @@ +/* *##% + * 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. + *##%*/ + +/* * + * AbstractJDOEntity.java + * + * Created: 6 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.jdo; + +import javax.jdo.JDOHelper; +import javax.jdo.PersistenceManager; +import java.util.Date; +import org.codelutin.topia.TopiaContext; +import org.codelutin.topia.TopiaEntity; +import org.codelutin.topia.TopiaUser; +import org.codelutin.topia.TopiaException; +import java.util.HashSet; + +public abstract class AbstractJDOEntity implements JDOEntity { // AbstractJDOEntity + protected String _topiaId_ = null; + protected String _version_; + protected Date _creationDate_; + protected Date _lastUpdateDate_; + protected TopiaUser _lastUpdateUser_; + + public AbstractJDOEntity(){ + } + + public String get_topiaId_(){ + return _topiaId_; + } + public void set_topiaId_(String topiaId){ + if(_topiaId_ != null && !_topiaId_.equals(topiaId)){ + throw new RuntimeException("It's not allowed to change topiaId"); + } + this._topiaId_ = topiaId; + } + public String get_version_(){ + return _version_; + } + public void set_version_(String version){ + this._version_ = version; + } + + public Date get_creationDate_(){ + return _creationDate_; + } + public void set_creationDate_(Date creationDate){ + this._creationDate_ = creationDate; + } + + public Date get_lastUpdateDate_(){ + return _lastUpdateDate_; + } + public void set_lastUpdateDate_(Date lastUpdateDate){ + this._lastUpdateDate_ = lastUpdateDate; + } + + public TopiaUser get_lastUpdateUser_(){ + return _lastUpdateUser_; + } + public void set_lastUpdateUser_(TopiaUser lastUpdateUser){ + this._lastUpdateUser_ = lastUpdateUser; + } + + /** + * Met a jour l'objet jdo a partir de l'entity. Et appelle l'operation + * d'update sur les Entities elle meme modifié. + * @param topiaEntity une vrai entity et pas un Lazy + */ + public void update(TopiaEntity entity, HashSet done) throws TopiaException { + this._topiaId_ = entity.get_topiaId_(); + this._version_ = entity.get_version_(); + this._creationDate_ = entity.get_creationDate_(); + this._lastUpdateDate_ = entity.get_lastUpdateDate_(); + this._lastUpdateUser_ = entity.get_lastUpdateUser_(); + } + + /** + * Met a jour les informations de l'entity passé en parametre par rapport + * aux information de la classe courante. + */ + protected TopiaEntity convertToEntity(TopiaEntity result) throws TopiaException{ + result.setContext(getContext()); + result.set_topiaId_(_topiaId_); + result.set_version_(_version_); + result.set_creationDate_(_creationDate_); + result.set_lastUpdateDate_(_lastUpdateDate_); + result.set_lastUpdateUser_(_lastUpdateUser_); + return result; + } + + public JDOPersistenceHelper getPersistenceHelper(){ + PersistenceManager pm = JDOHelper.getPersistenceManager(this); + return (JDOPersistenceHelper)pm.getUserObject(); + } + + public TopiaContext getContext(){ + return getPersistenceHelper().getContext(); + } + +} // AbstractJDOEntity + Index: topia/src/java/org/codelutin/topia/persistence/jdo/AbstractJDOEntity.jdo diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/jdo/AbstractJDOEntity.jdo:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/AbstractJDOEntity.jdo Thu Jul 15 13:13:13 2004 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + Index: topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java Thu Jul 15 13:13:13 2004 @@ -0,0 +1,177 @@ +/* *##% + * 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. + *##%*/ + +/* * + * AbstractLazyEntity.java + * + * Created: 6 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.jdo; + +import org.codelutin.topia.TopiaUser; +import org.codelutin.topia.TopiaEntity; +import org.codelutin.topia.TopiaContext; +import org.codelutin.topia.TopiaException; +import org.codelutin.topia.TopiaNotFoundException; +import java.util.Date; +import org.codelutin.util.VersionNumberUtil; + +public abstract class AbstractLazyEntity implements TopiaEntity { // AbstractLazyEntity + + protected TopiaContext context = null; + protected String _topiaId_ = null; + protected String _version_ = null; + protected TopiaEntity entity = null; + + public AbstractLazyEntity(TopiaContext context, String topiaId, String version) throws TopiaException { + this.context = context; + this._topiaId_ = topiaId; + this._version_ = version; + } + + public AbstractLazyEntity(TopiaContext context, TopiaEntity entity) throws TopiaException { + this(context, entity.get_topiaId_(), entity.get_version_()); + this.entity = entity; + } + + /** + * Is equals if and only if topiaId is equals and version is equals + * other implantation can be to forward the request to the inner + * entity, but this force entity load :( + */ + public boolean equals(Object o){ + if(o instanceof TopiaEntity){ + try{ + String topiaId = ((TopiaEntity)o).get_topiaId_(); + String version = ((TopiaEntity)o).get_version_(); + return _topiaId_.equals(topiaId) && VersionNumberUtil.equals(_version_,version); + }catch(TopiaException eee){ + throw new RuntimeException("Can't check equality", eee); + } + } + return false; + } + + public String toString(){ + return "Lazy " + _topiaId_ + "(version " + _version_ + ")"; + } + + public boolean isLoaded(){ + return entity != null; + } + + /** + * @return retourne l'entity, si elle n'est pas chargée, alors retourne null + */ + public TopiaEntity getEntity(){ + return entity; + } + + /** + * Parcours l'entity pour modifier tous les contexts de tous les objets + * Lazy de l'entity + */ + abstract protected void setContextOnAllLazy(TopiaContext context) throws TopiaException; + + /** + * Change le context de l'objet ainsi que l'objet sous jacent + */ + public void setContext(TopiaContext context) throws TopiaException { + this.context = context; + if(isLoaded()){ + getEntity().setContext(context); + setContextOnAllLazy(context); + } + } + + public TopiaContext getContext(){ + return context; + } + + public JDOPersistenceHelper getPersistenceHelper() throws TopiaNotFoundException { + return (JDOPersistenceHelper)getContext().getPersistenceHelper(); + } + + protected void load() throws TopiaException { + if(!isLoaded()){ + TopiaEntity result = getPersistenceHelper().findByTopiaId(_topiaId_); + if(result instanceof AbstractLazyEntity){ + entity = ((AbstractLazyEntity)result).getEntity(); + }else{ + entity = result; + } + } + } + + public String get_topiaId_(){ + return _topiaId_; + } + + public String get_version_() throws TopiaException { + return _version_; + } + + public Date get_creationDate_() throws TopiaException { + load(); + return entity.get_creationDate_(); + } + + public Date get_lastUpdateDate_() throws TopiaException { + load(); + return entity.get_lastUpdateDate_(); + } + + public TopiaUser get_lastUpdateUser_() throws TopiaException { + load(); + return entity.get_lastUpdateUser_(); + } + + public void set_topiaId_(String v) throws TopiaException { + throw new UnsupportedOperationException("It's not allow to change topiaId"); + } + + public void set_version_(String v) throws TopiaException { + throw new UnsupportedOperationException("It's not allow to change version"); + } + + public void set_creationDate_(Date v) throws TopiaException { + load(); + entity.set_creationDate_(v); + } + + public void set_lastUpdateDate_(Date v) throws TopiaException { + load(); + entity.set_lastUpdateDate_(v); + } + + public void set_lastUpdateUser_(TopiaUser v) throws TopiaException { + load(); + entity.set_lastUpdateUser_(v); + } + + +} // AbstractLazyEntity + Index: topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java Thu Jul 15 13:13:13 2004 @@ -0,0 +1,58 @@ +/* *##% + * 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. + *##%*/ + +/* * + * JDOEntity.java + * + * Created: 6 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.jdo; + +import org.codelutin.topia.TopiaEntity; +import org.codelutin.topia.TopiaUser; +import org.codelutin.topia.TopiaException; +import java.util.HashSet; +import java.util.Date; + +public interface JDOEntity { // JDOEntity + public Class getEntityClass(); + + public String get_topiaId_(); + public String get_version_(); + public Date get_creationDate_(); + public Date get_lastUpdateDate_(); + public TopiaUser get_lastUpdateUser_(); + + public void set_topiaId_(String v); + public void set_version_(String v); + public void set_creationDate_(Date v); + public void set_lastUpdateDate_(Date v); + public void set_lastUpdateUser_(TopiaUser v); + + public void update(TopiaEntity topiaEntity, HashSet done) throws TopiaException; + public TopiaEntity convertToEntity() throws TopiaException; +} // JDOEntity + Index: topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.jdo diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.jdo:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.jdo Thu Jul 15 13:13:13 2004 @@ -0,0 +1,8 @@ + + + + + + + + Index: topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java Thu Jul 15 13:13:13 2004 @@ -0,0 +1,291 @@ +/* *##% + * 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. + *##%*/ + +/* * + * JDOPersistenceHelper.java + * + * Created: 6 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.jdo; + +import org.codelutin.util.VersionNumberUtil; +import org.codelutin.topia.persistence.PersistenceHelper; +import org.codelutin.topia.TopiaContext; +import org.codelutin.topia.TopiaId; +import org.codelutin.topia.TopiaQuery; +import org.codelutin.topia.TopiaEntity; +import org.codelutin.topia.TopiaException; +import org.codelutin.topia.TopiaNotFoundException; +import java.util.List; +import javax.jdo.JDOHelper; +import javax.jdo.Transaction; +import javax.jdo.Query; +import javax.jdo.PersistenceManager; +import javax.jdo.PersistenceManagerFactory; +import java.util.Properties; +import java.util.HashSet; +import java.util.Iterator; +import org.codelutin.queryparser.QueryHelper; +import org.codelutin.queryparser.QueryHelperException; +import org.codelutin.queryjdo.JDOQueryHelper; +import java.util.Collection; +import java.util.ArrayList; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class JDOPersistenceHelper implements PersistenceHelper { // JDOPersistenceHelper + + /** + * Le context a partir duquel on a recupere ce PersistenceHelper + */ + protected TopiaContext context = null; + /** + * Les proprietes pour ce PersistenceHelper + */ + protected Properties properties = null; + /** + * Le PersistenceHelper JDO + */ + protected PersistenceManager pm = null; + /** + * Le queryHelper qui permet d'executer les requetes TopiaQuery + */ + protected QueryHelper queryHelper = null; + + public JDOPersistenceHelper(TopiaContext context, Properties properties){ + this.context = context; + this.properties = properties; + PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(properties); + pm = pmf.getPersistenceManager(); + pm.setUserObject(this); + } + + public TopiaContext getContext(){ + return context; + } + + public TopiaEntity create(Class entityClass) throws TopiaException { + Class clazz = Util.getClazz(entityClass.getName() + "Impl"); + Class lazyClass = Util.getLazyClass(entityClass); + TopiaEntity entity = (TopiaEntity)Util.getInstance(clazz); + AbstractLazyEntity lazy = (AbstractLazyEntity)Util.getInstance(lazyClass, new Object[]{context, entity}); + return lazy; + } + + protected boolean isNewObject(TopiaEntity entity) throws TopiaException { + String objectTopiaId = entity.get_topiaId_(); + String objectVersion = entity.get_version_(); + return objectTopiaId == null || objectVersion == null || "".equals(objectVersion) || VersionNumberUtil.equals("0", objectVersion); + } + + /** + * Permet de convertir les objets normaux en objet persistent. + * La mise à jour des inforamtions du framework est faite ici + * (lastModificationDate, ...) + */ + public JDOEntity update(TopiaEntity entity, HashSet done) throws TopiaException { + JDOEntity jdoEntity = null; + String objectTopiaId = entity.get_topiaId_(); + try{ + if (!isNewObject(entity)) { + jdoEntity = findDO(objectTopiaId); + } else { + Class jdoClass = Util.getJDOClass(entity.getEntityClass()); + jdoEntity = (JDOEntity)Util.getInstance(jdoClass); + pm.makePersistent(jdoEntity); + } + + if(entity instanceof AbstractLazyEntity){ + AbstractLazyEntity ale = (AbstractLazyEntity) entity; + if(!ale.isLoaded()){ + // if is not loaded, then no modification done + return jdoEntity; + }else{ + entity = ale.getEntity(); + } + } + + + if(!done.contains(entity.get_topiaId_())){ + // si on ne la pas encore convertie on le fait + done.add(entity.get_topiaId_()); + //FIXME mettre a jour les info lastModificationDate, ... sur entity + String version = entity.get_version_(); + version = VersionNumberUtil.inc(version); + entity.set_version_(version); + + jdoEntity.update(entity, done); + } + } catch (Throwable eee) { + throw (new TopiaException("Cannot make persistent !", eee)); + } + + return jdoEntity; + + } + + public TopiaEntity makePersistent(TopiaEntity entity) throws TopiaException { + if (!isNewObject(entity)) { + throw new TopiaException("Can't persist " + entity + " has it seems to exist, please use update instead !"); + } + Transaction transaction = pm.currentTransaction(); + transaction.begin(); + try { + JDOEntity jdoEntity = update(entity, new HashSet()); + entity = jdoEntity.convertToEntity(); + // TODO ne pas mettre le listener ici + // mais plutot dans le PersistenceService + // car ce n'est pas specifique au JDO + getContext().getListeners().addCategory(this, entity); + transaction.commit(); + } catch (TopiaException eee) { + transaction.rollback(); + throw eee; + } + return entity; + } + + public TopiaEntity update(TopiaEntity entity) throws TopiaException{ + if ("0".equals(entity.get_version_())) { + throw new TopiaException("Can't persist " + entity + " has it seems to exist, please use update instead !"); + } + Transaction transaction = pm.currentTransaction(); + transaction.begin(); + try { + JDOEntity jdoEntity = update(entity, new HashSet()); + entity = jdoEntity.convertToEntity(); + getContext().getListeners().addCategory(this, entity); + transaction.commit(); + } catch (TopiaException eee) { + transaction.rollback(); + throw eee; + } + return entity; + } + + public void delete(TopiaEntity entity) throws TopiaException{ + String id = entity.get_topiaId_(); + if (isNewObject(entity)) { + throw new TopiaException("Can't delete " + entity + " has it seems not to exist (no identity found) !"); + } + Transaction transaction = pm.currentTransaction(); + transaction.begin(); + try { + pm.deletePersistent(findDO(id)); + transaction.commit(); + } catch (TopiaException eee) { + transaction.rollback(); + throw (eee); + } + } + + /** + * 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{ + List result = new ArrayList(); + for(Iterator i=execute(query).iterator(); i.hasNext();){ + JDOEntity jdoEntity = (JDOEntity)i.next(); + TopiaEntity entity = jdoEntity.convertToEntity(); + result.add(entity); + } + return result; + } + + public int size(TopiaQuery query) throws TopiaException{ + // TODO dans le futur faire un requete qui retourne la taille + // directement + return find(query).size(); + } + + public TopiaEntity findByTopiaId(String id) throws TopiaException{ + TopiaEntity entity = findDO(id).convertToEntity(); + return entity; + } + +// /** +// * Recherche tous les objets correspondants au Id, il faut absolument +// * que les id référence tous le meme type d'objet exactement. +// */ +// public List findByTopiaId(List ids) throws TopiaException{ +// return null; +// } + + protected QueryHelper getQueryHelper(){ + if(queryHelper == null){ + queryHelper = new JDOQueryHelper(pm); + } + return queryHelper; + } + + + + protected Collection execute(TopiaQuery query) throws TopiaException{ + try{ + QueryHelper queryHelper = getQueryHelper(); + // on change le type de class recherche + String jdoClass = Util.getJDOClassName(query.getFrom()); + query.from(jdoClass); + // FIXME, this is hack while query don't support * in select + if("*".equals(query.getSelect())){ + query.select(jdoClass); + } + + Logger.getLogger(getClass().getName() + ".execute").log(Level.INFO, "Executing query: " + query.getQueryString()); + queryHelper.setQuery(query.getQueryString()); + queryHelper.setArgs(query.getArgs()); + return queryHelper.Helper(); + }catch(IOException eee){ + throw new TopiaException("Error during query parsing", eee); + }catch(QueryHelperException eee){ + throw new TopiaException("Error during query execution", eee); + } + } + + public JDOEntity findDO(String topiaId) throws TopiaException{ + Class clazz = TopiaId.getClassName(topiaId); + clazz = Util.getJDOClass(clazz); + Query query = pm.newQuery(clazz, "_topiaId_ == topiaId"); + query.declareParameters("java.lang.String topiaId"); + Collection queryResult = (Collection)query.execute(topiaId); + + JDOEntity result = null; + int size = queryResult.size(); + if(size == 1){ + result = (JDOEntity)queryResult.iterator().next(); + query.close(queryResult); + }else{ + query.close(queryResult); + throw new TopiaException("Can't find objet or id is not unique (result size: " + size + ")"); + } + return result; + } + +} // JDOPersistenceHelper + Index: topia/src/java/org/codelutin/topia/persistence/jdo/Util.java diff -u /dev/null topia/src/java/org/codelutin/topia/persistence/jdo/Util.java:1.1 --- /dev/null Thu Jul 15 13:13:18 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/Util.java Thu Jul 15 13:13:13 2004 @@ -0,0 +1,63 @@ +/* *##% + * 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. + *##%*/ + +/* * + * JDOUtil.java + * + * Created: 13 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.jdo; + +import org.codelutin.topia.TopiaNotFoundException; + +public class Util extends org.codelutin.topia.Util { // Util + + public static Class getJDOClass(Class interfacez) throws TopiaNotFoundException { + String clazz = getJDOClassName(interfacez.getName()); + return getClazz(clazz); + } + + public static Class getLazyClass(Class interfacez) throws TopiaNotFoundException { + String clazz = getLazyClassName(interfacez.getName()); + return Util.getClazz(clazz); + } + + public static String getLazyClassName(String clazz){ + String pack = getPackageName(clazz); + clazz = getClassName(clazz); + + return pack + ".persistence.jdo." + clazz + "Lazy"; + } + + public static String getJDOClassName(String clazz){ + String pack = getPackageName(clazz); + clazz = getClassName(clazz); + + return pack + ".persistence.jdo." + clazz + "JDO"; + } + +} // Util +