@Override
  public SubCategoryData updateSubCategoryData(
      Long id,
      Session session,
      ProductCategory productCategory,
      String subCategoryRawData,
      SubCategory subCategory,
      Date createdDate) {
    if (session == null) session = getSessionFactory().openSession();

    Date updatedDate = new Date();
    SubCategoryData subCategoryData = new SubCategoryData();
    subCategoryData.setId(id);
    subCategoryData.setCreatedDate(createdDate);
    subCategoryData.setProductCategory(productCategory);

    subCategoryData.setSubCategoryRawData(subCategoryRawData);
    subCategoryData.setSubCategory(subCategory);
    subCategoryData.setLastModifiedDate(updatedDate);
    session.update(subCategoryData);
    return null;
  }
  @Override
  public SubCategoryData saveSubCategoryData(
      Session session,
      ProductCategory productCategory,
      String subCategoryRawData,
      SubCategory subCategory) {
    if (session == null) session = getSessionFactory().openSession();

    Date createdDate = new Date();
    SubCategoryData subCategoryData = new SubCategoryData();
    subCategoryData.setProductCategory(productCategory);

    subCategoryData.setSubCategoryRawData(subCategoryRawData);
    subCategoryData.setSubCategory(subCategory);
    subCategoryData.setCreatedDate(createdDate);
    subCategoryData.setLastModifiedDate(createdDate);
    session.save(subCategoryData);
    return subCategoryData;
  }