设置hibernate/spring项目的最佳方法

设置hibernate/spring项目的最佳方法,spring,hibernate,gwt,Spring,Hibernate,Gwt,我有一个关于GWT中spring和hibernate的项目, 我正在使用下面的applicationcontext.xml, 我只是在寻找制作此文件的最佳方法 像下面所有带注释的类,即entity.user、entity.secretQuestion和更多,它们在我的应用程序运行时都会被调用,即使我不需要它们,我想这会使我的应用程序非常慢, 那么,是否只有我正在调用的类才能在applicationcontext.xml中加载,如果是,那么这也是一种更好的方法 &

我有一个关于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>

com.cricsite.persistence.entity.User
com.cricsite.persistence.entity.SecretQuestion

您可能正在寻找一种叫做“延迟加载”的东西

请看一下这些线