This is how we have done it in the past:
In this example, you are selecting from "ordhdr". In the mapping document for "ordhdr", you would need to have a, many to one, one to many, or many to many mapping to the company object. After this mapping is there you will be able to perform your join to the other object. When you perform the join, you will want to reference whatever name you gave to the property in the "ordhdr" mapping document.
Here is an example of a one to many mapping to your company objet:
Code:
<set name="companys" table="COMPANY" lazy="true" inverse="true">
<key column="COMPANYID" />
<one-to-many class="com.mowyourlawn.dao"/>
</set>
You would then perform your join like this
Code:
SELECT oh.uid FROM ordhdr oh
LEFT JOIN oh.companys AS cmp
WHERE oh.totalprice > 1000