Examples of AuditException


Examples of org.hibernate.envers.exception.AuditException

        Object ret;
        try {
            ret = Thread.currentThread().getContextClassLoader().loadClass(compositeIdClass).newInstance();
        } catch (Exception e) {
            throw new AuditException(e);
        }

        for (SingleIdMapper mapper : ids.values()) {
            if (!mapper.mapToEntityFromMap(ret, data)) {
                return null;
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

        this.collectionClass = collectionClass;

        try {
            proxyConstructor = proxyClass.getConstructor(Initializor.class);
        } catch (NoSuchMethodException e) {
            throw new AuditException(e);
        }
    }
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

        Setter setter = ReflectionTools.getSetter(obj.getClass(),
                commonCollectionMapperData.getCollectionReferencingPropertyData());
        try {
            setter.set(obj, proxyConstructor.newInstance(getInitializor(verCfg, versionsReader, primaryKey, revision)), null);
        } catch (InstantiationException e) {
            throw new AuditException(e);
        } catch (IllegalAccessException e) {
            throw new AuditException(e);
        } catch (InvocationTargetException e) {
            throw new AuditException(e);
        }
    }
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

        try {
            value = queryForReferencedEntity(versionsReader, referencedEntity, (Serializable) primaryKey, revision);
        } catch (NoResultException e) {
            value = null;
        } catch (NonUniqueResultException e) {
            throw new AuditException("Many versions results for one-to-one relationship " + entityName +
                                     "." + getPropertyData().getBeanName() + ".", e);
        }

        setPropertyValue(obj, value);
    }
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

    public static Class<?> loadClass(String name) {
        try {
            return Thread.currentThread().getContextClassLoader().loadClass(name);
        } catch (ClassNotFoundException e) {
            throw new AuditException(e);
        }
    }
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

    protected T initializeCollection(int size) {
        try {
            return collectionClass.newInstance();
        } catch (InstantiationException e) {
            throw new AuditException(e);
        } catch (IllegalAccessException e) {
            throw new AuditException(e);
        }
    }
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

    protected T initializeCollection(int size) {
        try {
            return collectionClass.newInstance();
        } catch (InstantiationException e) {
            throw new AuditException(e);
        } catch (IllegalAccessException e) {
            throw new AuditException(e);
        }
    }
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

          }

            Class<?> cls = ReflectionTools.loadClass(entCfg.getEntityClassName());
            ret = ReflectHelper.getDefaultConstructor(cls).newInstance();
        } catch (Exception e) {
            throw new AuditException(e);
        }

        // Putting the newly created entity instance into the first level cache, in case a one-to-one bidirectional
        // relation is present (which is eagerly loaded).
        versionsReader.getFirstLevelCache().put(entityName, revision, primaryKey, ret);
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

            result = createQuery().forEntitiesAtRevision(cls, entityName, revision)
                .add(AuditEntity.id().eq(primaryKey)).getSingleResult();
        } catch (NoResultException e) {
            result = null;
        } catch (NonUniqueResultException e) {
            throw new AuditException(e);
        }

        return (T) result;
    }   
View Full Code Here

Examples of org.hibernate.envers.exception.AuditException

            }

            // The timestamp object is either a date or a long
            return timestampObject instanceof Date ? (Date) timestampObject : new Date((Long) timestampObject);
        } catch (NonUniqueResultException e) {
            throw new AuditException(e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.