public class SmUsersTbDAOimpl extends HibernateDaoSupport implements SmUserTbDAO{
/*
* 读取用户权限值
*/
public List ReadUserValue(String id)
{
String HQL = "from SmUsersTb where userno ='"+id+"'"+" and operprivno like '%ISPT%'";
return getHibernateTemplate().find(HQL);
}
}
当我从外面调用的时候,如果库里有多条记录,每次返回的记录的条数会是正确的,但是内容都是重复.只会找出第一条记录,找了半天也不知道是哪出错了.其他的方法都行,就这个不行.哪位帮忙看看.
public class SmUsersTb {
/*
* 用户权限表对应用户管理中心系统表sm_user_priv_tb
* 功能:查找用户权限
*/
private String userno;// 用户ID
private String operprivno;// 用户权限
public SmUsersTb()
{}
public SmUsersTb(String userno,String operprivno)
{
this.userno =userno;
this.operprivno = operprivno;
}
public String getOperprivno() {
return operprivno;
}
public void setOperprivno(String operprivno) {
this.operprivno = operprivno;
}
public String getUserno() {
return userno;
}
public void setUserno(String userno) {
this.userno = userno;
}
}
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="com.sunyard.ispt.model.impl.SmUsersTb" table="sm_user_priv_tb" schema="dbo" catalog="SYSTEM_MANAGE_DB">
<id name="userno" type="java.lang.String">
<column name="user_no" length="20"/>
</id>
<property name="operprivno" type="java.lang.String">
<column name="oper_priv_no" length="50" not-null="false"/>
</property>
</class>
</hibernate-mapping>