Package com.philip.dao

Examples of com.philip.dao.AuditTrail


            // need to have a separate session for audit save
            final StatelessSession session = event.getPersister().getFactory().openStatelessSession();
            session.beginTransaction();
            final String actorId = getActorId(session, event);

            session.insert(new AuditTrail(entityId.toString(), entityName, actorId, transTime));
            session.getTransaction().commit();
        } catch (final HibernateException e) {
            LOGGER.error("Unable to process audit log for DELETE operation", e);
        }
        return false;
View Full Code Here


            for (final String propertyName : event.getPersister().getPropertyNames()) {
                if (!auditColumn.contains(propertyName)) {
                    newPropValue = event.getPersister().getPropertyValue(event.getEntity(), propertyName, entityMode);
                    // because we are performing an insert we only need to be concerned will non-null values
                    if (newPropValue != null && !(newPropValue instanceof Collection)) {
                        final AuditTrail auditTrail = new AuditTrail(entityId, entityName, OP_TYPE_INSERT, actorId,
                                transTime).entityProperty(propertyName).entityPropNewValue(
                                newPropValue == null ? null : newPropValue.toString());
                        session.insert(auditTrail);
                    }
                }
View Full Code Here

                    // because we are performing an insert we only need to be concerned will non-null values
                    if (newPropValue != null && !newPropValue.equals(oldPropValue)
                            && !(newPropValue instanceof Collection)) {

                        final AuditTrail auditTrail = new AuditTrail(entityId.toString(), entityName, OP_TYPE_UPDATE,
                                actorId, transTime).entityProperty(propertyName)
                                .entityPropOldValue(oldPropValue == null ? null : oldPropValue.toString())
                                .entityPropNewValue(newPropValue == null ? null : newPropValue.toString());
                        session.insert(auditTrail);
                    }
View Full Code Here

TOP

Related Classes of com.philip.dao.AuditTrail

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.