Author: adamw
Date: 2008-08-22 08:19:38 -0400 (Fri, 22 Aug 2008)
New Revision: 122
Modified:
trunk/src/main/org/jboss/envers/configuration/metadata/VersionsMetadataGenerator.java
Log:
ENVERS-39: checking if a property is versioned in one place
Modified:
trunk/src/main/org/jboss/envers/configuration/metadata/VersionsMetadataGenerator.java
===================================================================
---
trunk/src/main/org/jboss/envers/configuration/metadata/VersionsMetadataGenerator.java 2008-08-22
12:03:52 UTC (rev 121)
+++
trunk/src/main/org/jboss/envers/configuration/metadata/VersionsMetadataGenerator.java 2008-08-22
12:19:38 UTC (rev 122)
@@ -385,13 +385,19 @@
// TODO: ???
}
- private ModificationStore getStoreForProperty(Property property, PropertyStoreInfo
propertyStoreInfo) {
+ private ModificationStore getStoreForProperty(Property property, PropertyStoreInfo
propertyStoreInfo,
+ List<String>
unversionedProperties) {
/*
* Checks if a property is versioned, which is when:
+ * - the property isn't unversioned
* - the whole entity is versioned, then the default store is not null
* - there is a store defined for this entity, which is when this property is
annotated
*/
+ if (unversionedProperties.contains(property.getName())) {
+ return null;
+ }
+
ModificationStore store =
propertyStoreInfo.propertyStores.get(property.getName());
if (store == null) {
@@ -424,10 +430,9 @@
Property property = properties.next();
Type propertyType = property.getType();
if (!"_identifierMapper".equals(property.getName())) {
- ModificationStore store = getStoreForProperty(property,
propertyStoreInfo);
+ ModificationStore store = getStoreForProperty(property,
propertyStoreInfo, unversionedProperties);
- // check if the store isn't empty and the property isn't
unversioned
- if (store != null && !unversionedProperties.contains(property.getName())) {
+ if (store != null) {
if (propertyType instanceof ComponentType) {
// only first pass
if (firstPass) {
Show replies by date