@Override protected Content entityToData(ContentEntity entity) { Content content = new Content(); content.putAll(entity.getContent()); return content; }
public Map<String, Content> retrieveAllMap() { List<Content> contentList = retrieveAll(); Map<String, Content> result = new HashMap<>(); for (Content content : contentList) { result.put(content.get("id"), content); } return result; }
@Override protected ContentEntity dataToEntity(Content content) { ContentEntity entity = new ContentEntity(); entity.setId(Integer.parseInt(content.get("id"))); entity.setContent(content); return entity; }