Example #1
0
  @Override
  protected Content entityToData(ContentEntity entity) {
    Content content = new Content();
    content.putAll(entity.getContent());

    return content;
  }
Example #2
0
  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;
  }
Example #3
0
  @Override
  protected ContentEntity dataToEntity(Content content) {
    ContentEntity entity = new ContentEntity();

    entity.setId(Integer.parseInt(content.get("id")));
    entity.setContent(content);

    return entity;
  }