hibernate 低级错误,hibernate
分享于 点击 35101 次 点评:22
hibernate 低级错误,hibernate
query=session.createQuery("from "+obj.getClass().getName().substring(5)+" "+obj.getClass().getName().substring(5)+" where "+obj.getClass().getName().substring(5)+".name='"+(String)getname.invoke(obj, new Object[]{})+"' and "+obj.getClass().getName().substring(5)+".password='"+(String)getpassword.invoke(obj, new Object[]{})+"'");在创建sql,hql语句时注意参数带单引号~name=' "+(String)getname.invoke(obj, new Object[]{})+" '
相关文章
- 暂无相关文章
用户点评