Package org.hibernate.envers.exception

Examples of org.hibernate.envers.exception.AuditException


    protected T initializeCollection(int size) {
        try {
            return (T) ReflectHelper.getDefaultConstructor(collectionClass).newInstance();
        } 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


      return super.initializeCollection(size);
    }
    try {
      return collectionClass.getConstructor(Comparator.class).newInstance(comparator);
    } catch (InstantiationException e) {
      throw new AuditException(e);
    } catch (IllegalAccessException e) {
      throw new AuditException(e);
    } catch (NoSuchMethodException e) {
      throw new AuditException(e);
    } catch (InvocationTargetException e) {
      throw new AuditException(e);
    }
  }
View Full Code Here

    protected T initializeCollection(int size) {
        try {
            return (T) ReflectHelper.getDefaultConstructor(collectionClass).newInstance();
        } 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

      return super.initializeCollection(size);
    }
    try {
      return collectionClass.getConstructor(Comparator.class).newInstance(comparator);
    } catch (InstantiationException e) {
      throw new AuditException(e);
    } catch (IllegalAccessException e) {
      throw new AuditException(e);
    } catch (NoSuchMethodException e) {
      throw new AuditException(e);
    } catch (InvocationTargetException e) {
      throw new AuditException(e);
    }
  }
View Full Code Here

          }

            Class<?> cls = ReflectHelper.classForName(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

                    Class entityClass;
                    try {
            entityClass = ReflectHelper.classForName(entityClassName);
          }
          catch ( ClassNotFoundException e ) {
            throw new AuditException( e );
          }
                    final ToOneDelegateSessionImplementor delegate = new ToOneDelegateSessionImplementor(
                            versionsReader, entityClass, entityId, revision,
                            RevisionType.DEL.equals( versionsEntity.get( verCfg.getAuditEntCfg().getRevisionTypePropName() ) ),
                            verCfg);
View Full Code Here

    private CriteriaTools() { }

    public static void checkPropertyNotARelation(AuditConfiguration verCfg, String entityName,
                                                 String propertyName) throws AuditException {
        if (verCfg.getEntCfg().get(entityName).isRelation(propertyName)) {
            throw new AuditException("This criterion cannot be used on a property that is " +
                    "a relation to another property.");
        }
    }
View Full Code Here

        if (relationDesc.getRelationType() == RelationType.TO_ONE) {
            return relationDesc;
        }

        throw new AuditException("This type of relation (" + entityName + "." + propertyName +
                ") isn't supported and can't be used in queries.");
    }
View Full Code Here

        this.collectionClass = collectionClass;

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

        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

TOP

Related Classes of org.hibernate.envers.exception.AuditException

Copyright © 2018 www.massapicom. 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.