use of com.actionworks.flashsale.persistence.model.FlashActivityDO in project flash-sale by ThoughtsBeta.
the class FlashActivityBuilder method toDataObjectForCreate.
public static FlashActivityDO toDataObjectForCreate(FlashActivity flashActivity) {
FlashActivityDO flashActivityDO = new FlashActivityDO();
BeanUtils.copyProperties(flashActivity, flashActivityDO);
return flashActivityDO;
}
use of com.actionworks.flashsale.persistence.model.FlashActivityDO in project flash-sale by ThoughtsBeta.
the class FlashActivityRepositoryImpl method findById.
@Override
public Optional<FlashActivity> findById(Long activityId) {
FlashActivityDO flashActivityDO = flashActivityMapper.getById(activityId);
if (flashActivityDO == null) {
return Optional.empty();
}
FlashActivity flashActivity = FlashActivityBuilder.toDomainObject(flashActivityDO);
return Optional.of(flashActivity);
}
use of com.actionworks.flashsale.persistence.model.FlashActivityDO in project flash-sale by ThoughtsBeta.
the class FlashActivityRepositoryImpl method save.
@Override
public int save(FlashActivity flashActivity) {
FlashActivityDO flashActivityDO = FlashActivityBuilder.toDataObjectForCreate(flashActivity);
if (flashActivityDO.getId() == null) {
int effectedRows = flashActivityMapper.insert(flashActivityDO);
flashActivity.setId(flashActivityDO.getId());
return effectedRows;
}
return flashActivityMapper.update(flashActivityDO);
}
Aggregations