Example usage for org.springframework.dao DuplicateKeyException getClass

List of usage examples for org.springframework.dao DuplicateKeyException getClass

Introduction

In this page you can find the example usage for org.springframework.dao DuplicateKeyException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.poscoict.license.web.controller.ExceptionControllerAdvice.java

@ExceptionHandler(DuplicateKeyException.class)
public ModelAndView handleDuplicateKeyException(DuplicateKeyException ex) {
    logger.error(ex.toString());//ww  w . j  av  a  2s .c  o  m
    ModelAndView mv = new ModelAndView(DEFAULT_ERROR_VIEW);
    mv.addObject("name", ex.getClass().getSimpleName());
    mv.addObject("message", "?  ?. ?? ? .");
    return mv;
}