* @param status the status to which messages are posted
*/
@SuppressWarnings("unchecked")
protected IEntity loadEntityByPrimaryKey(PrimaryKeySearch search, Status status) {
try {
final ModelKey mkey = search.getKey();
final IEntityType et = mkey.getEntityType();
final Class<IEntity> ec = (Class<IEntity>) context.getEntityTypeResolver().resolveEntityClass(et);
final IEntityService<IEntity> svc = getEntityService(et);
final IEntity e = svc.load(new PrimaryKey(ec, mkey.getId()));
return e;
}
catch(final EntityNotFoundException e) {
RpcServlet.exceptionToStatus(e, status);
return null;