Coverage Report - org.jtheque.films.controllers.impl.LendController
 
Classes in this File Line Coverage Branch Coverage Complexity
LendController
0 %
0/8
N/A
1
 
 1  
 package org.jtheque.films.controllers.impl;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License.
 9  
  *
 10  
  * JTheque is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jtheque.core.managers.view.able.controller.AbstractController;
 20  
 import org.jtheque.films.controllers.able.ILendController;
 21  
 import org.jtheque.films.persistence.od.able.Film;
 22  
 import org.jtheque.films.view.able.ILendFilmView;
 23  
 import org.jtheque.primary.od.able.Lending;
 24  
 import org.jtheque.primary.od.able.Person;
 25  
 import org.jtheque.primary.services.able.ILendingsService;
 26  
 import org.jtheque.utils.bean.IntDate;
 27  
 
 28  
 import javax.annotation.Resource;
 29  
 
 30  
 /**
 31  
  * A lend controller implementation.
 32  
  *
 33  
  * @author Baptiste Wicht
 34  
  */
 35  0
 public final class LendController extends AbstractController implements ILendController {
 36  
     @Resource
 37  
     private ILendingsService lendingsService;
 38  
 
 39  
     @Resource
 40  
     private ILendFilmView lendFilmView;
 41  
 
 42  
     @Override
 43  
     public ILendFilmView getView() {
 44  0
         return lendFilmView;
 45  
     }
 46  
 
 47  
     @Override
 48  
     public void newLending(Person borrower, Film film) {
 49  0
         Lending lending = lendingsService.getEmptyLending();
 50  
 
 51  0
         lending.setTheOther(film.getId());
 52  0
         lending.setThePerson(borrower);
 53  0
         lending.setDate(IntDate.today());
 54  
 
 55  0
         lendingsService.create(lending);
 56  0
     }
 57  
 }