HHH-5588
Removing EnversExeption and using HibernateException instead.
This commit is contained in:
parent
c981bef5c1
commit
89393c5e9e
|
@ -28,7 +28,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
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.NotAuditedException;
|
||||||
import org.hibernate.envers.exception.RevisionDoesNotExistException;
|
import org.hibernate.envers.exception.RevisionDoesNotExistException;
|
||||||
import org.hibernate.envers.query.AuditQueryCreator;
|
import org.hibernate.envers.query.AuditQueryCreator;
|
||||||
|
@ -230,6 +230,6 @@ public interface AuditReader {
|
||||||
* not associated with this AuditReader instance.
|
* not associated with this AuditReader instance.
|
||||||
*/
|
*/
|
||||||
String getEntityName(Object primaryKey, Number revision, Object entity)
|
String getEntityName(Object primaryKey, Number revision, Object entity)
|
||||||
throws EnversException;
|
throws HibernateException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -42,7 +42,6 @@ import org.hibernate.Session;
|
||||||
import org.hibernate.engine.SessionImplementor;
|
import org.hibernate.engine.SessionImplementor;
|
||||||
import org.hibernate.envers.configuration.AuditConfiguration;
|
import org.hibernate.envers.configuration.AuditConfiguration;
|
||||||
import org.hibernate.envers.exception.AuditException;
|
import org.hibernate.envers.exception.AuditException;
|
||||||
import org.hibernate.envers.exception.EnversException;
|
|
||||||
import org.hibernate.envers.exception.NotAuditedException;
|
import org.hibernate.envers.exception.NotAuditedException;
|
||||||
import org.hibernate.envers.exception.RevisionDoesNotExistException;
|
import org.hibernate.envers.exception.RevisionDoesNotExistException;
|
||||||
import org.hibernate.envers.query.AuditEntity;
|
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(primaryKey, "Primary key");
|
||||||
checkNotNull(revision, "Entity revision");
|
checkNotNull(revision, "Entity revision");
|
||||||
checkPositive(revision, "Entity revision");
|
checkPositive(revision, "Entity revision");
|
||||||
|
@ -294,8 +293,8 @@ public class AuditReaderImpl implements AuditReaderImplementor {
|
||||||
// it´s on envers FLC!
|
// it´s on envers FLC!
|
||||||
return firstLevelCache.getFromEntityNameCache(primaryKey, revision, entity);
|
return firstLevelCache.getFromEntityNameCache(primaryKey, revision, entity);
|
||||||
} else {
|
} else {
|
||||||
throw new EnversException(
|
throw new HibernateException(
|
||||||
"Can´t resolve entityName for historic entity. The id, revision and entity is not on envers first level cache.");
|
"Envers can´t resolve entityName for historic entity. The id, revision and entity is not on envers first level cache.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue