1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
@Transactional
public class StoreManagerImpl implements StoreManager {
@Autowired
private CustomerDAO customerDao;
@Autowired
private OrderDAO orderDao;
@Autowired
private ProductDAO productDao;
public void setCustomerDao(CustomerDAO customerDao) {
this.customerDao = customerDao;
}
public void setOrderDao(OrderDAO orderDao) {
this.orderDao = orderDao;
}
public void setProductDao(ProductDAO productDao) {
this.productDao = productDao;
}
@Transactional(readOnly=true)
public Product getProduct(int Id) {
return this.productDao.getProduct(Id);
}
public void addProduct(Product p) {
this.productDao.addProduct(p);
}
public void delProduct(Product p) {
this.productDao.delProduct(p);
}
public void updateProduct(Product p) {
this.productDao.updateProduct(p);
}
@Transactional(readOnly=true)
public Customer getCustomer(int Id) {
return this.customerDao.getCustomer(Id);
}
public void addCustomer(Customer c) {
this.customerDao.addCustomer(c);
}
public void delCustomer(Customer c) {
this.customerDao.delCustomer(c);
}
public void updateCustomer(Customer c) {
this.customerDao.updateCustomer(c);
}
@Transactional(readOnly=true)
public Order getOrder(int Id) {
return this.orderDao.getOrder(Id);
}
public void addOrder(Order o) {
this.orderDao.addOrder(o);
}
public void delOrder(Order o) {
this.orderDao.delOrder(o);
}
public void updateOrder(Order o) {
this.orderDao.updateOrder(o);
}
} |
Partager