Index: topia/src/java/org/codelutin/topia/generators/jdo/tjdo/ObjectModelToPersistenceHelperPropertiesGenerator.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/jdo/tjdo/ObjectModelToPersistenceHelperPropertiesGenerator.java:1.3 --- /dev/null Wed Sep 15 14:36:09 2004 +++ topia/src/java/org/codelutin/topia/generators/jdo/tjdo/ObjectModelToPersistenceHelperPropertiesGenerator.java Wed Sep 15 14:36:04 2004 @@ -0,0 +1,71 @@ +/* *##% + * 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. + *##%*/ + +/* * + * ObjectModelToPersistenceHelperPropertiesGenerator.java + * + * Created: 6 juil. 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.3 $ + * + * Mise a jour: $Date: 2004/09/15 14:36:04 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.generators.jdo.tjdo; + +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; + +import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModel; +import org.codelutin.generator.models.object.ObjectModelClass; +import org.codelutin.generator.models.object.ObjectModelClassifier; +import org.codelutin.topia.generators.Util; + +public class ObjectModelToPersistenceHelperPropertiesGenerator extends ObjectModelGenerator { // ObjectModelToPersistenceHelperPropertiesGenerator + + public String getFilenameForModel(ObjectModel model){ + return model.getName() + "JDOPersistenceHelper.properties"; + } + + public void generateFromModel(Writer output, ObjectModel model) throws IOException { +/*{ +javax.jdo.PersistenceManagerFactoryClass=com.triactive.jdo.PersistenceManagerFactoryImpl +javax.jdo.option.ConnectionDriverName=org.postgresql.Driver +javax.jdo.option.ConnectionURL=jdbc:postgresql://localhost/database/tjdo?autoReconnect=yes +javax.jdo.option.ConnectionUserName=dbuser +javax.jdo.option.ConnectionPassword=dbuser +javax.jdo.option.NontransactionalRead=true +com.triactive.jdo.autoCreateTables=true + +}*/ + for(Iterator i=model.getClassifiers().iterator(); i.hasNext();){ + ObjectModelClassifier clazz = (ObjectModelClassifier)i.next(); + if(Util.isEntity(clazz)){ +/*{mapping.jdo.<%=clazz.getQualifiedName()%>=<%=clazz.getPackageName()%>.persistence.jdo.<%=clazz.getName()%>JDO +}*/ + } + } + } + +} // ObjectModelToPersistenceHelperPropertiesGenerator +