I have an Class with a unidirectional one to many relationship as follows:
public class Order {
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name=\"o
It sounds like you want to map the other side of this relationship i.e. make this bi-directional mapping.
Then you can use the order number in your HQL:
from Item as item where item.amount > :amount and item.order.id = :orderId
From the HQL documentation:
from Cat as cat where cat.mate.id = 69 The query is efficient and does not require a table join.
The fact that you are trying to do this query suggests that the relationship between a Line and its Order is important!