Example usage for org.springframework.dao InvalidDataAccessApiUsageException getMessage

List of usage examples for org.springframework.dao InvalidDataAccessApiUsageException getMessage

Introduction

In this page you can find the example usage for org.springframework.dao InvalidDataAccessApiUsageException getMessage.

Prototype

@Override
@Nullable
public String getMessage() 

Source Link

Document

Return the detail message, including the message from the nested exception if there is one.

Usage

From source file:ome.logic.UpdateImpl.java

@RolesAllowed("user")
public void deleteObject(IObject row) {
    if (row == null) {
        return;/*from w  ww  . j  a  va  2  s .c  o  m*/
    }
    if (row.getId() == null) {
        throw new ApiUsageException("Non-managed IObject entity cannot be deleted. Must have an id.");
    }
    try {
        doAction(row, new UpdateAction<IObject>() {
            @Override
            public IObject run(IObject value, UpdateFilter filter, Session s) {
                internalDelete(value, filter, s);
                return null;
            }
        });
    } catch (InvalidDataAccessApiUsageException idaaue) {
        throw new ApiUsageException("Cannot delete " + row + "\n" + "Original message: " + idaaue.getMessage()
                + "\n" + "Consider using IDelete instead.");
    }
}