示例#1
0
  @Override
  protected ContentEntity dataToEntity(Content content) {
    ContentEntity entity = new ContentEntity();

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

    return entity;
  }
示例#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;
  }