Hibernate SVN: r14322 - core/tags/v325.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 22:47:08 -0500 (Wed, 06 Feb 2008)
New Revision: 14322
Added:
core/tags/v325/Branch_3_2/
Log:
(re)tagging 3.2.6 release
Copied: core/tags/v325/Branch_3_2 (from rev 14321, core/branches/Branch_3_2)
16 years, 10 months
Hibernate SVN: r14321 - core/tags.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 22:45:58 -0500 (Wed, 06 Feb 2008)
New Revision: 14321
Removed:
core/tags/v326/
Log:
need to re-tag
16 years, 10 months
Hibernate SVN: r14320 - core/branches/Branch_3_2/lib.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 22:36:01 -0500 (Wed, 06 Feb 2008)
New Revision: 14320
Modified:
core/branches/Branch_3_2/lib/version.properties
Log:
HHH-3085 : missed removing entry for JCA connector.jar
Modified: core/branches/Branch_3_2/lib/version.properties
===================================================================
--- core/branches/Branch_3_2/lib/version.properties 2008-02-07 02:41:30 UTC (rev 14319)
+++ core/branches/Branch_3_2/lib/version.properties 2008-02-07 03:36:01 UTC (rev 14320)
@@ -112,10 +112,6 @@
jta.name=Standard JTA API
jta.when=runtime, required for standalone operation (outside application server)
-connector.lib=connector.jar
-connector.name=Standard JCA API
-connector.when=runtime, optional
-
jaas.lib=jaas.jar
jaas.name=Standard JAAS API
jaas.when=runtime, optional (required by JCA)
16 years, 10 months
Hibernate SVN: r14319 - core/tags.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:41:30 -0500 (Wed, 06 Feb 2008)
New Revision: 14319
Added:
core/tags/v326/
Log:
tagging 3.2.6
Copied: core/tags/v326 (from rev 14318, core/branches/Branch_3_2)
16 years, 10 months
Hibernate SVN: r14318 - in core/branches/Branch_3_2: doc/reference/en and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:34:08 -0500 (Wed, 06 Feb 2008)
New Revision: 14318
Modified:
core/branches/Branch_3_2/build.xml
core/branches/Branch_3_2/changelog.txt
core/branches/Branch_3_2/doc/reference/en/master.xml
core/branches/Branch_3_2/readme.txt
core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java
Log:
prep 3.2.6
Modified: core/branches/Branch_3_2/build.xml
===================================================================
--- core/branches/Branch_3_2/build.xml 2008-02-07 02:21:24 UTC (rev 14317)
+++ core/branches/Branch_3_2/build.xml 2008-02-07 02:34:08 UTC (rev 14318)
@@ -22,7 +22,7 @@
<property name="name2" value="hibernate3"/>
<property name="version.major" value="3"/>
<property name="version.minor" value="2"/>
- <property name="version.micro" value="5"/>
+ <property name="version.micro" value="6"/>
<property name="version.qualifier" value="ga"/>
<property name="version.full" value="${version.major}.${version.minor}.${version.micro}.${version.qualifier}"/>
<property name="version.major_minor" value="${version.major}.${version.minor}"/>
Modified: core/branches/Branch_3_2/changelog.txt
===================================================================
--- core/branches/Branch_3_2/changelog.txt 2008-02-07 02:21:24 UTC (rev 14317)
+++ core/branches/Branch_3_2/changelog.txt 2008-02-07 02:34:08 UTC (rev 14318)
@@ -6,6 +6,65 @@
more about each case.
+Changes in version 3.2.6 (2008.02.07)
+-------------------------------------------
+
+** Bug
+ * [HHH-925] - DetachedCriteria.createCriteria not working with alias
+ * [HHH-1312] - Unclosed ResultSet when using Identity
+ * [HHH-1329] - SchemaValidator fail when views are involved
+ * [HHH-1593] - Infinite loop/StackOverflow when calling configuration.setListener(null)
+ * [HHH-1685] - DetachedCriteria doesn't create alias on subcriteria
+ * [HHH-1753] - DB2Dialect.getCurrentTimestampSQLFunctionName() uses Oracle syntax
+ * [HHH-1916] - param values in generator element should be trimmed during HbmBinding
+ * [HHH-1956] - Interceptor.afterTransactionCompletion not called with JTATransaction (CacheSynchronization.hibernateTransaction not set)
+ * [HHH-2016] - Oracle9Dialect registers last_day() function as "lastday"
+ * [HHH-2159] - NullPointerException in FromElement#findIntendedAliasedFromElementBasedOnCrazyJPARequirements with 'hibernate.query.jpaql_strict_compliance' enabled
+ * [HHH-2200] - Memory leak in AbstractBatcher with Generated Properties
+ * [HHH-2261] - Setting hibernate.hbm2ddl.auto=validate causes problems on mySQL with numeric fields
+ * [HHH-2320] - Regression: optional properties under a <join> tag no longer update properly
+ * [HHH-2503] - AbstractEntityPersister swallows JDBCExceptions in processGeneratedProperties
+ * [HHH-2542] - NullPointerException in TypeFactory.replaceAssociations for ComponentType
+ * [HHH-2593] - Keyword UNION is prefixed with "this_." in filter conditions
+ * [HHH-2598] - Mapping a collection of entities from two different classes with the same collection name results in duplicate backref property exception if collection keys are not null
+ * [HHH-2616] - No event is fired on Collection recreate/remove/update action
+ * [HHH-2627] - Generated properties leak prepared statements in Hibernate 3.2.3 and higher.
+ * [HHH-2728] - Calling session.clear() while retrieving objects via an iterator will cause a "LazyInitializationException - No Session" by the CGLIBLazyInitializer
+ * [HHH-2788] - Oracl8iDialect No Dialect mapping for JDBC type 91
+ * [HHH-2795] - CollectionLoadContexts for empy collections are not removed until PersistenceContext.clear()
+ * [HHH-2816] - DefaultFlushEntityEventListener.checkNaturalId() causes extra SELECTs on read-only entities
+ * [HHH-2833] - insert-select query fails with NPE when select includes join
+ * [HHH-2857] - schemaSupport for HSQLDialect remote connections doesn't work
+ * [HHH-2861] - cascade="delete-orphan,all" is ignored
+ * [HHH-2864] - Merging a detached instance with a new child in a unidirectional one-to-many association fails if the parent was previously loaded as a proxy
+ * [HHH-2892] - skip up-to-date checks of query cache for natural-id only if immutable
+ * [HHH-2928] - optimizers for enhanced id generators should be synchronized against multi-threaded access
+ * [HHH-2948] - QueryStatistics.executionMinTime always = 0
+
+** Improvement
+ * [HHH-1630] - duplicate property mapping - more details
+ * [HHH-1696] - Add outer join support for aliases on DetachedCriteria
+ * [HHH-2048] - Incomplete MappingException at org.hibernate.mapping.SimpleValue
+ * [HHH-2682] - support for auto-discovery of H2 dialect
+ * [HHH-2761] - Handle null and empty string consistently in PropertiesHelper
+ * [HHH-2822] - timestamp extraction functions for SAPDBDialect
+ * [HHH-2826] - IS [NOT] NULL checks with component values
+ * [HHH-2852] - Better error messages when schema validation fails
+
+** Patch
+ * [HHH-952] - Patch to allow subqueries with joins using Criteria API and Subqueries with DetachedCriteria
+ * [HHH-2070] - Expand DB2Dialect auto-discovery support (Martin Renner)
+ * [HHH-2839] - Don't use dummy dual table for hsqldb (David Bala?ic)
+ * [HHH-2849] - Better error logging in IdentifierGeneratorFactory (Antony Stubbs)
+ * [HHH-2957] - ActionQueue Insertion sort performance degrades exponentially (Jay Erb)
+ * [HHH-3084] - DialectFactory detection of Ingres metadata (Michael Leo)
+
+** Task
+ * [HHH-2559] - http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd needs to be updated
+ * [HHH-3085] - Remove connector.jar (unnecessary library)
+ * [HHH-3086] - Remove jdbc2_0-stdext.jar (unnecessary library)
+
+
Changes in version 3.2.5 (2007.07.31)
-------------------------------------------
Modified: core/branches/Branch_3_2/doc/reference/en/master.xml
===================================================================
--- core/branches/Branch_3_2/doc/reference/en/master.xml 2008-02-07 02:21:24 UTC (rev 14317)
+++ core/branches/Branch_3_2/doc/reference/en/master.xml 2008-02-07 02:34:08 UTC (rev 14318)
@@ -33,7 +33,7 @@
<bookinfo>
<title>HIBERNATE - Relational Persistence for Idiomatic Java</title>
<subtitle>Hibernate Reference Documentation</subtitle>
- <releaseinfo>3.2.5</releaseinfo>
+ <releaseinfo>3.2.6</releaseinfo>
</bookinfo>
<toc/>
Modified: core/branches/Branch_3_2/readme.txt
===================================================================
--- core/branches/Branch_3_2/readme.txt 2008-02-07 02:21:24 UTC (rev 14317)
+++ core/branches/Branch_3_2/readme.txt 2008-02-07 02:34:08 UTC (rev 14318)
@@ -1,6 +1,6 @@
Hibernate - Relational Persistence for Idiomatic Java
=====================================================
-version 3.2.5, July 31, 2007
+version 3.2.6, Feb 7, 2008
Instructions
------------
Modified: core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java 2008-02-07 02:21:24 UTC (rev 14317)
+++ core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java 2008-02-07 02:34:08 UTC (rev 14318)
@@ -153,7 +153,7 @@
*/
public final class Environment {
- public static final String VERSION = "3.2.5";
+ public static final String VERSION = "3.2.6";
/**
* <tt>ConnectionProvider</tt> implementor to use when obtaining connections
16 years, 10 months
Hibernate SVN: r14317 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:21:24 -0500 (Wed, 06 Feb 2008)
New Revision: 14317
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java
Log:
HHH-3084 : DialectFactory detection of Ingres metadata information
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java 2008-02-07 02:21:02 UTC (rev 14316)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/DialectFactory.java 2008-02-07 02:21:24 UTC (rev 14317)
@@ -112,12 +112,17 @@
// TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
private static final Map MAPPERS = new HashMap();
static {
+ // detectors...
MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
MAPPERS.put( "H2", new VersionInsensitiveMapper( "org.hibernate.dialect.H2Dialect" ) );
MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
MAPPERS.put( "PostgreSQL", new VersionInsensitiveMapper( "org.hibernate.dialect.PostgreSQLDialect" ) );
MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
+ MAPPERS.put( "Ingres", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+ MAPPERS.put( "ingres", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+ MAPPERS.put( "INGRES", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+
MAPPERS.put( "Microsoft SQL Server Database", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Microsoft SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Sybase SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
16 years, 10 months
Hibernate SVN: r14316 - core/branches/Branch_3_2/src/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:21:02 -0500 (Wed, 06 Feb 2008)
New Revision: 14316
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java
Log:
HHH-3084 : DialectFactory detection of Ingres metadata information
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java 2008-02-07 02:08:56 UTC (rev 14315)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/DialectFactory.java 2008-02-07 02:21:02 UTC (rev 14316)
@@ -112,12 +112,17 @@
// TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
private static final Map MAPPERS = new HashMap();
static {
+ // detectors...
MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
MAPPERS.put( "H2", new VersionInsensitiveMapper( "org.hibernate.dialect.H2Dialect" ) );
MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
MAPPERS.put( "PostgreSQL", new VersionInsensitiveMapper( "org.hibernate.dialect.PostgreSQLDialect" ) );
MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
+ MAPPERS.put( "Ingres", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+ MAPPERS.put( "ingres", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+ MAPPERS.put( "INGRES", new VersionInsensitiveMapper( "org.hibernate.dialect.IngresDialect" ) );
+
MAPPERS.put( "Microsoft SQL Server Database", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Microsoft SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
MAPPERS.put( "Sybase SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
16 years, 10 months
Hibernate SVN: r14315 - core/branches/Branch_3_2/src/org/hibernate/jdbc.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:08:56 -0500 (Wed, 06 Feb 2008)
New Revision: 14315
Modified:
core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java
Log:
HHH-1956 : Interceptor.afterTransactionCompletion() and JTA
Modified: core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java 2008-02-07 02:08:26 UTC (rev 14314)
+++ core/branches/Branch_3_2/src/org/hibernate/jdbc/JDBCContext.java 2008-02-07 02:08:56 UTC (rev 14315)
@@ -163,11 +163,15 @@
else {
javax.transaction.Transaction tx = tm.getTransaction();
if ( JTAHelper.isMarkedForRollback( tx ) ) {
+ // transactions marked for rollback-only cause some TM impls to throw exceptions
log.debug( "Transaction is marked for rollback; skipping Synchronization registration" );
return false;
}
else {
- tx.registerSynchronization( new CacheSynchronization(owner, this, tx, null) );
+ if ( hibernateTransaction == null ) {
+ hibernateTransaction = owner.getFactory().getSettings().getTransactionFactory().createTransaction( this, owner );
+ }
+ tx.registerSynchronization( new CacheSynchronization(owner, this, tx, hibernateTransaction) );
isTransactionCallbackRegistered = true;
log.debug("successfully registered Synchronization");
return true;
16 years, 10 months
Hibernate SVN: r14314 - core/trunk/core/src/main/java/org/hibernate/jdbc.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-02-06 21:08:26 -0500 (Wed, 06 Feb 2008)
New Revision: 14314
Modified:
core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java
Log:
HHH-1956 : Interceptor.afterTransactionCompletion() and JTA
Modified: core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java 2008-02-06 07:46:52 UTC (rev 14313)
+++ core/trunk/core/src/main/java/org/hibernate/jdbc/JDBCContext.java 2008-02-07 02:08:26 UTC (rev 14314)
@@ -163,11 +163,15 @@
else {
javax.transaction.Transaction tx = tm.getTransaction();
if ( JTAHelper.isMarkedForRollback( tx ) ) {
+ // transactions marked for rollback-only cause some TM impls to throw exceptions
log.debug( "Transaction is marked for rollback; skipping Synchronization registration" );
return false;
}
else {
- tx.registerSynchronization( new CacheSynchronization(owner, this, tx, null) );
+ if ( hibernateTransaction == null ) {
+ hibernateTransaction = owner.getFactory().getSettings().getTransactionFactory().createTransaction( this, owner );
+ }
+ tx.registerSynchronization( new CacheSynchronization(owner, this, tx, hibernateTransaction) );
isTransactionCallbackRegistered = true;
log.debug("successfully registered Synchronization");
return true;
16 years, 10 months
Hibernate SVN: r14313 - in core/branches/Branch_3_2: src/org/hibernate/event and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-02-06 02:46:52 -0500 (Wed, 06 Feb 2008)
New Revision: 14313
Added:
core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java
core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml
core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java
Modified:
core/branches/Branch_3_2/src/org/hibernate/action/CollectionRecreateAction.java
core/branches/Branch_3_2/src/org/hibernate/action/CollectionRemoveAction.java
core/branches/Branch_3_2/src/org/hibernate/action/CollectionUpdateAction.java
core/branches/Branch_3_2/src/org/hibernate/event/AbstractCollectionEvent.java
core/branches/Branch_3_2/src/org/hibernate/event/InitializeCollectionEvent.java
core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRecreateEvent.java
core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRemoveEvent.java
core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionUpdateEvent.java
core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRecreateEvent.java
core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRemoveEvent.java
core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionUpdateEvent.java
core/branches/Branch_3_2/test/org/hibernate/test/event/collection/AbstractCollectionEventTest.java
core/branches/Branch_3_2/test/org/hibernate/test/event/collection/BrokenCollectionEventTest.java
Log:
HHH-2616 : added getter for owner entitity name to collection events
Modified: core/branches/Branch_3_2/src/org/hibernate/action/CollectionRecreateAction.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/action/CollectionRecreateAction.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/action/CollectionRecreateAction.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -57,7 +57,7 @@
.getPreCollectionRecreateEventListeners();
if (preListeners.length > 0) {
PreCollectionRecreateEvent preEvent = new PreCollectionRecreateEvent(
- getCollection(), ( EventSource ) getSession() );
+ getPersister(), getCollection(), ( EventSource ) getSession() );
for ( int i = 0; i < preListeners.length; i++ ) {
preListeners[i].onPreRecreateCollection( preEvent );
}
@@ -69,7 +69,7 @@
.getPostCollectionRecreateEventListeners();
if (postListeners.length > 0) {
PostCollectionRecreateEvent postEvent = new PostCollectionRecreateEvent(
- getCollection(), ( EventSource ) getSession() );
+ getPersister(), getCollection(), ( EventSource ) getSession() );
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostRecreateCollection( postEvent );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/action/CollectionRemoveAction.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/action/CollectionRemoveAction.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/action/CollectionRemoveAction.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -110,9 +110,7 @@
.getPreCollectionRemoveEventListeners();
if (preListeners.length>0) {
PreCollectionRemoveEvent preEvent = new PreCollectionRemoveEvent(
- getCollection(),
- affectedOwner,
- ( EventSource )getSession() );
+ getPersister(), getCollection(), ( EventSource ) getSession(), affectedOwner );
for ( int i = 0; i < preListeners.length; i++ ) {
preListeners[i].onPreRemoveCollection(preEvent);
}
@@ -124,9 +122,7 @@
.getPostCollectionRemoveEventListeners();
if (postListeners.length>0) {
PostCollectionRemoveEvent postEvent = new PostCollectionRemoveEvent(
- getCollection(),
- affectedOwner,
- ( EventSource )getSession() );
+ getPersister(), getCollection(), ( EventSource ) getSession(), affectedOwner );
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostRemoveCollection(postEvent);
}
Modified: core/branches/Branch_3_2/src/org/hibernate/action/CollectionUpdateAction.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/action/CollectionUpdateAction.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/action/CollectionUpdateAction.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -85,7 +85,7 @@
.getPreCollectionUpdateEventListeners();
if (preListeners.length > 0) {
PreCollectionUpdateEvent preEvent = new PreCollectionUpdateEvent(
- getCollection(), ( EventSource ) getSession() );
+ getPersister(), getCollection(), ( EventSource ) getSession() );
for ( int i = 0; i < preListeners.length; i++ ) {
preListeners[i].onPreUpdateCollection( preEvent );
}
@@ -97,7 +97,7 @@
.getPostCollectionUpdateEventListeners();
if (postListeners.length > 0) {
PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(
- getCollection(), ( EventSource ) getSession() );
+ getPersister(), getCollection(), ( EventSource ) getSession() );
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostUpdateCollection( postEvent );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/AbstractCollectionEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/AbstractCollectionEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/AbstractCollectionEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -4,7 +4,9 @@
import java.io.Serializable;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.engine.CollectionEntry;
import org.hibernate.engine.EntityEntry;
+import org.hibernate.persister.collection.CollectionPersister;
/**
* Defines a base class for events involving collections.
@@ -16,6 +18,7 @@
private final PersistentCollection collection;
private final Object affectedOwner;
private final Serializable affectedOwnerId;
+ private final String affectedOwnerEntityName;
/**
* Constructs an AbstractCollectionEvent object.
@@ -28,16 +31,24 @@
* by this event; can be null if unavailable
* that is affected by this event; can be null if unavailable
*/
- public AbstractCollectionEvent(PersistentCollection collection,
- EventSource source,
- Object affectedOwner,
- Serializable affectedOwnerId ) {
+ public AbstractCollectionEvent( CollectionPersister collectionPersister,
+ PersistentCollection collection,
+ EventSource source,
+ Object affectedOwner,
+ Serializable affectedOwnerId) {
super(source);
this.collection = collection;
this.affectedOwner = affectedOwner;
this.affectedOwnerId = affectedOwnerId;
+ this.affectedOwnerEntityName =
+ getAffectedOwnerEntityName( collectionPersister, affectedOwner, source );
}
+ protected static CollectionPersister getLoadedCollectionPersister( PersistentCollection collection, EventSource source ) {
+ CollectionEntry ce = source.getPersistenceContext().getCollectionEntry( collection );
+ return ( ce == null ? null : ce.getLoadedPersister() );
+ }
+
protected static Object getLoadedOwnerOrNull( PersistentCollection collection, EventSource source ) {
return source.getPersistenceContext().getLoadedCollectionOwnerOrNull( collection );
}
@@ -51,6 +62,21 @@
return ( ownerEntry == null ? null : ownerEntry.getId() );
}
+ protected static String getAffectedOwnerEntityName(CollectionPersister collectionPersister, Object affectedOwner, EventSource source ) {
+
+ // collectionPersister should not be null, but we don't want to throw
+ // an exception if it is null
+ String entityName =
+ ( collectionPersister == null ? null : collectionPersister.getOwnerEntityPersister().getEntityName() );
+ if ( affectedOwner != null ) {
+ EntityEntry ee = source.getPersistenceContext().getEntry( affectedOwner );
+ if ( ee != null && ee.getEntityName() != null) {
+ entityName = ee.getEntityName();
+ }
+ }
+ return entityName;
+ }
+
public PersistentCollection getCollection() {
return collection;
}
@@ -75,4 +101,15 @@
public Serializable getAffectedOwnerIdOrNull() {
return affectedOwnerId;
}
+
+ /**
+ * Get the entity name for the collection owner entity that is affected by this event.
+ *
+ * @return the entity name; if the owner is not in the PersistenceContext, the
+ * returned value may be a superclass name, instead of the actual class name
+ */
+ public String getAffectedOwnerEntityName() {
+ return affectedOwnerEntityName;
+ }
+
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/InitializeCollectionEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/InitializeCollectionEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/InitializeCollectionEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -11,8 +11,10 @@
*/
public class InitializeCollectionEvent extends AbstractCollectionEvent {
- public InitializeCollectionEvent(PersistentCollection collection, EventSource source) {
- super( collection, source,
+ public InitializeCollectionEvent(PersistentCollection collection, EventSource source ) {
+ super( getLoadedCollectionPersister( collection, source ),
+ collection,
+ source,
getLoadedOwnerOrNull( collection, source ),
getLoadedOwnerIdOrNull( collection, source ) );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRecreateEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRecreateEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRecreateEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -2,6 +2,7 @@
package org.hibernate.event;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.persister.collection.CollectionPersister;
/**
* An event that occurs after a collection is recreated
@@ -10,8 +11,10 @@
*/
public class PostCollectionRecreateEvent extends AbstractCollectionEvent {
- public PostCollectionRecreateEvent(PersistentCollection collection, EventSource source) {
- super( collection, source,
+ public PostCollectionRecreateEvent( CollectionPersister collectionPersister,
+ PersistentCollection collection,
+ EventSource source ) {
+ super( collectionPersister, collection, source,
collection.getOwner(),
getOwnerIdOrNull( collection.getOwner(), source ) );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRemoveEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRemoveEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionRemoveEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -2,6 +2,7 @@
package org.hibernate.event;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.persister.collection.CollectionPersister;
/**
* An event that occurs after a collection is removed
@@ -10,8 +11,11 @@
*/
public class PostCollectionRemoveEvent extends AbstractCollectionEvent {
- public PostCollectionRemoveEvent(PersistentCollection collection, Object loadedOwner, EventSource source) {
- super( collection, source,
+ public PostCollectionRemoveEvent(CollectionPersister collectionPersister,
+ PersistentCollection collection,
+ EventSource source,
+ Object loadedOwner ) {
+ super( collectionPersister, collection, source,
loadedOwner,
getOwnerIdOrNull( loadedOwner, source ) );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionUpdateEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionUpdateEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/PostCollectionUpdateEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -2,6 +2,7 @@
package org.hibernate.event;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.persister.collection.CollectionPersister;
/**
* An event that occurs after a collection is updated
@@ -10,8 +11,10 @@
*/
public class PostCollectionUpdateEvent extends AbstractCollectionEvent {
- public PostCollectionUpdateEvent(PersistentCollection collection, EventSource source) {
- super( collection, source,
+ public PostCollectionUpdateEvent(CollectionPersister collectionPersister,
+ PersistentCollection collection,
+ EventSource source) {
+ super( collectionPersister, collection, source,
getLoadedOwnerOrNull( collection, source ),
getLoadedOwnerIdOrNull( collection, source ) );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRecreateEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRecreateEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRecreateEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -2,6 +2,7 @@
package org.hibernate.event;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.persister.collection.CollectionPersister;
/**
* An event that occurs before a collection is recreated
@@ -10,8 +11,10 @@
*/
public class PreCollectionRecreateEvent extends AbstractCollectionEvent {
- public PreCollectionRecreateEvent(PersistentCollection collection, EventSource source) {
- super( collection, source,
+ public PreCollectionRecreateEvent(CollectionPersister collectionPersister,
+ PersistentCollection collection,
+ EventSource source) {
+ super( collectionPersister, collection, source,
collection.getOwner(),
getOwnerIdOrNull( collection.getOwner(), source ) );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRemoveEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRemoveEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionRemoveEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -2,6 +2,7 @@
package org.hibernate.event;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.persister.collection.CollectionPersister;
/**
* An event that occurs before a collection is removed
@@ -10,8 +11,11 @@
*/
public class PreCollectionRemoveEvent extends AbstractCollectionEvent {
- public PreCollectionRemoveEvent(PersistentCollection collection, Object loadedOwner, EventSource source) {
- super( collection, source,
+ public PreCollectionRemoveEvent(CollectionPersister collectionPersister,
+ PersistentCollection collection,
+ EventSource source,
+ Object loadedOwner) {
+ super( collectionPersister, collection, source,
loadedOwner,
getOwnerIdOrNull( loadedOwner, source ) );
}
Modified: core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionUpdateEvent.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionUpdateEvent.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/src/org/hibernate/event/PreCollectionUpdateEvent.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -2,6 +2,7 @@
package org.hibernate.event;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.persister.collection.CollectionPersister;
/**
* An event that occurs before a collection is updated
@@ -10,8 +11,10 @@
*/
public class PreCollectionUpdateEvent extends AbstractCollectionEvent {
- public PreCollectionUpdateEvent(PersistentCollection collection, EventSource source) {
- super( collection, source,
+ public PreCollectionUpdateEvent(CollectionPersister collectionPersister,
+ PersistentCollection collection,
+ EventSource source) {
+ super( collectionPersister, collection, source,
getLoadedOwnerOrNull( collection, source ),
getLoadedOwnerIdOrNull( collection, source ) );
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/event/collection/AbstractCollectionEventTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/event/collection/AbstractCollectionEventTest.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/test/org/hibernate/test/event/collection/AbstractCollectionEventTest.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -767,6 +767,10 @@
ownerExpected.getId(),
( ( AbstractCollectionEvent ) listeners.getEvents().get( index ) ).getAffectedOwnerIdOrNull()
);
+ assertEquals(
+ ownerExpected.getClass().getName(),
+ ( ( AbstractCollectionEvent ) listeners.getEvents().get( index ) ).getAffectedOwnerEntityName()
+ );
assertSame(
collExpected, ( ( AbstractCollectionEvent ) listeners.getEvents().get( index ) ).getCollection()
);
Modified: core/branches/Branch_3_2/test/org/hibernate/test/event/collection/BrokenCollectionEventTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/event/collection/BrokenCollectionEventTest.java 2008-02-05 23:55:35 UTC (rev 14312)
+++ core/branches/Branch_3_2/test/org/hibernate/test/event/collection/BrokenCollectionEventTest.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -317,6 +317,10 @@
ownerExpected.getId(),
( ( AbstractCollectionEvent ) listeners.getEvents().get( index ) ).getAffectedOwnerIdOrNull()
);
+ assertEquals(
+ ownerExpected.getClass().getName(),
+ ( ( AbstractCollectionEvent ) listeners.getEvents().get( index ) ).getAffectedOwnerEntityName()
+ );
assertSame(
collExpected, ( ( AbstractCollectionEvent ) listeners.getEvents().get( index ) ).getCollection()
);
Added: core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java (rev 0)
+++ core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassCollectionEventTest.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -0,0 +1,57 @@
+//$Id: $
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution statements
+ * applied by the authors.
+ *
+ * All third-party contributions are distributed under license by Red Hat
+ * Middleware LLC. This copyrighted material is made available to anyone
+ * wishing to use, modify, copy, or redistribute it subject to the terms
+ * and conditions of the GNU Lesser General Public License, as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License for more details. You should
+ * have received a copy of the GNU Lesser General Public License along with
+ * this distribution; if not, write to: Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
+ */
+package org.hibernate.test.event.collection.association.bidirectional.onetomany;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import junit.framework.Test;
+
+import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+import org.hibernate.test.event.collection.Child;
+import org.hibernate.test.event.collection.ParentWithCollection;
+import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
+import org.hibernate.test.event.collection.association.bidirectional.onetomany.ChildWithManyToOne;
+import org.hibernate.test.event.collection.association.bidirectional.onetomany.ParentWithBidirectionalOneToMany;
+
+/**
+ *
+ * @author Gail Badner
+ */
+public class BidirectionalOneToManyBagSubclassCollectionEventTest extends BidirectionalOneToManyBagCollectionEventTest {
+
+ public BidirectionalOneToManyBagSubclassCollectionEventTest(String string) {
+ super( string );
+ }
+
+ public static Test suite() {
+ return new FunctionalTestClassTestSuite( BidirectionalOneToManyBagSubclassCollectionEventTest.class );
+ }
+
+ public String[] getMappings() {
+ return new String[] { "event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml" };
+ }
+
+ public ParentWithCollection createParent(String name) {
+ return new ParentWithBidirectionalOneToManySubclass( name );
+ }
+}
\ No newline at end of file
Added: core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml (rev 0)
+++ core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/BidirectionalOneToManyBagSubclassMapping.hbm.xml 2008-02-06 07:46:52 UTC (rev 14313)
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+-->
+
+<hibernate-mapping package="org.hibernate.test.event.collection.association.bidirectional.onetomany">
+
+ <class name="ParentWithBidirectionalOneToMany" table="PARENT" discriminator-value="P">
+ <id name="id" column="ID" type="long">
+ <generator class="native"/>
+ </id>
+
+ <discriminator column="TYPE" type="string" length="1"/>
+
+ <bag name="children"
+ inverse="true"
+ cascade="all">
+ <key column="parent_id"/>
+ <one-to-many class="ChildWithManyToOne"/>
+ </bag>
+
+ <subclass name="ParentWithBidirectionalOneToManySubclass"
+ discriminator-value="S">
+ </subclass>
+ </class>
+
+ <class name="ChildWithManyToOne" table="CHILD">
+ <id name="id" column="ID" type="long">
+ <generator class="native"/>
+ </id>
+ <property name="name" column="NAME" type="string"/>
+ <many-to-one name="parent" column="parent_id" class="ParentWithBidirectionalOneToMany" cascade="none"/>
+ </class>
+
+</hibernate-mapping>
Added: core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java (rev 0)
+++ core/branches/Branch_3_2/test/org/hibernate/test/event/collection/association/bidirectional/onetomany/ParentWithBidirectionalOneToManySubclass.java 2008-02-06 07:46:52 UTC (rev 14313)
@@ -0,0 +1,42 @@
+//$Id: $
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution statements
+ * applied by the authors.
+ *
+ * All third-party contributions are distributed under license by Red Hat
+ * Middleware LLC. This copyrighted material is made available to anyone
+ * wishing to use, modify, copy, or redistribute it subject to the terms
+ * and conditions of the GNU Lesser General Public License, as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License for more details. You should
+ * have received a copy of the GNU Lesser General Public License along with
+ * this distribution; if not, write to: Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
+ */
+package org.hibernate.test.event.collection.association.bidirectional.onetomany;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.hibernate.test.event.collection.Child;
+import org.hibernate.test.event.collection.AbstractParentWithCollection;
+
+/**
+ *
+ * @author Gail Badner
+ */
+public class ParentWithBidirectionalOneToManySubclass extends ParentWithBidirectionalOneToMany {
+ public ParentWithBidirectionalOneToManySubclass() {
+ }
+
+ public ParentWithBidirectionalOneToManySubclass(String name) {
+ super( name );
+ }
+
+}
\ No newline at end of file
16 years, 10 months