Jean-Francois Leveque

Ajout de constructeur avec injection.

......@@ -25,14 +25,22 @@ import java.util.Set;
public class PublisherServiceSpring implements PublisherService {
Logger logger = LoggerFactory.getLogger(getClass());
@Inject
PublisherRepository publisherRepository;
@Inject
PublisherVersionRepository publisherVersionRepository;
SharedService sharedService;
@Inject
SharedService sharedService;
public PublisherServiceSpring(PublisherRepository publisherRepository,
PublisherVersionRepository publisherVersionRepository,
SharedService sharedService) {
this.publisherRepository = publisherRepository;
this.publisherVersionRepository = publisherVersionRepository;
this.sharedService = sharedService;
}
//no args constructor to make it proxyable
PublisherServiceSpring() {
}
public void addNewPublisher(PublisherVersion publisherVersion) {
Publisher publisher = new Publisher();
......@@ -45,6 +53,7 @@ public class PublisherServiceSpring implements PublisherService {
this.savePublisherVersion(publisherVersion);
this.savePublisher(publisher);
}
public void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion) {
logger.trace("debut addVersionToPublisher, publisherVersion = {}", publisherVersion);
Set<PublisherVersion> publisherVersionSet = publisher.getVersions();
......