|
From: <jue...@we...> - 2004-11-16 16:28:16
|
As of Spring 1.1.2, you should also be able to use "mappingLocations" =
(note: not "mappingResources", which just refers to classpath resources) =
with wildcards.
=20
<bean id=3D"sessionFactory" =
class=3D"org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name=3D"dataSource">
<ref local=3D"dataSource"/>
</property>
<property name=3D"mappingLocations">
<list>
<value>/WEB-INF/**/*.hbm.xml</value>
</list>
</property>
</bean>
Actually, you can use such resource patterns on any bean property of =
type Resource[] now (the new ResourceArrayPropertyEditor kicks in here).
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Sean Brandt
Gesendet: Di 16.11.2004 17:15
An: spr...@li...
Betreff: Re: [Springframework-developer] using *.xml for Hibernate =
mapping files in the spring.xml
You can use the mappingDirectoryLocations to point to a location w/in
the classpath, I think. This works for me and the dir above it is not
the current working directory, but in the classpath:
<bean id=3D"hibernateSessionFactory"
class=3D"org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name=3D"hibernateProperties">
<props>
<prop
key=3D"hibernate.dialect">net.sf.hibernate.dialect.Oracle9Dialect</prop>
<prop key=3D"hibernate.use_outer_join">auto</prop>
<prop key=3D"hibernate.show_sql">true</prop>
<prop key=3D"hibernate.cache.provider_class">
com.foo.hibernate.CoherenceCacheProvider
</prop>
<prop =
key=3D"hibernate.cache.use_query_cache">true</prop>
</props>
</property>
<property name=3D"mappingDirectoryLocations">
<list>
<value>foo/xml/hibernate</value>
</list>
</property>
<property name=3D"lobHandler">
<ref bean=3D"hibernate.LobHandler"/>
</property>
</bean>
On Tue, 16 Nov 2004 15:02:32 +0000, jas...@ma...
<jas...@ma...> wrote:
> I'm sure I spotted someone mention a custom bean configuration thingy
> that could be used in your Spring.xml to fix this - but tried =
searching
> the archives and couldn't spot it.
>
> Basically I'd like to be able to do this...
>
> <bean id=3D"sessionFactory"
> class=3D"org.springframework.orm.hibernate.LocalSessionFactoryBean">
> <property name=3D"dataSource">
> <ref local=3D"dataSource"/>
> </property>
> <property name=3D"mappingResources">
> <list>
> <value>**/*.hbm.xml</value>
> </list>
> </property>
> </bean>
>
> rather than have to name each single mapping file by name. e.g..
>
> <property name=3D"mappingResources">
> <list>
> <value>com/acme/model/Cheese.hbm.xml</value>
> <value>com/acme/model/Pizza.hbm.xml</value>
> <value>com/acme/model/Beer.hbm.xml</value>
> </list>
> </property>
>
> etc.
>
> Is there such a wildcard configuration thingy available right now to
> solve this? I'm aware of the property based
> PropertyPlaceholderConfigurer but wondered if anyone knew of another
> solution to this?
>
> James
> -------
> http://radio.weblogs.com/0112098/
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: InterSystems CACHE
> FREE OODBMS DOWNLOAD - A multidimensional database that combines
> robust object and relational technologies, making it a perfect match
> for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
--
Sean Brandt
<sea...@gm...>
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|