开发者

hibernate sql query

开发者 https://www.devze.com 2023-03-20 04:02 出处:网络
I\'m trying to implement my very first hibernate sql query public List<Subjectgrouplist> getSubjectgroups() {

I'm trying to implement my very first hibernate sql query

public List<Subjectgrouplist> getSubjectgroups() {
    return hibernateTemplate.find("from subjectgrouplist where id > 0");
}

I'm trying to return all of the table. I know the where clause is not suitable, but I still开发者_C百科 tried it out. Can someone tell me how to build the query?

I aim is to print the list in jsp with foreach-tag.


Try this:

public List<Subjectgrouplist> getSubjectgroups() {
    return hibernateTemplate.find("from SubjectGroup x where x.id > 0");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消