Example usage for org.hibernate.type CompositeCustomType getPropertyValue

List of usage examples for org.hibernate.type CompositeCustomType getPropertyValue

Introduction

In this page you can find the example usage for org.hibernate.type CompositeCustomType getPropertyValue.

Prototype

public Object getPropertyValue(Object component, int i) throws HibernateException 

Source Link

Usage

From source file:com.fiveamsolutions.nci.commons.audit.AuditLogInterceptor.java

License:Open Source License

@SuppressWarnings("unchecked")
private Object getCompositeValue(CompositeCustomType type, Object input) {
    if (input == null) {
        return null;
    }//from ww w  .  j av a 2s.co m
    JSONObject jsonObject = new JSONObject();
    for (int i = 0; i < type.getPropertyNames().length; i++) {
        jsonObject.put(type.getPropertyNames()[i], type.getPropertyValue(input, i));
    }
    return jsonObject.toString();
}