Пример #1
0
  @Override
  @Transactional(readOnly = false)
  public void joinCourse(Customer customer, Course course) {
    course = courseDao.getBySid(course.getSid());
    CustomerSubscription subscription = new CustomerSubscription();
    subscription.setCourse(course);
    subscription.setCustomer(customer);

    customerSubscriptionDao.save(subscription);
  }
Пример #2
0
 @Override
 @Transactional(readOnly = true)
 public List<Customer> findByCourse(Course course) {
   return customerSubscriptionDao.findCustomersByCourse(course);
 }
Пример #3
0
 @Override
 @Transactional(readOnly = true)
 public List<Course> findCourses(Customer customer) {
   return customerSubscriptionDao.findCoursesByCustomer(customer);
 }