Package org.hibernate.envers

Examples of org.hibernate.envers.Audited


     * using {@link AuditOverride} annotation.
     * @param clazz Class that is being processed. Currently mapped entity shall be passed during first invocation.
     */
    private void readAuditOverrides(XClass clazz) {
        /* TODO: Code to remove with @Audited.auditParents - start. */
        Audited allClassAudited = clazz.getAnnotation(Audited.class);
        if (allClassAudited != null && allClassAudited.auditParents().length > 0) {
            for (Class c : allClassAudited.auditParents()) {
                XClass parentClass = reflectionManager.toXClass(c);
                checkSuperclass(clazz, parentClass);
                if (!overriddenNotAuditedClasses.contains(parentClass)) {
                    // If the class has not been marked as not audited by the subclass.
                    overriddenAuditedClasses.add(parentClass);
View Full Code Here


     *         In case of success, {@link Audited} configuration of currently mapped entity is returned, otherwise
     *         {@code null}. If processed type exists in {@link AuditedPropertiesReader#overriddenNotAuditedClasses}
     *         collection, the result is also {@code null}.
     */
    private Audited computeAuditConfiguration(XClass clazz) {
        Audited allClassAudited = clazz.getAnnotation(Audited.class);
        // If processed class is not explicitly marked with @Audited annotation, check whether auditing is
        // forced by any of its child entities configuration (@AuditedOverride.forClass).
        if (allClassAudited == null && overriddenAuditedClasses.contains(clazz)) {
            // Declared audited parent copies @Audited.modStore and @Audited.targetAuditMode configuration from
            // currently mapped entity.
View Full Code Here

    /**
     * Recursively adds all audited properties of entity class and its superclasses.
     * @param clazz Currently processed class.
     */
  private void addPropertiesFromClass(XClass clazz)  {
    Audited allClassAudited = computeAuditConfiguration(clazz);

    //look in the class
    addFromProperties(clazz.getDeclaredProperties("field"), "field", fieldAccessedPersistentProperties, allClassAudited);
    addFromProperties(clazz.getDeclaredProperties("property"), "property", propertyAccessedPersistentProperties, allClassAudited);
   
View Full Code Here


  protected boolean checkAudited(XProperty property,
      PropertyAuditingData propertyData, Audited allClassAudited) {
    // Checking if this property is explicitly audited or if all properties are.
    Audited aud = (property.isAnnotationPresent(Audited.class)) ? (property.getAnnotation(Audited.class)) : allClassAudited;
    if (aud == null && overriddenAuditedProperties.contains(property) && !overriddenNotAuditedProperties.contains(property)) {
      // Assigning @Audited defaults. If anyone needs to customize those values in the future,
      // appropriate fields shall be added to @AuditOverride annotation.
      aud = DEFAULT_AUDITED;
    }
    if (aud != null) {
      propertyData.setStore(aud.modStore());
      propertyData.setRelationTargetAuditMode(aud.targetAuditMode());
      propertyData.setUsingModifiedFlag(checkUsingModifiedFlag(aud));
      return true;
    } else {
      return false;
    }
View Full Code Here

 
  @Override
  protected boolean checkAudited(XProperty property,
      PropertyAuditingData propertyData, Audited allClassAudited) {
    // Checking if this property is explicitly audited or if all properties are.
    Audited aud = property.getAnnotation(Audited.class);
    if (aud != null) {
      propertyData.setStore(aud.modStore());
      propertyData.setRelationTargetAuditMode(aud.targetAuditMode());
    } else {
      propertyData.setStore(ModificationStore.FULL);
   
     return true
  }
View Full Code Here

     * using {@link AuditOverride} annotation.
     * @param clazz Class that is being processed. Currently mapped entity shall be passed during first invocation.
     */
    private void readAuditOverrides(XClass clazz) {
        /* TODO: Code to remove with @Audited.auditParents - start. */
        Audited allClassAudited = clazz.getAnnotation(Audited.class);
        if (allClassAudited != null && allClassAudited.auditParents().length > 0) {
            for (Class c : allClassAudited.auditParents()) {
                XClass parentClass = reflectionManager.toXClass(c);
                checkSuperclass(clazz, parentClass);
                if (!overriddenNotAuditedClasses.contains(parentClass)) {
                    // If the class has not been marked as not audited by the subclass.
                    overriddenAuditedClasses.add(parentClass);
View Full Code Here

     *         In case of success, {@link Audited} configuration of currently mapped entity is returned, otherwise
     *         {@code null}. If processed type exists in {@link AuditedPropertiesReader#overriddenNotAuditedClasses}
     *         collection, the result is also {@code null}.
     */
    private Audited computeAuditConfiguration(XClass clazz) {
        Audited allClassAudited = clazz.getAnnotation(Audited.class);
        // If processed class is not explicitly marked with @Audited annotation, check whether auditing is
        // forced by any of its child entities configuration (@AuditedOverride.forClass).
        if (allClassAudited == null && overriddenAuditedClasses.contains(clazz)) {
            // Declared audited parent copies @Audited.modStore and @Audited.targetAuditMode configuration from
            // currently mapped entity.
View Full Code Here

    /**
     * Recursively adds all audited properties of entity class and its superclasses.
     * @param clazz Currently processed class.
     */
  private void addPropertiesFromClass(XClass clazz)  {
    Audited allClassAudited = computeAuditConfiguration(clazz);

    //look in the class
    addFromProperties(clazz.getDeclaredProperties("field"), "field", fieldAccessedPersistentProperties, allClassAudited);
    addFromProperties(clazz.getDeclaredProperties("property"), "property", propertyAccessedPersistentProperties, allClassAudited);
   
View Full Code Here


  protected boolean checkAudited(XProperty property,
      PropertyAuditingData propertyData, Audited allClassAudited) {
    // Checking if this property is explicitly audited or if all properties are.
    Audited aud = (property.isAnnotationPresent(Audited.class)) ? (property.getAnnotation(Audited.class)) : allClassAudited;
    if (aud == null && overriddenAuditedProperties.contains(property) && !overriddenNotAuditedProperties.contains(property)) {
      // Assigning @Audited defaults. If anyone needs to customize those values in the future,
      // appropriate fields shall be added to @AuditOverride annotation.
      aud = DEFAULT_AUDITED;
    }
    if (aud != null) {
      propertyData.setStore(aud.modStore());
      propertyData.setRelationTargetAuditMode(aud.targetAuditMode());
      propertyData.setUsingModifiedFlag(checkUsingModifiedFlag(aud));
      return true;
    } else {
      return false;
    }
View Full Code Here

     * using {@link AuditOverride} annotation.
     * @param clazz Class that is being processed. Currently mapped entity shall be passed during first invocation.
     */
    private void readAuditOverrides(XClass clazz) {
        /* TODO: Code to remove with @Audited.auditParents - start. */
        Audited allClassAudited = clazz.getAnnotation(Audited.class);
        if (allClassAudited != null && allClassAudited.auditParents().length > 0) {
            for (Class c : allClassAudited.auditParents()) {
                XClass parentClass = reflectionManager.toXClass(c);
                checkSuperclass(clazz, parentClass);
                if (!overriddenNotAuditedClasses.contains(parentClass)) {
                    // If the class has not been marked as not audited by the subclass.
                    overriddenAuditedClasses.add(parentClass);
View Full Code Here

TOP

Related Classes of org.hibernate.envers.Audited

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.