maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane-3 <mittiprove...@yahoo.se>
Subject Re: DAO injection in integration tests with a few database server specific methods
Date Fri, 23 Nov 2012 09:39:51 GMT
Yes, it should be the same method signature, but with an implementation that
is specific to each database server.

I created another spring-hibernate-custom-dao.xml file in a
src/main/resources/oracle directory listed in the Maven oracle-test profile,
which contains the custom DAO bean definition:
	<bean id="navbarLanguageCustomDao"

class="com.thalasoft.learnintouch.core.dao.oracle.hibernate.NavbarLanguageCustomHibernateDao">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>

This bean is then injected in the existing common DAO bean with:
	<bean id="navbarLanguageDao"
	
class="com.thalasoft.learnintouch.core.dao.hibernate.NavbarLanguageHibernateDao">
		<property name="sessionFactory" ref="sessionFactory" />
		<property name="navbarLanguageCustomDao" ref="navbarLanguageCustomDao" />
	</bean>

And the existing common DAO class can now use the injected custom DAO with:
	private NavbarLanguageCustomDao navbarLanguageCustomDao;
	public void setNavbarLanguageCustomDao(NavbarLanguageCustomDao
navbarLanguageCustomDao) {
		this.navbarLanguageCustomDao = navbarLanguageCustomDao;
	}

I think I'm almost there, but I still get an exception:

Caused by: java.lang.IllegalStateException: Cannot convert value of type
[$Proxy14 implementing
com.thalasoft.learnintouch.core.dao.GenericDao,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type
[com.thalasoft.learnintouch.core.dao.oracle.NavbarLanguageCustomDao] for
property 'navbarLanguageCustomDao': no matching editors or conversion
strategy found





--
View this message in context: http://maven.40175.n5.nabble.com/DAO-injection-in-integration-tests-with-a-few-database-server-specific-methods-tp5732576p5732604.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message