StringBuilder jsonBuilder = new StringBuilder("");
jsonBuilder
.append(getJsonHeader(totalRecords, searchCondition, isList));
while (roles.hasNext()) {
Role instance = roles.next();
int id = instance.getId();
String name = CommonUtil.fromNullToEmpty(instance.getName());
String description = CommonUtil.fromNullToEmpty(instance
.getDescription());
if (isList) {
User createdBy = instance.getCreated_by();
String createdByName = "";
if (createdBy != null) {
createdByName = CommonUtil.fromNullToEmpty(createdBy
.getName());
}
User updatedBy = instance.getUpdated_by();
String updatedByName = "";
if (updatedBy != null) {
updatedByName = CommonUtil.fromNullToEmpty(updatedBy
.getName());
}
SimpleDateFormat dateFormat = new SimpleDateFormat(
Constant.DATE_TIME_FORMAT);
Date createdOn = instance.getCreated_on();
String createdOnName = "";
if (createdOn != null) {
createdOnName = dateFormat.format(createdOn);
}
Date updatedOn = instance.getUpdated_on();
String updatedOnName = "";
if (updatedOn != null) {
updatedOnName = dateFormat.format(updatedOn);
}
jsonBuilder.append("{\"cell\":[\"").append(id).append("\",\"")