Package org.opentides.bean

Examples of org.opentides.bean.Auditable


   * Sets the userId within the web session for audit logging.
   * @param obj
   */
  private void setAuditUserId(T obj) {
    if (Auditable.class.isAssignableFrom(obj.getClass())) {
      Auditable auditable = (Auditable) obj;
      if (auditable.getAuditUserId()==null)
        auditable.setUserId();     
    }
  }
View Full Code Here


                                String[] propertyNames,
                                Type[] types)
            throws CallbackException {
        if (entity instanceof Auditable) {
          try {
              Auditable auditable = (Auditable) entity;
              if (!auditable.isSkipAudit()) {
              // Use the id and class to get the pre-update state from the database
              Session tempSession =
                    HibernateUtil.getSessionFactory().openSession();
              Auditable old = (Auditable) tempSession.get(entity.getClass(), auditable.getId());
              if (old == null)
                return false; // old object is not yet persisted?
              synchronized(oldies) {
                oldies.put(old.getId(), old);
              }
              synchronized(updates) {
                updates.add((Auditable)entity);
              }
              }
View Full Code Here

                }else{
                  friendlyMessage = entity.getFriendlyMessage();
                }
               
                if (StringUtil.isEmpty(entity.getAuditMessage())){
                  Auditable old = oldies.get(entity.getId());
                  auditMessage = CrudUtil.buildUpdateMessage(old, entity);
                }else{
                  auditMessage = entity.getAuditMessage();
                }
                if (!StringUtil.isEmpty(auditMessage))
View Full Code Here

TOP

Related Classes of org.opentides.bean.Auditable

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.