Map<String, PropertyIndex> indexProperties = metadata.getIndexProperties();
Map<String, Object> indexCollection = new HashMap<String, Object>();
Object id = PropertyAccessorHelper.getId(entity, metadata);
for (String columnName : indexProperties.keySet())
{
PropertyIndex index = indexProperties.get(columnName);
Field property = index.getProperty();
// String propertyName = index.getName();
Object obj = PropertyAccessorHelper.getObject(entity, property);
indexCollection.put(columnName, obj);
}