Beginner |
|
Joined: Tue Oct 07, 2003 11:36 am Posts: 46 Location: Rennes, France
|
The case is very simple: Object User is linked to Several Group Instances.
I am trying to dynamically build the request for querying all users whom one of the groups is the one i've got the label "Administrator".
The SQL request would be:
select * from user, user_group, group
where user_group.user_id=user.id
and user_group.group_id=group.id
and group.label="admin"
Can Hibernate generate easily this kind of request ?
The following find query:
"from T0 in class com.bv.entity.User Where (T0.groups.label= ? )"
throws the exception below.
What is the right way to build this kind of filter ?
Thanks for your precious help.
Yann
===========================
Hibernate version: 2.1.6
Full stack trace of any exception that occurs:
net.sf.hibernate.QueryException: expecting 'elements' or 'indices' after: label[from T0 in class com.bv.entity.User Where (T0.groups.label= ? )]
Name and version of the database you are using:
SQLServer 2000
The generated SQL (show_sql=true):
SQL connot be built
|
|