I have enabled
<property name="cache.use_query_cache">true</property>
and have added
* @hibernate.cache usage="nonstrict-read-write"
to the XDoclet class level tags of every persistent class. EHCache is configured by default. Log messages reveal that both EHCache and Query Caches are being initialized.
Here is my statement:
FROM GameInvitation AS i
WHERE i.user = ?
AND i.game.status = 'forming'
ORDER BY game_id
I am executing it with the following code
List results = session.createQuery(hql).setCacheable(true).setParameter(0, user, Hibernate.entity(User.class)).list();
On consecutive invocations (in different Sessions, maybe thats the problem) with the same parameter (user), I always get the following SQL output:
Hibernate: select gameinvita0_.id as id, gameinvita0_.game_id as game_id, gameinvita0_.user_name as
user_name from game_invitations gameinvita0_, games game1_ where (gameinvita0_.user_name=? )AND(game
1_.status='forming' and gameinvita0_.game_id=game1_.id) order by game_id
Is there anything I have forgotten?
Regards,
Andreas
|