Hi,

We have a lot of tables with both an integer surrogate primary key and a string unique key. If we know the primary key value in advance we can obtain the entity using entityManager.find, which will obtain the object from the cache if it has already been accessed.

However, typically we will need to find entities using the string unique key - and the only way we have to do that is via a JPA query, which bypasses the cache.

Is there any way to do an efficient query for an entity based on a unique key that will check the cache first?

Thanks

Jim

Reply via email to