incubator-rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject svn commit: r1098025 - in /incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave: jdbc/util/DataSourcePopulator.java orm/jpa/PopulatedLocalContainerEntityManagerFactory.java
Date Fri, 29 Apr 2011 23:34:28 GMT
Author: mfranklin
Date: Fri Apr 29 23:34:28 2011
New Revision: 1098025

URL: http://svn.apache.org/viewvc?rev=1098025&view=rev
Log:
Removed extraneous parameters to DataSourcePopulator constructor
Added additional documentation to custom EntityManagerFactory

Modified:
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/jdbc/util/DataSourcePopulator.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/orm/jpa/PopulatedLocalContainerEntityManagerFactory.java

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/jdbc/util/DataSourcePopulator.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/jdbc/util/DataSourcePopulator.java?rev=1098025&r1=1098024&r2=1098025&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/jdbc/util/DataSourcePopulator.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/jdbc/util/DataSourcePopulator.java
Fri Apr 29 23:34:28 2011
@@ -75,7 +75,7 @@ public class DataSourcePopulator {
      * @param scriptLocations    {@see setScriptLocations}
      * @param executeScriptQuery {@see setExecuteScriptQuery}
      */
-    public DataSourcePopulator(List<Resource> scriptLocations, String executeScriptQuery,
DataSource dataSource, EntityManager entityManager) {
+    public DataSourcePopulator(List<Resource> scriptLocations, String executeScriptQuery)
{
         setScriptLocations(scriptLocations);
         setExecuteScriptQuery(executeScriptQuery);
     }

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/orm/jpa/PopulatedLocalContainerEntityManagerFactory.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/orm/jpa/PopulatedLocalContainerEntityManagerFactory.java?rev=1098025&r1=1098024&r2=1098025&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/orm/jpa/PopulatedLocalContainerEntityManagerFactory.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/orm/jpa/PopulatedLocalContainerEntityManagerFactory.java
Fri Apr 29 23:34:28 2011
@@ -27,10 +27,11 @@ import javax.persistence.spi.Persistence
 
 
 /**
+ * {@inheritDoc}
  * Creates a LocalContainerEntityManagerFactoryBean that calls a DataSourcePopulator bean
to insert data into the
- * datasource immediately after the factory is initialized
+ * DataSource immediately after the factory is initialized
  */
-public class PopulatedLocalContainerEntityManagerFactory extends LocalContainerEntityManagerFactoryBean{
+public class PopulatedLocalContainerEntityManagerFactory extends LocalContainerEntityManagerFactoryBean
{
     private DataSourcePopulator populator;
 
     public PopulatedLocalContainerEntityManagerFactory() {
@@ -41,9 +42,16 @@ public class PopulatedLocalContainerEnti
         this.populator = populator;
     }
 
+    /**
+     * Called after the EntityManagerFactory is initialized and processed.  Delegates to
the data populator
+     * any insertion of data into the DataSource
+     *
+     * @param emf the newly created EntityManagerFactory
+     * @param pui the PersistenceUnit that the EntityManagerFactory was initialized for
+     */
     @Override
     protected void postProcessEntityManagerFactory(EntityManagerFactory emf, PersistenceUnitInfo
pui) {
-        if(populator != null) {
+        if (populator != null) {
             //Create an entity manager to force initialization of the context and then populate
             emf.createEntityManager().close();
             populator.initialize(this.getDataSource());



Mime
View raw message