aspose file tools*
The moose likes Object Relational Mapping and the fly likes HQL join returns no results. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HQL join returns no results." Watch "HQL join returns no results." New topic
Author

HQL join returns no results.

Mark A. Espinoza
Greenhorn

Joined: Jun 29, 2010
Posts: 2
Hello all,

I am new to hibernate and am having trouble with making a join query in HQL.
This is between 2 classes with a one-to-many/many-to-one relationship.
I am trying to join in the second class based on matches between 2 columns,
where classA.jono = classB.jono. The relationship is one classA to many classB.
I am using a join table. I excluded the attributes I don't use in this query.
I am running this query in the eclipse HQL editor.

classA(Ent24DigB):



classB(EntTrmsJono):



The valid SQL that works is the following:


My HQL running is Eclipse HQL editor:


The HQL will run, no exceptions, warnings, or errors, but will return nothing.
The corresponding join table is empty.
Do I fill it? Does the query fill it? Do I use the "jono" columns somehow in my <set>
declaration? I am lost...despair....must finish...cough...cough. :P

Do you see me needing anything else in my collection definition?

I am running MySQL 5.1 Hibernate 3.3, Hibernate tools 3.2 Eclipse Galileo. Windows XP(not by choice).
Any help appreciated. Let me know of any more details you require.

thanks,
Mark
Mark A. Espinoza
Greenhorn

Joined: Jun 29, 2010
Posts: 2
Anyone?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HQL join returns no results.
 
Similar Threads
Defining HQL in clause parameter on a collection filter
query problem
Cascading non foreign key to Child Table
database-object element giving error in hbm
Hibernate Join Problems