Are there any in-memory/caching solutions for java that allow for a form of Querying for specific attributes of objects in the Cache?

I realize this is something that a full blown database would be used for, but I want to be able to have the speed/performance of a cache with the Querying ability of a database.