我在 GWT 中有一个带有 spring 和 hibernate 的项目,我在 applicationcontext.xml 下面使用,我只是在寻找一些最好的方法来制作这个文件,就像下面的所有带注释的类一样,即 entity.user、entity.secretQuestion 等等,他们即使我不需要它们,当我的应用程序运行时都会调用它们,我想这会使我的应用程序很慢,所以有可能只有我正在调用的类在 applicationcontext.xml 中加载,如果是,那么它会也是一种更好的方法吗?
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="annotatedClasses">
<list>
<value>com.cricsite.persistence.entity.User</value>
<value>com.cricsite.persistence.entity.SecretQuestion</value>
</list>
</property>
</bean>
<bean id ="ManagerAdmin" class= "com.persistence.MySQLRdbHelper">
<property name="sessionFactory" ref="sessionFactory" />
</bean>