if (jdoe instanceof JDODataStoreException)
{
// JPA doesnt have "datastore" exceptions so just give a PersistenceException
if (jdoe.getNestedExceptions() != null)
{
return new PersistenceException(jdoe.getMessage(), jdoe.getCause());
}
else
{
return new PersistenceException(jdoe.getMessage(), jdoe);
}
}
else if (jdoe instanceof JDOObjectNotFoundException)
{
return new EntityNotFoundException(jdoe.getMessage());
}
else if (jdoe instanceof JDOUserException)
{
// JPA doesnt have "user" exceptions so just give a PersistenceException
if (jdoe.getNestedExceptions() != null)
{
return new PersistenceException(jdoe.getMessage(), jdoe.getCause());
}
else
{
return new PersistenceException(jdoe.getMessage(), jdoe);
}
}
else if (jdoe instanceof JDOOptimisticVerificationException)
{
if (jdoe.getNestedExceptions() != null)
{
return new OptimisticLockException(jdoe.getMessage(), jdoe.getCause());
}
else
{
return new OptimisticLockException(jdoe.getMessage(), jdoe);
}
}
else
{
// JPA doesnt have "internal" exceptions so just give a PersistenceException
if (jdoe.getNestedExceptions() != null)
{
return new PersistenceException(jdoe.getMessage(), jdoe.getCause());
}
else
{
return new PersistenceException(jdoe.getMessage(), jdoe);
}
}
}