|
From: Oliver H. <Ol...@ou...> - 2004-11-17 04:21:53
|
Actually this may be fixed some time soon, I just uploaded a patch to Jira which allows for wildcard matching regardless of whether the files are in a jar or on the file system. I've not tested it with jars inside jars (WARs, EARs etc..) so that could be a problem, but, as long as a JarURLConnection handler that supports nested jars is installed, I can't see why my patch would not work. So hopefully soon you'll be able to have: <property name=3D"mappingDirectoryLocations"> <value>classpath:/hibernate/*.hbm.xml</value> </property> or <property name=3D"mappingDirectoryLocations"> <value>classpath*:/hibernate/*.hbm.xml</value> </property> Ollie > -----Original Message----- > From: spr...@li...=20 > [mailto:spr...@li...] > On Behalf Of Colin Sampaleanu > Sent: Wednesday, 17 November 2004 3:22 AM > To: spr...@li... > Subject: Re: [Springframework-developer] using *.xml for=20 > Hibernate mapping files in the spring.xml >=20 >=20 > Just keep in mind that pointint to a classpath location, with any=20 > wildcarding, will break when the app is deployed such that=20 > the files are=20 > actually not on the physical filesystem. For example,=20 > WebLogic will not=20 > expand the entire contents of a WAR or EAR to the filesystem, relying=20 > instead on a specialized URL handler to get resources directly from=20 > within the archive. There's nothing that Spring can do about that=20 > particular situation... >=20 >=20 > Sean Brandt wrote: >=20 > >You can use the mappingDirectoryLocations to point to a=20 > location w/in=20 > >the classpath, I think. This works for me and the dir above=20 > it is not=20 > >the current working directory, but in the classpath: > > > > <bean id=3D"hibernateSessionFactory"=20 > >class=3D"org.springframework.orm.hibernate.LocalSessionFactoryBean"> > > <property name=3D"hibernateProperties"> > > <props> > > <prop=20 > >key=3D"hibernate.dialect">net.sf.hibernate.dialect.Oracle9Diale > ct</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=20 > 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...=20 > ><jas...@ma...> wrote: > > =20 > > > >>I'm sure I spotted someone mention a custom bean=20 > configuration thingy=20 > >>that could be used in your Spring.xml to fix this - but tried=20 > >>searching the archives and couldn't spot it. > >> > >>Basically I'd like to be able to do this... > >> > >> <bean id=3D"sessionFactory"=20 > >>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=20 > right now to=20 > >>solve this? I'm aware of the property based=20 > >>PropertyPlaceholderConfigurer but wondered if anyone knew=20 > of another=20 > >>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=20 > >>robust object and relational technologies, making it a=20 > perfect match=20 > >>for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8=20 > >>_______________________________________________ > >>Springframework-developer mailing list=20 > >>Spr...@li... > >>https://lists.sourceforge.net/lists/listinfo/springframework -developer >> >> =20 >> > > > =20 > ------------------------------------------------------- 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 |