Hi again,
I am using the table names dynamically generated by hibernate in my filter to limit the result set. The mapping is as follows:
Code:
<bag name="countryStoreProducts" table="categoryproduct">
<key column="categoryid"/>
<many-to-many column="productid" class="CountryStoreProduct" property-ref="productRefKey" />
<filter name="countryStoreFilter" condition="(:countryStoreFilterCountryParam, :countryStoreFilterStoreParam) = (countrysto1_.country_id, countrysto1_.store_id)"/>
</bag>
The problem is that the source table (categoryTable) is missing country and store information to unambiguously refer to all product for that specific store in a certain country. (And no... I of course can't change the DB :-( ).
Anyway... I solved the problem by using the filter as described above to set these values at runtime for each session.
I'm just wondering if this might cause any problems in future and if it's an absolute 'no-go'... I am currently in a read-only case (but I suppose that there might be some trouble with this in non-read-only scenarios)
Is anybody of u using it this way?
Cheers
T.