added aspectj decaration. All JUnit tests are now successful

This commit is contained in:
Mic 2013-01-14 23:23:07 +08:00
parent 608c42f74b
commit b459ca3377
7 changed files with 31 additions and 16 deletions

View file

@ -29,7 +29,7 @@ import org.springframework.dao.DataAccessException;
*/
@Repository
@Transactional
public class EntityManagerClinic implements Clinic {
public class JpaClinic implements Clinic {
@PersistenceContext
private EntityManager em;

View file

@ -63,7 +63,10 @@
This aspect is defined in petclinic.jar's META-INF/aop.xml file.
Note that we can dependency inject this bean like any other bean.
-->
<bean class="org.springframework.samples.petclinic.aspects.UsageLogAspect" p:historySize="300"/>
<aop:aspectj-autoproxy>
<aop:include name="usageLogAspect"/>
</aop:aspectj-autoproxy>
<bean id="usageLogAspect" class="org.springframework.samples.petclinic.aspects.UsageLogAspect" p:historySize="300"/>
<!--
Post-processor to perform exception translation on @Repository classes (from native
@ -76,6 +79,6 @@
EntityManager will be auto-injected due to @PersistenceContext.
PersistenceExceptions will be auto-translated due to @Repository.
-->
<bean id="clinic" class="org.springframework.samples.petclinic.jpa.EntityManagerClinic"/>
<bean id="clinic" class="org.springframework.samples.petclinic.jpa.JpaClinic"/>
</beans>

View file

@ -513,7 +513,7 @@
<p>
The JPA implementation of the <span style="font-weight: bold;">Clinic</span>
interface is
<span style="font-weight: bold; font-style: italic;">org.springframework.samples.petclinic.jpa.EntityManagerClinic</span>,
<span style="font-weight: bold; font-style: italic;">org.springframework.samples.petclinic.jpa.JpaClinic</span>,
which is based on native JPA usage combined with Spring's
<span style="font-weight: bold;">@Repository</span> and
<span style="font-weight: bold;">@Transactional</span> annotations but