Example usage for org.springframework.dao DataAccessException getLocalizedMessage

List of usage examples for org.springframework.dao DataAccessException getLocalizedMessage

Introduction

In this page you can find the example usage for org.springframework.dao DataAccessException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:org.uhp.portlets.news.service.TopicManagerImpl.java

@Transactional(propagation = Propagation.REQUIRED)
public void addTopic(Topic topic) {

    this.saveTopic(topic);
    List<UserRole> userRoles;
    try {//from  ww w  . j  a v  a 2s.co  m
        userRoles = this.userDao.getUsersRolesForCtx(topic.getCategoryId(), NewsConstants.CTX_C);
        for (UserRole ur : userRoles) {
            if (!"ROLE_USER".equals(ur.getRole())) {
                this.userDao.addUserRole(ur.getPrincipal(), ur.getRole(), NewsConstants.CTX_T,
                        topic.getTopicId(), ur.getIsGroup());
            }
        }
    } catch (DataAccessException e) {
        LOGGER.error("addTopic : " + e.getLocalizedMessage());
    }
}