For the query cache configuration look for hibernate.cache.use_query_cache in the reference manual.
You're right that you will be able to solve this in H3 with the new filters. If you can wait, you bether stop reading here :-).
I solved a similar problem in H2 by making the organization id part of the primary key.
But this gives you an other problem. Foreign keys concist of only one field, but you would like to have two, the foreign primary key and the organization id.
You could try to solve this with views (maybe you need Oracle's instead of triggers).
In H2 you can easily have <many-to-one> proerties which include the origanization id, but you have to set update=false and insert=false. There are ways to make this associations updatable again but it's a hack.
You would have to map the foreign key in an extra property, which is writable. In an Interceptor.findDirty() (!) method you would have to patch this property if the association has changed. Dont' do this if you have other options, since it doens't stick to the API doc of the Interceptor, it's based on the internal implementation of the hibernate session which might change.
HTH
Ernst
|