I am trying to load all my annotated persistant classes via the
following bean definition...
The first bean definition use LocalSessionFactoryBean which works, along
with the mapping file...
The second bean which uses AnnotationSessionFactoryBean , is NOT able to
read the persistant classes from the specified jar file ..
But it is not able to find any annotated files . Reading Hibernate documentation, it say I need to speficy it via theCode:<!-- this works --> <bean id="sfOne" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" parent="abstractSessionFactory" > <property name="dataSource" ref="ds" /> <property name="mappingJarLocations"> <list> <value>classpath:hbmFiles.jar</value> </list> </property> </bean> <!-- this does NOT work --> <bean id="sfTwo" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" parent="abstractSessionFactory" > <property name="dataSource" ref="ds" /> <property name="mappingJarLocations"> <list> <value>classpath:hbmFiles.jar</value> </list> </property> </bean>
<property name="annotatedClasses"> and
<property name="annotatedPackages"> properties...
But I dont want to list the induvidual class, pkgs one by one... Surely there
is a way to read from a jar file ?


Reply With Quote