open criteria editor on a type
try do content assist for "session."
It should see it as a hibernate session variable but it does not work.
what is weird that the code does work when actually running the query.
so some context must be set up wrong ?