Conversation
…ApplicationContext.xml
|
|
||
| private SessionFactory sessionFactory; | ||
|
|
||
| public void setSessionFactory(SessionFactory sessionFactory) { |
There was a problem hiding this comment.
You dont need a setter. You have the constructor taking the sessionFactory.
If you are going to wire by the moduleApplicationContext.xml - remove the @repository annotation from EpisodeAttributeTypeDaoImpl. Because in the moduleapplicationContext - we have the component scan.
|
|
||
| private EpisodeAttributeTypeDao episodeAttributeTypeDao; | ||
|
|
||
| public void setEpisodeAttributeTypeDao(EpisodeAttributeTypeDao episodeAttributeTypeDao) { |
There was a problem hiding this comment.
same as above. Constructor already takes in the Dao. If you want to wire using app context xml, remove the @service annoatation
| @@ -25,4 +25,73 @@ | |||
|
|
|||
| <context:component-scan base-package="org.openmrs.module.episodes"/> | |||
There was a problem hiding this comment.
If you want to manually wire up, remove the component scan
| <context:component-scan base-package="org.openmrs.module.episodes"/> | ||
|
|
||
| <bean id="episodeDao" class="org.openmrs.module.episodes.dao.impl.EpisodeDAOImpl"> | ||
| <property name="sessionFactory"> |
There was a problem hiding this comment.
You dont need a property setter. You can use constructor-arg
| </bean> | ||
| <bean id="episodeAttributeTypeDao" class="org.openmrs.module.episodes.dao.impl.EpisodeAttributeTypeDaoImpl"> | ||
| <property name="sessionFactory"> | ||
| <ref bean="sessionFactory"/> |
There was a problem hiding this comment.
You dont need a property setter. You can use constructor-arg
| </property> | ||
| <property name="target"> | ||
| <bean class="org.openmrs.module.episodes.service.impl.EpisodeServiceImpl"> | ||
| <property name="episodeDAO"> |
There was a problem hiding this comment.
You dont need a property setter. You can use constructor-arg
| <ref bean="transactionManager"/> | ||
| </property> | ||
| <property name="target"> | ||
| <bean class="org.openmrs.module.episodes.service.impl.EpisodeAttributeTypeServiceImpl"> |
There was a problem hiding this comment.
You dont need a property setter. You can use constructor-arg
This PR removes the use of Spring annotations for initialising service and dao. The beans are defined through moduleApplicationContext.xml injecting OpenMRS service interceptors. This also makes the service available on OpenMRS service context.