Exemplo n.º 1
0
  /**
   * Update a Entity from a Dto
   *
   * @param a Dto
   * @return an Entity
   */
  public static CulturalCategory updateEntity(
      CulturalCategory culturalCategory, CulturalCategoryInfo culturalCategoryInfo) {

    culturalCategory.setCode(culturalCategoryInfo.getCode());
    culturalCategory.setLabel(culturalCategoryInfo.getLabel());

    return culturalCategory;
  }
Exemplo n.º 2
0
  /**
   * Create a Dto from an Entity
   *
   * @param an Entity
   * @return a Dto
   */
  public static CulturalCategoryInfo createDto(CulturalCategory culturalCategory) {
    CulturalCategoryInfo culturalCategoryInfo = new CulturalCategoryInfo();

    if (culturalCategory == null) return culturalCategoryInfo;

    if (culturalCategory.getId() != null) culturalCategoryInfo.setUid(getUid(culturalCategory));

    culturalCategoryInfo.setCode(culturalCategory.getCode());
    culturalCategoryInfo.setLabel(culturalCategory.getLabel());

    return culturalCategoryInfo;
  }