1 package org.hibernate.ejb.test.connection; 3 4 import java.util.List ; 5 import java.util.Properties ; 6 import java.util.ArrayList ; 7 import java.net.URL ; 8 import javax.persistence.spi.PersistenceInfo; 9 import javax.sql.DataSource ; 10 11 import org.hibernate.ejb.HibernatePersistence; 12 import org.hibernate.ejb.test.Item; 13 import org.hibernate.ejb.test.Distributor; 14 import org.hibernate.cfg.Environment; 15 16 19 public class PersistenceInfoImpl implements PersistenceInfo { 20 private Properties properties = new Properties (); 21 public String getEntityManagerName() { 22 return "persistenceinfo"; 23 } 24 25 public String getPersistenceProviderClassName() { 26 return HibernatePersistence.class.getName(); 27 } 28 29 public DataSource getJtaDataSource() { 30 return new FakeDataSource(); 31 } 32 33 public DataSource getNonJtaDataSource() { 34 return null; 35 } 36 37 public List <String > getMappingFileNames() { 38 return new ArrayList <String >(); 39 } 40 41 public List <URL > getJarFiles() { 42 return new ArrayList <URL >(); 43 } 44 45 public List <String > getEntityclassNames() { 46 List <String > classes = new ArrayList <String >(); 47 classes.add( Item.class.getName() ); 48 classes.add( Distributor.class.getName() ); 49 return classes; 50 } 51 52 public Properties getProperties() { 53 properties.setProperty( Environment.HBM2DDL_AUTO, "create-drop"); 54 return properties; 55 } 56 57 public ClassLoader getClassLoader() { 58 return Thread.currentThread().getContextClassLoader(); 59 } 60 61 public URL getPersistenceXmlFileUrl() { 62 return null; 63 } 64 65 public URL getEntityMappingsXmlFileUrl() { 66 return null; 67 } 68 } 69 | Popular Tags |