Пример #1
0
  @Override
  protected Content entityToData(ContentEntity entity) {
    Content content = new Content();
    content.putAll(entity.getContent());

    return content;
  }
Пример #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;
  }
Пример #3
0
  @Override
  protected ContentEntity dataToEntity(Content content) {
    ContentEntity entity = new ContentEntity();

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

    return entity;
  }