Exemplo n.º 1
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;
  }
Exemplo n.º 2
0
 private static String getUid(CulturalCategory culturalCategory) {
   StringBuilder builder = new StringBuilder();
   builder.append(culturalCategory.getId());
   return builder.toString();
 }