-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: using generated table names in filter
PostPosted: Fri May 19, 2006 7:39 pm 
Newbie

Joined: Thu Aug 04, 2005 6:14 pm
Posts: 16
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.