1 25 26 package org.objectweb.speedo.tutorial; 27 28 import java.io.FileInputStream ; 29 import java.io.IOException ; 30 import java.util.Properties ; 31 32 import javax.jdo.JDOHelper; 33 import javax.jdo.PersistenceManagerFactory; 34 35 39 public class TutorialHelper { 40 41 protected static PersistenceManagerFactory pmf = null; 42 43 public TutorialHelper(String propertiesFileName)throws IOException { 44 Properties p = new Properties (); 45 p.load(new FileInputStream (propertiesFileName)); 46 p.setProperty("org.objectweb.speedo.mappingStructure","DELETE_DATA"); 47 pmf = JDOHelper.getPersistenceManagerFactory(p); 48 System.out.println("PersistenceManagerFactory instanciated ("+ pmf.getConnectionURL() + ")"); 49 } 50 51 public PersistenceManagerFactory getPMF(){ 52 return pmf; 53 } 54 } 55 | Popular Tags |