Author: adamw
Date: 2009-11-04 13:40:13 -0500 (Wed, 04 Nov 2009)
New Revision: 17912
Removed:
core/trunk/envers/src/main/java/org/jboss/envers/
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java
core/trunk/envers/src/main/java/org/hibernate/envers/exception/AuditException.java
core/trunk/envers/src/main/java/org/hibernate/envers/exception/NotAuditedException.java
core/trunk/envers/src/main/java/org/hibernate/envers/exception/RevisionDoesNotExistException.java
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImplementor.java
Log:
Removing the org.jboss compatibility classes
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java
===================================================================
---
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java 2009-11-04
16:24:28 UTC (rev 17911)
+++
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java 2009-11-04
18:40:13 UTC (rev 17912)
@@ -36,7 +36,6 @@
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.jboss.envers.*;
/**
* A helper class to read versioning meta-data from annotations on a persistent class.
@@ -69,12 +68,7 @@
if (defaultAudited != null) {
return defaultAudited.modStore();
} else {
- Versioned defaultVersioned = clazz.getAnnotation(Versioned.class);
- if (defaultVersioned != null) {
- return ModificationStore.FULL;
- } else {
- return null;
- }
+ return null;
}
}
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java
===================================================================
---
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java 2009-11-04
16:24:28 UTC (rev 17911)
+++
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java 2009-11-04
18:40:13 UTC (rev 17912)
@@ -26,7 +26,6 @@
import org.hibernate.mapping.Property;
import org.hibernate.mapping.Value;
import org.hibernate.MappingException;
-import org.jboss.envers.Versioned;
/**
* Reads persistent properties form a
@@ -157,12 +156,9 @@
// Checking if this property is explicitly audited or if all properties are.
Audited aud = property.getAnnotation(Audited.class);
- Versioned ver = property.getAnnotation(Versioned.class);
if (aud != null) {
propertyData.setStore(aud.modStore());
propertyData.setRelationTargetAuditMode(aud.targetAuditMode());
- } else if (ver != null) {
- propertyData.setStore(ModificationStore.FULL);
} else {
if (defaultStore != null) {
propertyData.setStore(defaultStore);
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/exception/AuditException.java
===================================================================
---
core/trunk/envers/src/main/java/org/hibernate/envers/exception/AuditException.java 2009-11-04
16:24:28 UTC (rev 17911)
+++
core/trunk/envers/src/main/java/org/hibernate/envers/exception/AuditException.java 2009-11-04
18:40:13 UTC (rev 17912)
@@ -23,13 +23,15 @@
*/
package org.hibernate.envers.exception;
-import org.jboss.envers.exception.VersionsException;
+import org.hibernate.HibernateException;
/**
* @author Adam Warski (adam at warski dot org)
*/
-public class AuditException extends VersionsException {
- public AuditException(String message) {
+public class AuditException extends HibernateException {
+ private static final long serialVersionUID = 4306480965630972168L;
+
+ public AuditException(String message) {
super(message);
}
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/exception/NotAuditedException.java
===================================================================
---
core/trunk/envers/src/main/java/org/hibernate/envers/exception/NotAuditedException.java 2009-11-04
16:24:28 UTC (rev 17911)
+++
core/trunk/envers/src/main/java/org/hibernate/envers/exception/NotAuditedException.java 2009-11-04
18:40:13 UTC (rev 17912)
@@ -23,13 +23,20 @@
*/
package org.hibernate.envers.exception;
-import org.jboss.envers.exception.NotVersionedException;
-
/**
* @author Adam Warski (adam at warski dot org)
*/
-public class NotAuditedException extends NotVersionedException {
- public NotAuditedException(String entityName, String message) {
- super(entityName, message);
+public class NotAuditedException extends AuditException {
+ private static final long serialVersionUID = 4809674577449455510L;
+
+ private final String entityName;
+
+ public NotAuditedException(String entityName, String message) {
+ super(message);
+ this.entityName = entityName;
}
+
+ public String getEntityName() {
+ return entityName;
+ }
}
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/exception/RevisionDoesNotExistException.java
===================================================================
---
core/trunk/envers/src/main/java/org/hibernate/envers/exception/RevisionDoesNotExistException.java 2009-11-04
16:24:28 UTC (rev 17911)
+++
core/trunk/envers/src/main/java/org/hibernate/envers/exception/RevisionDoesNotExistException.java 2009-11-04
18:40:13 UTC (rev 17912)
@@ -28,12 +28,27 @@
/**
* @author Adam Warski (adam at warski dot org)
*/
-public class RevisionDoesNotExistException extends
org.jboss.envers.exception.RevisionDoesNotExistException {
- public RevisionDoesNotExistException(Number revision) {
- super(revision);
+public class RevisionDoesNotExistException extends AuditException {
+ private static final long serialVersionUID = -6417768274074962282L;
+
+ private Number revision;
+ private Date date;
+
+ public RevisionDoesNotExistException(Number revision) {
+ super("Revision " + revision + " does not exist.");
+ this.revision = revision;
}
public RevisionDoesNotExistException(Date date) {
- super(date);
+ super("There is no revision before or at " + date + ".");
+ this.date = date;
}
+
+ public Number getRevision() {
+ return revision;
+ }
+
+ public Date getDate() {
+ return date;
+ }
}
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java
===================================================================
---
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java 2009-11-04
16:24:28 UTC (rev 17911)
+++
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java 2009-11-04
18:40:13 UTC (rev 17912)
@@ -32,6 +32,7 @@
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.exception.AuditException;
import org.hibernate.envers.query.AuditEntity;
+import org.hibernate.envers.query.AuditQueryCreator;
import static org.hibernate.envers.tools.ArgumentsTools.checkNotNull;
import static org.hibernate.envers.tools.ArgumentsTools.checkPositive;
import org.hibernate.envers.synchronization.AuditSync;
@@ -41,7 +42,6 @@
import org.hibernate.Session;
import org.hibernate.event.EventSource;
import org.hibernate.engine.SessionImplementor;
-import org.jboss.envers.query.VersionsQueryCreator;
/**
* @author Adam Warski (adam at warski dot org)
@@ -205,7 +205,7 @@
return (T) auditSync.getCurrentRevisionData(session, persist);
}
- public VersionsQueryCreator createQuery() {
- return new VersionsQueryCreator(verCfg, this);
+ public AuditQueryCreator createQuery() {
+ return new AuditQueryCreator(verCfg, this);
}
}
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImplementor.java
===================================================================
---
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImplementor.java 2009-11-04
16:24:28 UTC (rev 17911)
+++
core/trunk/envers/src/main/java/org/hibernate/envers/reader/AuditReaderImplementor.java 2009-11-04
18:40:13 UTC (rev 17912)
@@ -27,13 +27,12 @@
import org.hibernate.Session;
import org.hibernate.engine.SessionImplementor;
-import org.jboss.envers.VersionsReader;
/**
* An interface exposed by a VersionsReader to library-facing classes.
* @author Adam Warski (adam at warski dot org)
*/
-public interface AuditReaderImplementor extends AuditReader, VersionsReader {
+public interface AuditReaderImplementor extends AuditReader {
SessionImplementor getSessionImplementor();
Session getSession();
FirstLevelCache getFirstLevelCache();
Show replies by date