Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Commits List »

[hibernate-commits] Hibernate SVN: r20221 -
 core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/event/def.

hibernate-commits

2010-08-23


Author LoginPost Reply
Author: stliu
Date: 2010-08-23 06:52:41 -0400 (Mon, 23 Aug 2010)
New Revision: 20221

Modified:
 core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java
Log:
JBPAPP-4926 HHH-3334 Cascade-save breaks if parent ID is assigned (delays insert) and child has identity ID (early insert)

Modified: core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java  2010-08-22 16:39:12 UTC (rev 20220)
+++ core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java  2010-08-23 10:52:41 UTC (rev 20221)
@@(protected) @@
 }

 /**
-   * Ppepares the save call by checking the session caches for a pre-existing
+   * Prepares the save call by checking the session caches for a pre-existing
  * entity and performing any lifecycle callbacks.
  *
  * @param entity The entity to be saved.
@@(protected) @@
   boolean inTxn = source.getJDBCContext().isTransactionInProgress();
   boolean shouldDelayIdentityInserts = !inTxn && !requiresImmediateIdAccess;

-    if ( useIdentityColumn && !shouldDelayIdentityInserts ) {
-      log.trace( "executing insertions" );
-      source.getActionQueue().executeInserts();
-    }
-
   // Put a placeholder in entries, so we don't recurse back and try to save() the
   // same object again. QUESTION: should this be done before onSave() is called?
   // likewise, should it be done before onUpdate()?
@@(protected) @@
   );

   cascadeBeforeSave( source, persister, entity, anything );
+    
+    if ( useIdentityColumn && !shouldDelayIdentityInserts ) {
+      log.trace( "executing insertions" );
+      source.getActionQueue().executeInserts();
+    }

   Object[] values = persister.getPropertyValuesToInsert( entity, getMergeMap( anything ), source );
   Type[] types = persister.getPropertyTypes();
@@(protected) @@
 }

 /**
-   * After the save, will te version number be incremented
+   * After the save, will the version number be incremented
  * if the instance is modified?
  *
  * @return True if the version will be incremented on an entity change after save;
@@(protected) @@
 /**
  * Handles the calls needed to perform pre-save cascades for the given entity.
  *
-   * @param source The session from whcih the save event originated.
+   * @param source The session from which the save event originated.
  * @param persister The entity's persister instance.
  * @param entity The entity to be saved.
  * @param anything Generally cascade-specific data
@@(protected) @@
  *
  * @param source The session from which the event originated.
  * @param persister The entity's persister instance.
-   * @param entity The entity beng saved.
+   * @param entity The entity being saved.
  * @param anything Generally cascade-specific data
  */
 protected void cascadeAfterSave(

_______________________________________________
hibernate-commits mailing list
hibernate-commits@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-commits
©2008 gg3721.com - Jax Systems, LLC, U.S.A.