说是映射不成功,可是我有映射,这是我的映射文件:<hibernate-mapping>
<class name="org.zzh.vo.Customer" table="customer" >
<id name="customerId" type="java.lang.Integer">
<column name="customer_id" />
<generator class="native" />
</id>
<property name="custName" type="java.lang.String">
<column name="cust_name" length="100" not-null="true" />
</property>
<property name="password" type="java.lang.String">
<column name="password" length="100" not-null="true" />
</property>
<property name="email" type="java.lang.String">
<column name="email" length="100" not-null="true" />
</property>
</class>
</hibernate-mapping>
在Spring里也有映射:<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.SQLServerDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/zzh/vo/Customer.hbm.xml</value></list>
</property></bean>
所有的映射我都有了,可是为什么还是提示没有映射???????
高手帮忙看一下,谢谢!
还有这个是方法:public boolean findusername(String username, String userpass) { final String HQL="FROM Custormer u where u.custName=? and u.password=?";
String[] hqlParameter=new String[2];
hqlParameter[0]=username;
hqlParameter[1]=userpass;
List list=this.getHibernateTemplate().find(HQL,hqlParameter);
if(list.size()>0){
return true;
}
return false;
}就是到List list=this.getHibernateTemplate().find(HQL,hqlParameter);没法执行下去的!!!
<class name="org.zzh.vo.Customer" table="customer" >
<id name="customerId" type="java.lang.Integer">
<column name="customer_id" />
<generator class="native" />
</id>
<property name="custName" type="java.lang.String">
<column name="cust_name" length="100" not-null="true" />
</property>
<property name="password" type="java.lang.String">
<column name="password" length="100" not-null="true" />
</property>
<property name="email" type="java.lang.String">
<column name="email" length="100" not-null="true" />
</property>
</class>
</hibernate-mapping>
在Spring里也有映射:<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.SQLServerDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/zzh/vo/Customer.hbm.xml</value></list>
</property></bean>
所有的映射我都有了,可是为什么还是提示没有映射???????
高手帮忙看一下,谢谢!
还有这个是方法:public boolean findusername(String username, String userpass) { final String HQL="FROM Custormer u where u.custName=? and u.password=?";
String[] hqlParameter=new String[2];
hqlParameter[0]=username;
hqlParameter[1]=userpass;
List list=this.getHibernateTemplate().find(HQL,hqlParameter);
if(list.size()>0){
return true;
}
return false;
}就是到List list=this.getHibernateTemplate().find(HQL,hqlParameter);没法执行下去的!!!
解决方案 »
- 运算符的 运用
- hibernate外键问题和分页查询问题
- java ssh 刷新页面(浏览器提供的刷新按钮)不会提交到action中更新数据
- 初学hibernate,配置sql2000出错,在线等。
- 请问大家jsp自定义标记应用广吗
- struts入门的简单问题!
- 性別 : <html:radio property="sex" value="女"/>女<html:radio property="sex" value="男"/>男<br/>
- 急求一段修改xml文件中节点的代码,谢谢!
- 请教一个socket问题,服务器端被客户端访问完以后老是出现IOException?!
- jakarta-ant1.5.1怎样安装和使用
- smartupload下载问题
- 请教 J2EE 中文问题!
========================
Customer拼错了吧