Spring JPA: missing Named annotation in a few Spring services
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Tue, 23 Aug 2016 01:35:04 +0000 (03:35 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Tue, 23 Aug 2016 01:35:04 +0000 (03:35 +0200)
SpringJava/JPA/spring-jpa-resources/src/main/resources/log4j2.xml
SpringJava/JPA/spring-jpa-services/src/main/java/de/spring/example/services/impl/AdDescriptionRevisionServiceImpl.java
SpringJava/JPA/spring-jpa-services/src/main/java/de/spring/example/services/impl/AdServiceImpl.java
SpringJava/JPA/spring-jpa-services/src/main/java/de/spring/example/services/impl/RevisionServiceImpl.java

index 0936f8c..e31be95 100644 (file)
@@ -56,7 +56,7 @@
 
 
        <!-- 
-               Anything else will be using TRACE logging level.
+               Anything else will be using INFO logging level.
        -->        
     <Root level="INFO">
        <AppenderRef ref="STDOUT"/>
index 4b76189..8aec9e3 100644 (file)
@@ -1,11 +1,13 @@
 package de.spring.example.services.impl;
 
 import javax.inject.Inject;
+import javax.inject.Named;
 
 import de.spring.example.persistence.domain.AdDescription;
 import de.spring.example.persistence.repository.AdDescriptionRepository;
 import de.spring.example.services.AdDescriptionRevisionService;
 
+@Named("adDescriptionRevisionService")
 public class AdDescriptionRevisionServiceImpl
        extends RevisionServiceImpl<AdDescription, Long, Integer, AdDescriptionRepository>
        implements AdDescriptionRevisionService {
index db3140f..05c416e 100644 (file)
@@ -3,6 +3,7 @@ package de.spring.example.services.impl;
 import static org.springframework.data.jpa.domain.Specifications.where;
 
 import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.resthub.common.service.CrudServiceImpl;
 import org.springframework.data.domain.Page;
@@ -13,6 +14,7 @@ import de.spring.example.persistence.domain.specifications.AdSpectifications;
 import de.spring.example.persistence.repository.AdRepository;
 import de.spring.example.services.AdService;
 
+@Named("adService")
 public class AdServiceImpl
        extends CrudServiceImpl<Ad, Long, AdRepository>
        implements AdService {
index f4a235b..6e587c3 100644 (file)
@@ -2,6 +2,8 @@ package de.spring.example.services.impl;
 
 import java.io.Serializable;
 
+import javax.inject.Named;
+
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.history.Revision;
@@ -11,6 +13,7 @@ import org.springframework.util.Assert;
 
 import de.spring.example.services.RevisionService;
 
+@Named("revisionService")
 public class RevisionServiceImpl<T, ID extends Serializable, N extends Number & Comparable<N>, R extends RevisionRepository<T, ID, N>>
        implements RevisionService<T, ID, N> {