do you mean
Code:
Iterator it = session.iterator(
or
Code:
List list = session.find(
From the javadoc of iterate
Quote:
Entities returned as results are initialized on demand. The first SQL query returns
* identifiers only. So <tt>iterate()</tt> is usually a less efficient way to retrieve
* objects than <tt>find()</tt>.
Read section 7.3 of the reference guide.
Can't help you much on your query 'cause I don't have your mapping files, but the error tells me mp_lote_fk is not a mapped
property of test.Z. Usually in HQL, you do not need to manipulate fks, it's an object query language, so you manipulate objects and relations between objects
An example of 7.3
Code:
select customer, product from Customer customer, Product product join customer.purchases purchase where product = purchase.product
has nothing to do with fk.
Prefer using from test.X as a or from test.X a than a in class test.X, it's the old way to write HQL.