开发者

hibernate sql query

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜