Author: adamw
Date: 2009-05-22 02:45:23 -0400 (Fri, 22 May 2009)
New Revision: 16612
Modified:
core/branches/envers-hibernate-3.3/pom.xml
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/ant/AnnotationConfigurationTaskWithEnvers.java
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java
core/branches/envers-hibernate-3.3/src/main/java/org/jboss/envers/VersionsReaderFactory.java
Log:
svn merge -r 16502:16611
https://svn.jboss.org/repos/hibernate/core/trunk/envers .
Modified: core/branches/envers-hibernate-3.3/pom.xml
===================================================================
--- core/branches/envers-hibernate-3.3/pom.xml 2009-05-21 16:00:20 UTC (rev 16611)
+++ core/branches/envers-hibernate-3.3/pom.xml 2009-05-22 06:45:23 UTC (rev 16612)
@@ -70,8 +70,8 @@
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
+ <groupId>org.hibernate.java-persistence</groupId>
+ <artifactId>jpa-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@@ -149,9 +149,9 @@
<version>3.2.0.ga</version>
</dependency>
<dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
+ <groupId>org.hibernate.java-persistence</groupId>
+ <artifactId>jpa-api</artifactId>
+ <version>2.0.Beta2</version>
</dependency>
<dependency>
<groupId>ant</groupId>
Modified:
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/ant/AnnotationConfigurationTaskWithEnvers.java
===================================================================
---
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/ant/AnnotationConfigurationTaskWithEnvers.java 2009-05-21
16:00:20 UTC (rev 16611)
+++
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/ant/AnnotationConfigurationTaskWithEnvers.java 2009-05-22
06:45:23 UTC (rev 16612)
@@ -33,8 +33,8 @@
*/
public class AnnotationConfigurationTaskWithEnvers extends AnnotationConfigurationTask {
protected void doConfiguration(Configuration configuration) {
- AuditConfiguration.getFor(configuration);
-
- super.doConfiguration(configuration);
+ super.doConfiguration(configuration);
+ configuration.buildMappings();
+ AuditConfiguration.getFor(configuration);
}
}
Modified:
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java
===================================================================
---
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java 2009-05-21
16:00:20 UTC (rev 16611)
+++
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java 2009-05-22
06:45:23 UTC (rev 16612)
@@ -161,6 +161,11 @@
EntityConfiguration referencedEntityConfiguration =
mainGenerator.getEntitiesConfigurations()
.get(referencedEntityName);
+ if (referencedEntityConfiguration == null) {
+ throwRelationNotAudited(referencedEntityName);
+ // Impossible to get here.
+ throw new AssertionError();
+ }
IdMappingData referencedIdMapping =
referencedEntityConfiguration.getIdMappingData();
IdMappingData referencingIdMapping =
referencingEntityConfiguration.getIdMappingData();
@@ -378,8 +383,14 @@
String prefixRelated = prefix + "_";
String referencedEntityName = getReferencedEntityName(value);
- IdMappingData referencedIdMapping =
mainGenerator.getEntitiesConfigurations()
- .get(referencedEntityName).getIdMappingData();
+ EntityConfiguration referencedEntityConfiguration =
mainGenerator.getEntitiesConfigurations()
+ .get(referencedEntityName);
+ if (referencedEntityConfiguration == null) {
+ throwRelationNotAudited(referencedEntityName);
+ // Impossible to get here.
+ throw new AssertionError();
+ }
+ IdMappingData referencedIdMapping =
referencedEntityConfiguration.getIdMappingData();
// Adding related-entity (in this case: the referenced entities id) id
mapping to the xml only if the
// relation isn't inverse (so when <code>xmlMapping</code> is
not null).
@@ -520,4 +531,9 @@
throw new MappingException("Unable to read the mapped by attribute for
" + propertyName + " in "
+ referencingEntityName + "!");
}
+
+ private void throwRelationNotAudited(String referencedEntityName) {
+ throw new MappingException("An audited relation from " +
referencingEntityName +
+ " to a non-audited entity: " + referencedEntityName);
+ }
}
Property changes on:
core/branches/envers-hibernate-3.3/src/main/java/org/jboss/envers/VersionsReaderFactory.java
___________________________________________________________________
Name: svn:mergeinfo
-