You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Jay Sissom <js...@gmail.com> on 2004/08/17 22:45:03 UTC

joining in a query

Let's say I have the following 3 tables:

customer
purchase order
purchase order lines

Each purchase order line has a reference to a purchase order.  Each
purchase order has a reference to customer.

I want to do a query where I retreive all purchase order lines sorted
by customer name (among other things).  When I try this, OJB handles
the join between purchase order lines and purchase order, but doesn't
join the customer table.  Is there a way I can force it to include the
customer in the query?

When I did the addOrderBy, I specified "purchaseorder.customer.name"
but when OJB created the SQL, it changed that to "name", but didn't
specify an alias for the field and didn't include customer in the from
or where clauses.  It did join the purchase order lines and the
purchase order table.

Thanks
Jay

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org