|
From: Kopylenko, D. <dko...@ac...> - 2003-10-08 17:10:58
|
Darren,
AbstractBeanFactory.managedListToArray() tries to convert a List into
Object[]. I would guess, since "types" property is int[], that's where it's
getting ClassCastException. Am I correct? Anyone?
Regards,
Dmitriy.
-----Original Message-----
From: dar...@hs... [mailto:dar...@hs...]
Sent: Wednesday, October 08, 2003 11:27 AM
To: spr...@li...
Subject: [Springframework-developer] MappingSqlQuery - setTypes in
application context?
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.managedListToA
rray(AbstractBeanFactory.java:452)
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveValueIf
Necessary(AbstractBeanFactory.java:393)
at
org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyV
alues(AbstractBeanFactory.java:327)
at
org.springframework.beans.factory.support.AbstractBeanFactory.createBean(Abs
tractBeanFactory.java:303)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getSharedInsta
nce(AbstractBeanFactory.java:232)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBeanInterna
l(AbstractBeanFactory.java:161)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.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.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net
hosts over 70,000 Open Source Projects. See the people who have HELPED US
provide better services: Click here: http://sourceforge.net/supporters.php
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|