-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: 4 object heirarchy with where criteria on 4th object - HQL?
PostPosted: Tue Apr 12, 2005 3:21 am 
Newbie

Joined: Fri Jan 14, 2005 8:30 pm
Posts: 11
We have an object heirarchy that looks like this:

Order
- contains a set of...

OrderItems
- each OrderItem contains (has an association with) a...

Unit
- each Unit contains (has an association with) a...

Product
- Products have a property called...

SKU


The applicable sql tables/colums for this are:

orders.OrderID

orderitems.OrderID (fk to orders.OrderID)
orderitems.Unit ID (fk to units.UnitID)

units.UnitID
units.ProductID (fk to ProductID)

products.ProductID
products.SKU (<-- our desired selection criteria)

----

We need to write a query that retrieves all orders that have products with particular SKUs.

I can do it in SQL but I'm unsure how to express this "join" in objectified notation.

Can anybody help?

Thanks!

- Gary

Hibernate version:
2.1

Name and version of the database you are using:

MySQL 4.1.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.