Example usage for org.hibernate.type CompositeCustomType getPropertyNames

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

Introduction

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

Prototype

public String[] getPropertyNames() 

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 w ww  .  ja  va2 s .com*/
    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();
}