|
From: <dar...@hs...> - 2003-10-08 15:27:23
|
hi,
is it possible to declare a bean in an application context whose class is a
subclass of MappingSqlQuery and declare bind params? Something like this:
<bean
id="myMapper"
class="some.subclass.of.MappingSqlQuery">
<property name="sql"><value>SELECT * FROM table WHERE field=?
</value></property>
<!-- 12 is the typecode for VARCHAR and somehow needs to be handled as
an int[] -->
<property name="types"><list><value>12</value></list></property>
<property name="dataSource"><ref bean="myDS"/></property>
</bean>
I seem to be having a lot of troube getting the beans instantiated due to
the 'types' property, with the following trace:
java.lang.ClassCastException: java.lang.Object
at
org.springframework.beans.factory.support.AbstractBeanFactory.managedListToArray(AbstractBeanFactory.java:452)
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveValueIfNecessary(AbstractBeanFactory.java:393)
at
org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:327)
at
org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:303)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getSharedInstance(AbstractBeanFactory.java:232)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBeanInternal(AbstractBeanFactory.java:161)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:139)
...
Am I going about this the wrong way completely?
Cheers,
Darren.
_____________________________________________________
This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and / or distributed to any other person. Each page attached
hereto must be read in conjunction with any disclaimer which forms part
of it. Unless otherwise stated, this transmission is neither an offer nor the
solicitation of an offer to sell or purchase any investment. Its contents are
based on information obtained from sources believed to be reliable but
HSBC makes no representation and accepts no responsibility or liability as
to its completeness or accuracy.
|