Thanks. Your method is one of the possible solution. But since I'd like to have a java class mapped to this entity, I have to use a hbm.xml mapping.
I kind of solving my problem by create a view with the join and map this view to a java class. Since I only need to fetch the rows, never do remove and update on it directly, it works for my purpose.
dzarco wrote:
I am newbie, but if I understand you, you could use a named query
<query name="yourQueryName">
<![CDATA[
from A
where keyf=asub.keyf and asub.for_date between asub.begin_date and asub.end_date
]]>
</query>
To test:
Query namedQuery = new Query("yourQueryName")
List list = nameQuery.list()