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 Error 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 Error" Watch "HQL Error" New topic

HQL Error

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590

Could anyone please point out the bug of the HQL string?
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590

HQL - want to get Patient_ID, Patient_Name, Hospital_ID and Hospital_Name
Could anyone give me a sample query? I need a left inner join

Bill Gorder

Joined: Mar 07, 2010
Posts: 1646

From Patient

You will get a List<Patient> back just get your values off the object.

I don't understand the need for the composite key. PatientID should be enough. The hospitalid should be a foreign key defined on your Hospital field.

[How To Ask Questions][Read before you PM me]
I agree. Here's the link:
subject: HQL Error
Similar Threads
simple question
namedQuery error : node to traverse cannot be null!
Hibernate Desing issue
i have a Errors in Hibernate Query
error in running HQL Query