使用hibernate的注意事项

//注意:

1.表名必须与对象名相同(区分大小写),字段名也要和对象名中的属性名相同(不区分大小写)。

2.在查询结果中不能带”*”,应该写成:hql = "select a From UserInfo a where userid>10 and userid<100 order by userid asc";

3.由于查询的结果是以对象的形式,所以不能以字段形式查询 (字段构不成对象)

参考:

https://blog.csdn.net/lin646274404/article/details/42101811

猜你喜欢

转载自blog.csdn.net/jikefzz1095377498/article/details/81384546