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");
}
精彩评论