Greetings!
Is it possible to filter a property of the type Map?
I have the following case (classical):
There are two classes Company and Person. These classes are associated using Temporal Property pattern (also known as Historical Mapping). Effectively, class Person has a property of type Map where the key is a Date when the employment has started and the value is the Company that employed Person.
This assosication was mapped as follows
<map name="companies" table="company_perosn_xref" lazy="true" order-by="change_date" access="field">
<key column="person_id"/>
<index column="change_date" type="date"/>
<many-to-many class="domain.Company" column="company_id"/>
</map>
Because, historically there can be hundreds of records I would like to be able to filter them. So there can be a question "What companies have employed Person since 2002-03-01?".
Idealy, I would like to use something like
Session.filter(Person.getCompanies(), "keyOfMapAsDate >= ?", ..., ...)
resulting in filtering of the Map property Person.companies.
Thanx a lot.
|