首页 新闻 搜索 专区 学院

ssh进行查询时报错,求找不到House类的原因,House类为自己写的dto类

0
悬赏园豆:100 [已关闭问题] 关闭于 2016-10-13 17:18
//这是houseDaoImpl类
@Repository("houseDao")
public class HouseDaoImpl extends HibernateDaoSupport implements HouseDao {
    @Resource(name="sessionFactory")  
      public void setSessionFactoryDI(SessionFactory sessionFactory) {  
         //调用父类的setSessionFactory方法,注入sessionFactory  
          super.setSessionFactory(sessionFactory);  
      }  
    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public List<House> findPage(final Integer pageno) {
        final String hql="select new House(a.id,a.title,a.rent,a.issuetime) from THouseinfo a ";
        return this.getHibernateTemplate().executeFind(new HibernateCallback() {
            @Override
            public Object doInHibernate(Session session)
                    throws HibernateException, SQLException {
                return FindPage.getList(session, hql, pageno);
            }
            
        });
    }

这是配置文件
<context:annotation-config></context:annotation-config>
    <context:component-scan base-package="com.dao,com.service,com.action"></context:component-scan>

    <bean id="dataSource"
        class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName"
            value="oracle.jdbc.driver.OracleDriver">
        </property>
        <property name="url"
            value="jdbc:oracle:thin:@localhost:1521:orcl">
        </property>
        <property name="username" value="scott"></property>
        <property name="password" value="tiger"></property>
    </bean>
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource" />
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.Oracle9Dialect
                </prop>
                <prop key="show_sql">true</prop>
                <prop key="format_sql">true</prop>
            </props>
        </property>
        <property name="mappingResources">
            <list>
                <value>com/pojo/THousetype.hbm.xml</value>
                <value>com/pojo/TCounty.hbm.xml</value>
                <value>com/pojo/TUser.hbm.xml</value>
                <value>com/pojo/THouseinfo.hbm.xml</value>
                <value>com/pojo/TStreet.hbm.xml</value></list>
        </property></bean>

下面是错误信息

[cause=java.lang.ClassNotFoundException: House]

究其一生的主页 究其一生 | 初学一级 | 园豆:4
提问于:2016-10-12 19:40
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册