@Test public void testDelete() { Customer customer = getCustomer(getTestName()); customer = customerService.create(customer, shopService.getById(10L)); assertTrue(customer.getCustomerId() > 0); long pk = customer.getCustomerId(); customerService.delete(customer); customer = customerService.findById(pk); assertNull(customer); }
@Override public void delete(final Customer instance) { for(CustomerShop cshop : instance.getShops()) { customerShopDao.delete(cshop); } super.delete(instance); }
CustomerServiceImpl extends BaseGenericServiceImpl<Customer> implements CustomerService { @Override public void delete(final Customer instance) { for(CustomerShop cshop : instance.getShops()) { customerShopDao.delete(cshop); } super.delete(instance); } }
CustomerServiceImpl extends BaseGenericServiceImpl<Customer> implements CustomerService { @Override public void delete(final Customer instance) { for(CustomerShop cshop : instance.getShops()) { customerShopDao.delete(cshop); } super.delete(instance); } CustomerServiceImpl(final GenericDAO<Customer, Long> genericDao,
                               final HashHelper passwordHashHelper,
                               final GenericDAO<Object, Long> customerShopDao,
                               final AttributeService attributeService,
                               final ShopService shopService,
                               final CustomerNameFormatter customerNameFormatter); }
CustomerServiceImpl extends BaseGenericServiceImpl<Customer> implements CustomerService { @Override public void delete(final Customer instance) { for(CustomerShop cshop : instance.getShops()) { customerShopDao.delete(cshop); } super.delete(instance); } CustomerServiceImpl(final GenericDAO<Customer, Long> genericDao,
                               final HashHelper passwordHashHelper,
                               final GenericDAO<Object, Long> customerShopDao,
                               final AttributeService attributeService,
                               final ShopService shopService,
                               final CustomerNameFormatter customerNameFormatter); @Override Customer getCustomerByEmail(final String email, Shop shop); @Override Customer findCustomerByEmail(final String email, final Shop shop, final boolean includeDisabled); @Override Customer getCustomerByToken(final String token); @Override Customer getCustomerByPublicKey(final String publicKey, final String lastName); @Override List<Shop> getCustomerShops(final Customer customer); @Override String formatNameFor(final Customer customer, final Shop shop); @Override List<Customer> findCustomers(final int start,
                                        final int offset,
                                        final String sort,
                                        final boolean sortDescending,
                                        final Map<String, List> filter); @Override int findCustomerCount(final Map<String, List> filter); @Override boolean isCustomerExists(final String email, final Shop shop, final boolean includeDisabled); @Override boolean isPasswordValid(final String email, final Shop shop, final String password); @Override List<AttrValueCustomer> getRankedAttributeValues(final Customer customer); @Override void resetPassword(final Customer customer, final Shop shop, final String authToken); @Override void updatePassword(final Customer customer, final Shop shop, final String newPassword); @Override Customer create(final Customer customer, final Shop shop); @Override Customer updateActivate(final Customer customer, final Shop shop, final boolean soft); @Override Customer updateDeactivate(final Customer customer, final Shop shop, final boolean soft); @Override Customer create(final Customer instance); @Override Customer update(final String email, final String shopCode); @Override Customer update(final Customer instance); @Override void delete(final Customer instance); }
CustomerServiceImpl extends BaseGenericServiceImpl<Customer> implements CustomerService { @Override public void delete(final Customer instance) { for(CustomerShop cshop : instance.getShops()) { customerShopDao.delete(cshop); } super.delete(instance); } CustomerServiceImpl(final GenericDAO<Customer, Long> genericDao,
                               final HashHelper passwordHashHelper,
                               final GenericDAO<Object, Long> customerShopDao,
                               final AttributeService attributeService,
                               final ShopService shopService,
                               final CustomerNameFormatter customerNameFormatter); @Override Customer getCustomerByEmail(final String email, Shop shop); @Override Customer findCustomerByEmail(final String email, final Shop shop, final boolean includeDisabled); @Override Customer getCustomerByToken(final String token); @Override Customer getCustomerByPublicKey(final String publicKey, final String lastName); @Override List<Shop> getCustomerShops(final Customer customer); @Override String formatNameFor(final Customer customer, final Shop shop); @Override List<Customer> findCustomers(final int start,
                                        final int offset,
                                        final String sort,
                                        final boolean sortDescending,
                                        final Map<String, List> filter); @Override int findCustomerCount(final Map<String, List> filter); @Override boolean isCustomerExists(final String email, final Shop shop, final boolean includeDisabled); @Override boolean isPasswordValid(final String email, final Shop shop, final String password); @Override List<AttrValueCustomer> getRankedAttributeValues(final Customer customer); @Override void resetPassword(final Customer customer, final Shop shop, final String authToken); @Override void updatePassword(final Customer customer, final Shop shop, final String newPassword); @Override Customer create(final Customer customer, final Shop shop); @Override Customer updateActivate(final Customer customer, final Shop shop, final boolean soft); @Override Customer updateDeactivate(final Customer customer, final Shop shop, final boolean soft); @Override Customer create(final Customer instance); @Override Customer update(final String email, final String shopCode); @Override Customer update(final Customer instance); @Override void delete(final Customer instance);  }