Hi all;
l have a problem with the query cache on a table wich has no pk. I know it's bad, but i have no other choice.
Th problem is that i defined in the mapping file some properties as part of the composite key. However, these properties may be null.
The problem comes when i want to use the query cache: the first time the query is executed, the identifiers are put into the cache.
And the next time the query is executed, the values of the identifiers are get from the cache.
Then, if the objetcts corresponding to these identifiers are not in the cache, hibernate temps to load them.
Here is the problem: i saw that when it temps to load an objet with null key properties, it replaces null by '' in the query... And so, i get an object not found exception...
Is there a mean to avoid this? (except by putting a pk or avoiding to use the query cache...)
Thanks in advance for the answer.
|