* @param entity
* @return saved entity
* @throws InternalErrorException (DuplicateInstanceException, ReflectionException)
*/
public <T> T save(T entity) throws InternalErrorException {
IAction action = new PersistAction(entity, PERSIST_MODE_SAVE);
return (T) new ActionProcessor(action).processAction();
}