Guest User

Untitled

a guest
Jun 5th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. Jun 29, 2009 6:12:37 PM org.hibernate.cfg.annotations.Version <clinit>
  2. INFO: Hibernate Annotations 3.3.0.GA
  3. Jun 29, 2009 6:12:37 PM org.hibernate.ejb.Version <clinit>
  4. INFO: Hibernate EntityManager 3.3.0.GA
  5. Jun 29, 2009 6:12:37 PM org.hibernate.ejb.Ejb3Configuration configure
  6. INFO: Could not find any META-INF/persistence.xml file in the classpath
  7.  
  8. package com.activator;
  9.  
  10.  
  11. public class PersistenceActivator implements BundleActivator {
  12.  
  13. @Override
  14. public void start(BundleContext arg0) throws Exception {
  15.  
  16. EntityManagerFactory emf = Persistence
  17. .createEntityManagerFactory("postgres");
  18. EntityManager em = emf.createEntityManager();
  19.  
  20. SimpleDaoImpl dao = new SimpleDaoImpl();
  21. dao.setEntityManager(em);
  22.  
  23. }
  24.  
  25. @Override
  26. public void stop(BundleContext arg0) throws Exception {
  27. // TODO Auto-generated method stub
  28.  
  29. }
  30.  
  31. }
  32.  
  33. Manifest-Version: 1.0
  34. Bundle-ManifestVersion: 2
  35. Bundle-Name: Dao Plug-in
  36. Bundle-SymbolicName: Dao
  37. Bundle-Version: 1.0.0
  38. Bundle-RequiredExecutionEnvironment: JavaSE-1.6
  39. Import-Package: org.osgi.framework;version="1.4.0"
  40. Bundle-Activator: com.activator.PersistenceActivator
  41. Export-Package: com.dao.service
  42. Require-Bundle: HibernateBundle;bundle-version="1.0.0"
  43.  
  44. <?xml version="1.0" encoding="UTF-8"?>
  45.  
  46. <persistence>
  47.  
  48. <!-- Sample persistence using PostgreSQL. See postgres.txt. -->
  49. <persistence-unit name="postgres" transaction-type="RESOURCE_LOCAL">
  50.  
  51. <properties>
  52.  
  53.  
  54. <property name="hibernate.archive.autodetection" value="class" />
  55.  
  56. <!--
  57. Comment out if schema exists & you don't want the tables dropped.
  58. -->
  59. <property name="hibernate.hbm2ddl.auto" value="create-drop" /> <!-- drop/create tables @startup, drop tables @shutdown -->
  60.  
  61.  
  62. <!-- Database Connection Settings -->
  63. <property name="hibernate.connection.autocommit">true</property>
  64. <property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
  65. <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
  66. <property name="hibernate.connection.username" value="postgres" />
  67. <property name="hibernate.connection.password" value="postgres" />
  68. <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/test" />
  69.  
  70. <!-- Not sure about these... -->
  71. <property name="hibernate.max_fetch_depth">16</property>
  72. <property name="hibernate.jdbc.batch_size">1000</property>
  73. <property name="hibernate.use_outer_join">true</property>
  74. <property name="hibernate.default_batch_fetch_size">500</property>
  75.  
  76. <!-- Hibernate Query Language (HQL) parser. -->
  77. <property name="hibernate.query.factory_class">
  78. org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
  79.  
  80. <!-- Echo all executed SQL to stdout -->
  81. <property name="hibernate.show_sql">true</property>
  82. <property name="hibernate.format_sql">false</property>
  83.  
  84. <!-- Use c3p0 for the JDBC connection pool -->
  85. <property name="hibernate.c3p0.min_size">3</property>
  86. <property name="hibernate.c3p0.max_size">100</property>
  87. <property name="hibernate.c3p0.max_statements">100</property>
  88.  
  89. <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
  90.  
  91. </properties>
  92. </persistence-unit>
  93.  
  94.  
  95.  
  96. </persistence>
Add Comment
Please, Sign In to add comment