Author: adamw
Date: 2008-08-16 08:03:50 -0400 (Sat, 16 Aug 2008)
New Revision: 107
Modified:
trunk/src/main/org/jboss/envers/query/criteria/AggregatedFieldVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/BetweenVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/CriteriaTools.java
trunk/src/main/org/jboss/envers/query/criteria/IdentifierEqVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/IlikeVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/InVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/LogicalVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/NotNullVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/NotVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/NullVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/PropertyVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/RelatedVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/RevisionVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/SimpleVersionsExpression.java
trunk/src/main/org/jboss/envers/query/criteria/VersionsConjunction.java
trunk/src/main/org/jboss/envers/query/criteria/VersionsCriterion.java
trunk/src/main/org/jboss/envers/query/criteria/VersionsDisjunction.java
trunk/src/main/org/jboss/envers/query/impl/EntitiesAtRevisionQuery.java
trunk/src/main/org/jboss/envers/query/impl/RevisionsOfEntityQuery.java
Log:
ENVERS-37: componentizing configuration - criterions do not depend on VersionsReader
Modified:
trunk/src/main/org/jboss/envers/query/criteria/AggregatedFieldVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/AggregatedFieldVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/AggregatedFieldVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -22,8 +22,8 @@
package org.jboss.envers.query.criteria;
import org.hibernate.criterion.*;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
import java.util.List;
import java.util.ArrayList;
@@ -52,11 +52,11 @@
return this;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- CriteriaTools.checkPropertyNotARelation(versionsReader, entityName,
propertyName);
+ CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
- String versionsEntityName =
versionsReader.getVerCfg().getVerEntCfg().getVersionsEntityName(entityName);
+ String versionsEntityName =
verCfg.getVerEntCfg().getVersionsEntityName(entityName);
// This will be the aggregated criteria, containing all the specified conditions
DetachedCriteria aggregatedCriteria =
DetachedCriteria.forEntityName(versionsEntityName);
@@ -68,7 +68,7 @@
// First adding all specified conditions both to the main criteria, as well as to
the
// aggregated one.
for (VersionsCriterion versionsCriteria : criterions) {
- Criterion transformedCriterion =
versionsCriteria.toVersionsCriterion(entityName, versionsReader);
+ Criterion transformedCriterion = versionsCriteria.toVersionsCriterion(verCfg,
entityName);
conjunction.add(transformedCriterion);
aggregatedCriteria.add(transformedCriterion);
Modified: trunk/src/main/org/jboss/envers/query/criteria/BetweenVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/BetweenVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/BetweenVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -23,8 +23,8 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -40,9 +40,9 @@
this.hi = hi;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- CriteriaTools.checkPropertyNotARelation(versionsReader, entityName,
propertyName);
+ CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
return Restrictions.between(propertyName, lo, hi);
}
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/CriteriaTools.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/CriteriaTools.java 2008-08-15 14:00:41
UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/CriteriaTools.java 2008-08-16 12:03:50
UTC (rev 107)
@@ -21,9 +21,9 @@
*/
package org.jboss.envers.query.criteria;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
import org.jboss.envers.configuration.RelationDescription;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -31,18 +31,17 @@
public class CriteriaTools {
private CriteriaTools() { }
- public static void checkPropertyNotARelation(VersionsReaderImplementor
versionsReader, String entityName,
+ public static void checkPropertyNotARelation(VersionsConfiguration verCfg, String
entityName,
String propertyName) throws
VersionsException {
- if
(versionsReader.getVerCfg().getEntCfg().get(entityName).isRelation(propertyName)) {
+ if (verCfg.getEntCfg().get(entityName).isRelation(propertyName)) {
throw new VersionsException("This criterion cannot be used on a property
that is " +
"a relation to another property.");
}
}
- public static RelationDescription getRelatedEntity(VersionsReaderImplementor
versionsReader, String entityName,
+ public static RelationDescription getRelatedEntity(VersionsConfiguration verCfg,
String entityName,
String propertyName) throws
VersionsException {
- RelationDescription relationDesc = versionsReader.getVerCfg()
- .getEntCfg().get(entityName).getRelationDescription(propertyName);
+ RelationDescription relationDesc =
verCfg.getEntCfg().get(entityName).getRelationDescription(propertyName);
if (relationDesc == null) {
return null;
Modified:
trunk/src/main/org/jboss/envers/query/criteria/IdentifierEqVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/IdentifierEqVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/IdentifierEqVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -22,8 +22,8 @@
package org.jboss.envers.query.criteria;
import org.hibernate.criterion.Criterion;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -35,9 +35,9 @@
this.id = id;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- return versionsReader.getVerCfg().getEntCfg().getIdMapper(entityName)
- .getIdEqualsCriterion(id,
versionsReader.getVerCfg().getVerEntCfg().getOriginalIdPropName(), true);
+ return verCfg.getEntCfg().getIdMapper(entityName)
+ .getIdEqualsCriterion(id, verCfg.getVerEntCfg().getOriginalIdPropName(),
true);
}
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/IlikeVersionsExpression.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/IlikeVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/IlikeVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -24,8 +24,8 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -43,9 +43,9 @@
this(propertyName, matchMode.toMatchString(value));
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- CriteriaTools.checkPropertyNotARelation(versionsReader, entityName,
propertyName);
+ CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
return Restrictions.ilike(propertyName, value);
}
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/InVersionsExpression.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/InVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/InVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -23,8 +23,8 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -38,9 +38,9 @@
this.values = values;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- CriteriaTools.checkPropertyNotARelation(versionsReader, entityName,
propertyName);
+ CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
return Restrictions.in(propertyName, values);
}
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/LogicalVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/LogicalVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/LogicalVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -22,8 +22,8 @@
package org.jboss.envers.query.criteria;
import org.hibernate.criterion.Criterion;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -39,9 +39,9 @@
this.op = op;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- return new PublicLogicalExpression(lhs.toVersionsCriterion(null,
versionsReader),
- rhs.toVersionsCriterion(null, versionsReader), op);
+ return new PublicLogicalExpression(lhs.toVersionsCriterion(verCfg, null),
+ rhs.toVersionsCriterion(verCfg, null), op);
}
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/NotNullVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/NotNullVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/NotNullVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -23,9 +23,9 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
import org.jboss.envers.configuration.RelationDescription;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -37,9 +37,9 @@
this.propertyName = propertyName;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- RelationDescription relatedEntity =
CriteriaTools.getRelatedEntity(versionsReader, entityName, propertyName);
+ RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg,
entityName, propertyName);
if (relatedEntity == null) {
return Restrictions.isNotNull(propertyName);
Modified: trunk/src/main/org/jboss/envers/query/criteria/NotVersionsExpression.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/NotVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/NotVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -23,8 +23,8 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -36,8 +36,8 @@
this.criterion = criterion;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- return Restrictions.not(criterion.toVersionsCriterion(null, versionsReader));
+ return Restrictions.not(criterion.toVersionsCriterion(verCfg, null));
}
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/NullVersionsExpression.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/NullVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/NullVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -23,9 +23,9 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
import org.jboss.envers.configuration.RelationDescription;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -37,9 +37,9 @@
this.propertyName = propertyName;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- RelationDescription relatedEntity =
CriteriaTools.getRelatedEntity(versionsReader, entityName, propertyName);
+ RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg,
entityName, propertyName);
if (relatedEntity == null) {
return Restrictions.isNull(propertyName);
Modified: trunk/src/main/org/jboss/envers/query/criteria/PropertyVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/PropertyVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/PropertyVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -22,8 +22,8 @@
package org.jboss.envers.query.criteria;
import org.hibernate.criterion.Criterion;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -39,10 +39,10 @@
this.op = op;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- CriteriaTools.checkPropertyNotARelation(versionsReader, entityName,
propertyName);
- CriteriaTools.checkPropertyNotARelation(versionsReader, entityName,
otherPropertyName);
+ CriteriaTools.checkPropertyNotARelation(verCfg, entityName, propertyName);
+ CriteriaTools.checkPropertyNotARelation(verCfg, entityName, otherPropertyName);
return new PublicPropertyExpression(propertyName, otherPropertyName, op);
}
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/RelatedVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/RelatedVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/RelatedVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -22,9 +22,9 @@
package org.jboss.envers.query.criteria;
import org.hibernate.criterion.Criterion;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
import org.jboss.envers.configuration.RelationDescription;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -40,9 +40,9 @@
this.equals = equals;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- RelationDescription relatedEntity =
CriteriaTools.getRelatedEntity(versionsReader, entityName, propertyName);
+ RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg,
entityName, propertyName);
if (relatedEntity == null) {
throw new VersionsException("This criterion can only be used on a
property that is " +
Modified: trunk/src/main/org/jboss/envers/query/criteria/RevisionVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/RevisionVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/RevisionVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -22,8 +22,8 @@
package org.jboss.envers.query.criteria;
import org.hibernate.criterion.Criterion;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -37,9 +37,9 @@
this.op = op;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- return new
PublicSimpleExpression(versionsReader.getVerCfg().getVerEntCfg().getRevisionPropPath(),
+ return new PublicSimpleExpression(verCfg.getVerEntCfg().getRevisionPropPath(),
value, op, false);
}
}
\ No newline at end of file
Modified: trunk/src/main/org/jboss/envers/query/criteria/SimpleVersionsExpression.java
===================================================================
---
trunk/src/main/org/jboss/envers/query/criteria/SimpleVersionsExpression.java 2008-08-15
14:00:41 UTC (rev 106)
+++
trunk/src/main/org/jboss/envers/query/criteria/SimpleVersionsExpression.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -22,9 +22,9 @@
package org.jboss.envers.query.criteria;
import org.hibernate.criterion.Criterion;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
import org.jboss.envers.configuration.RelationDescription;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
@@ -48,9 +48,9 @@
this.ignoreCase = ignoreCase;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
- RelationDescription relatedEntity =
CriteriaTools.getRelatedEntity(versionsReader, entityName, propertyName);
+ RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(verCfg,
entityName, propertyName);
if (relatedEntity == null) {
return new PublicSimpleExpression(propertyName, value, op, ignoreCase);
Modified: trunk/src/main/org/jboss/envers/query/criteria/VersionsConjunction.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/VersionsConjunction.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/VersionsConjunction.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -24,8 +24,8 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Conjunction;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
import java.util.ArrayList;
import java.util.List;
@@ -45,12 +45,12 @@
return this;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
Conjunction conjunction = Restrictions.conjunction();
for (VersionsCriterion criterion : criterions) {
- conjunction.add(criterion.toVersionsCriterion(null, versionsReader));
+ conjunction.add(criterion.toVersionsCriterion(verCfg, null));
}
return conjunction;
Modified: trunk/src/main/org/jboss/envers/query/criteria/VersionsCriterion.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/VersionsCriterion.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/VersionsCriterion.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -23,11 +23,11 @@
import org.hibernate.criterion.Criterion;
import org.jboss.envers.exception.VersionsException;
-import org.jboss.envers.reader.VersionsReaderImplementor;
+import org.jboss.envers.configuration.VersionsConfiguration;
/**
* @author Adam Warski (adam at warski dot org)
*/
public interface VersionsCriterion {
- Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader) throws VersionsException;
+ Criterion toVersionsCriterion(VersionsConfiguration verCfg, String entityName) throws
VersionsException;
}
Modified: trunk/src/main/org/jboss/envers/query/criteria/VersionsDisjunction.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/criteria/VersionsDisjunction.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/criteria/VersionsDisjunction.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -24,8 +24,8 @@
import org.hibernate.criterion.Disjunction;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
-import org.jboss.envers.reader.VersionsReaderImplementor;
import org.jboss.envers.exception.VersionsException;
+import org.jboss.envers.configuration.VersionsConfiguration;
import java.util.List;
import java.util.ArrayList;
@@ -45,12 +45,12 @@
return this;
}
- public Criterion toVersionsCriterion(String entityName, VersionsReaderImplementor
versionsReader)
+ public Criterion toVersionsCriterion(VersionsConfiguration verCfg, String
entityName)
throws VersionsException {
Disjunction conjunction = Restrictions.disjunction();
for (VersionsCriterion criterion : criterions) {
- conjunction.add(criterion.toVersionsCriterion(null, versionsReader));
+ conjunction.add(criterion.toVersionsCriterion(verCfg, null));
}
return conjunction;
Modified: trunk/src/main/org/jboss/envers/query/impl/EntitiesAtRevisionQuery.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/impl/EntitiesAtRevisionQuery.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/impl/EntitiesAtRevisionQuery.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -73,7 +73,7 @@
versionsCriteria.add(Property.forName(revisionPropertyPath).eq(maxRevCriteria));
// all specified conditions, transformed
for (VersionsCriterion criterion : criterions) {
- versionsCriteria.add(criterion.toVersionsCriterion(entityName,
versionsReader));
+
versionsCriteria.add(criterion.toVersionsCriterion(versionsReader.getVerCfg(),
entityName));
}
List queryResult = versionsCriteria.list();
Modified: trunk/src/main/org/jboss/envers/query/impl/RevisionsOfEntityQuery.java
===================================================================
--- trunk/src/main/org/jboss/envers/query/impl/RevisionsOfEntityQuery.java 2008-08-15
14:00:41 UTC (rev 106)
+++ trunk/src/main/org/jboss/envers/query/impl/RevisionsOfEntityQuery.java 2008-08-16
12:03:50 UTC (rev 107)
@@ -68,7 +68,7 @@
// all specified conditions, transformed
for (VersionsCriterion criterion : criterions) {
- versionsCriteria.add(criterion.toVersionsCriterion(entityName,
versionsReader));
+
versionsCriteria.add(criterion.toVersionsCriterion(versionsReader.getVerCfg(),
entityName));
}
if (!hasProjection && !hasOrder) {