Search in sources :

Example 1 with FlashOrderDO

use of com.actionworks.flashsale.persistence.model.FlashOrderDO in project flash-sale by ThoughtsBeta.

the class FlashOrderBuilder method toDataObjectForCreate.

public static FlashOrderDO toDataObjectForCreate(FlashOrder flashOrder) {
    FlashOrderDO flashOrderDO = new FlashOrderDO();
    BeanUtils.copyProperties(flashOrder, flashOrderDO);
    return flashOrderDO;
}
Also used : FlashOrderDO(com.actionworks.flashsale.persistence.model.FlashOrderDO)

Example 2 with FlashOrderDO

use of com.actionworks.flashsale.persistence.model.FlashOrderDO in project flash-sale by ThoughtsBeta.

the class FlashOrderRepositoryImpl method save.

@Override
public boolean save(FlashOrder flashOrder) {
    FlashOrderDO flashOrderDO = FlashOrderBuilder.toDataObjectForCreate(flashOrder);
    int effectedRows = flashOrderMapper.insert(flashOrderDO);
    return effectedRows == 1;
}
Also used : FlashOrderDO(com.actionworks.flashsale.persistence.model.FlashOrderDO)

Example 3 with FlashOrderDO

use of com.actionworks.flashsale.persistence.model.FlashOrderDO in project flash-sale by ThoughtsBeta.

the class FlashOrderRepositoryImpl method findById.

@Override
public Optional<FlashOrder> findById(Long orderId) {
    FlashOrderDO flashOrderDO = flashOrderMapper.getById(orderId);
    if (flashOrderDO == null) {
        return Optional.empty();
    }
    FlashOrder flashOrder = FlashOrderBuilder.toDomainObject(flashOrderDO);
    return Optional.of(flashOrder);
}
Also used : FlashOrder(com.actionworks.flashsale.domain.model.entity.FlashOrder) FlashOrderDO(com.actionworks.flashsale.persistence.model.FlashOrderDO)

Example 4 with FlashOrderDO

use of com.actionworks.flashsale.persistence.model.FlashOrderDO in project flash-sale by ThoughtsBeta.

the class FlashOrderRepositoryImpl method updateStatus.

@Override
public boolean updateStatus(FlashOrder flashOrder) {
    FlashOrderDO flashOrderDO = FlashOrderBuilder.toDataObjectForCreate(flashOrder);
    int effectedRows = flashOrderMapper.updateStatus(flashOrderDO);
    return effectedRows == 1;
}
Also used : FlashOrderDO(com.actionworks.flashsale.persistence.model.FlashOrderDO)

Aggregations

FlashOrderDO (com.actionworks.flashsale.persistence.model.FlashOrderDO)4 FlashOrder (com.actionworks.flashsale.domain.model.entity.FlashOrder)1