following are my configuration of hibernate:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="annotatedClasses">
<list>
<value>${project.groupId}.domain.User</value>
<value>${project.groupId}.domain.Role</value>
<value>${project.groupId}.domain.Permission</value>
<value>${project.groupId}.domain.PermissionCategory</value>
</list>
</property>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
</value>
</property>
</bean>
i was wondering if it’s possible to make generic definition of annotated classes instead of adding an entry for each class, something like:
<value>${project.groupId}.domain.*</value>
if anyone have an idea, please advise, thanks in advance.
AnnotationSessionFactoryBeansupports thepackagesToScanproperty as an alternative toannotatedClasses, so you should be able to do this: