openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Talbut <jtal...@spudsoft.co.uk>
Subject Any equivalent to entityManager.find that works on unique keys rather than PK
Date Thu, 18 Jul 2013 19:12:45 GMT
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

Mime
View raw message