Removing EnversExeption and using HibernateException instead.
This commit is contained in:
Hernan 2010-11-27 12:55:56 -02:00 committed by adamw
parent c981bef5c1
commit 89393c5e9e
3 changed files with 5 additions and 29 deletions

View File

@ -28,7 +28,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.hibernate.envers.exception.EnversException;
import org.hibernate.HibernateException;
import org.hibernate.envers.exception.NotAuditedException;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.query.AuditQueryCreator;
@ -230,6 +230,6 @@ public interface AuditReader {
* not associated with this AuditReader instance.
*/
String getEntityName(Object primaryKey, Number revision, Object entity)
throws EnversException;
throws HibernateException;
}

View File

@ -1,23 +0,0 @@
package org.hibernate.envers.exception;
import org.hibernate.HibernateException;
/**
* @author Hernán Chanfreau
*/
public class EnversException extends HibernateException {
private static final long serialVersionUID = 7117102779944317920L;
public EnversException(String message) {
super(message);
}
public EnversException(String message, Throwable cause) {
super(message, cause);
}
public EnversException(Throwable cause) {
super(cause);
}
}

View File

@ -42,7 +42,6 @@ import org.hibernate.Session;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.envers.configuration.AuditConfiguration;
import org.hibernate.envers.exception.AuditException;
import org.hibernate.envers.exception.EnversException;
import org.hibernate.envers.exception.NotAuditedException;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.query.AuditEntity;
@ -279,7 +278,7 @@ public class AuditReaderImpl implements AuditReaderImplementor {
}
public String getEntityName(Object primaryKey, Number revision ,Object entity) throws EnversException{
public String getEntityName(Object primaryKey, Number revision ,Object entity) throws HibernateException{
checkNotNull(primaryKey, "Primary key");
checkNotNull(revision, "Entity revision");
checkPositive(revision, "Entity revision");
@ -294,8 +293,8 @@ public class AuditReaderImpl implements AuditReaderImplementor {
// it´s on envers FLC!
return firstLevelCache.getFromEntityNameCache(primaryKey, revision, entity);
} else {
throw new EnversException(
"Can´t resolve entityName for historic entity. The id, revision and entity is not on envers first level cache.");
throw new HibernateException(
"Envers can´t resolve entityName for historic entity. The id, revision and entity is not on envers first level cache.");
}
}
}