• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL to return subsets of Hibernate objects

 
M Burke
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to get only some of the fields from a table. But one of the fields is a Set. When I run this HQL, I get a syntax error on the Set. How can I fix this?

Here is a simple example:

HQL: select hiberJdo.s1, hiberJdo.set1 from HiberJDO as hiberJdo

Hibernate Class:
class HiberJDO{

public String s1;
public String s2;
public String s3;

public Set set1 = new HashSet(0);


}




 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How you have map this POJO and what exception you get?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic