{
if (getPersistenceContext() == null)
{
throw new IllegalStateException("Unable to get a Persistence Context to load Entity. Make sure you have an SMPC called entityManager configured in components.xml (or have correctly configured s:convertEntity to use another SMPC).");
}
Identifier identifier = EntityIdentifierStore.instance().get(key);
if (identifier != null)
{
return identifier.find(getPersistenceContext());
}
else
{
return null;
}