This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes HQL I want to get all events in which user participate. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HQL I want to get all events in which user participate." Watch "HQL I want to get all events in which user participate." New topic
Author

HQL I want to get all events in which user participate.

Dejan Tadic
Greenhorn

Joined: Aug 20, 2012
Posts: 2
I want to get all events in which user participate.
My HQL for it is: from Event e join e.participantsList userdata where userdata.userid=:fuserid
but it does not work...help please,pretty please with sugar on top



Tables in db:
event(eventid)
userdata(userid,nickname)
event_userdata(eventid,userid)

[Added code tags - see UseCodeTags for details]


Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1646
    
    7

Welcome to Java Ranch!

Please read ItDoesntWorkIsUseless.

What were you expecting? What happened? Was there an exception with a stack trace? If so post it.


[How To Ask Questions][Read before you PM me]
Dejan Tadic
Greenhorn

Joined: Aug 20, 2012
Posts: 2
Sorry i am new to this form...thanks for let me know

by the way i find the solution on my own.

HQL : select event from Event as event,UserData as user where user.userID=:fuserid
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HQL I want to get all events in which user participate.
 
Similar Threads
one to one unidirectional mapping in jpa
Composite key in collection of basic type
Id not availble in lazy loaded associate objects
Why does EJB assume a join table and how do i get around it?
Getting stuck with persisting a M:M relationship