Example usage for org.springframework.dao DataAccessException getMessage

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

Introduction

In this page you can find the example usage for org.springframework.dao DataAccessException 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:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteCalendarItemsWithoutLinks() {
    log.info("deleteCalendarItemsWithoutLinks()");

    try {/*  w  w w  . ja  v  a  2s.  c  om*/
        getJdbcTemplate().update(getStatement("delete.CalendarItems.no.links"));
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteCalendarItemsWithoutLinks: Error executing query: " + ex.getClass() + ":"
                + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteNewsItem(Long id) {
    if (log.isDebugEnabled()) {
        log.debug("deleteNewsItem( " + id + ")");
    }/*w w w .  j  a  va 2s.c  om*/

    try {
        getJdbcTemplate().update(getStatement("delete.NewsItem.by.id"), new Object[] { id });
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteNewsItem: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteCalendarLink(Long personId, Long calendarItemId) {
    if (log.isDebugEnabled()) {
        log.debug("deleteCalendarLink(" + personId + "," + calendarItemId + ")");
    }/* w  w  w. j a v  a2s . c  o m*/

    try {
        getJdbcTemplate().update(getStatement("delete.CalendarLink.by.personId.itemId"),
                new Object[] { personId, calendarItemId });
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteCalendarLinks: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteCalendarLinks(Long calendarItemId) {
    if (log.isDebugEnabled()) {
        log.debug("deleteCalendarLinks( " + calendarItemId + ")");
    }/*from ww  w . j a  va  2s .c om*/

    try {
        getJdbcTemplate().update(getStatement("delete.CalendarLinks.by.itemId"),
                new Object[] { calendarItemId });
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteCalendarLinks: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteCalendarLinks(Long personId, Long contextId) {
    if (log.isDebugEnabled()) {
        log.debug("deleteCalendarLinks( " + personId + "," + contextId + ")");
    }/*from ww w . ja v a  2  s .com*/

    try {
        getJdbcTemplate().update(getStatement("delete.CalendarLinks.by.person.context"),
                new Object[] { personId, contextId });
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteCalendarLinks: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteCalendarLinksBefore(Date expireBefore, boolean starred, boolean hidden) {
    log.info("deleteCalendarLinksBefore( " + expireBefore + "," + starred + "," + hidden + ")");

    try {//  w  w  w .j  a v a 2s.c om
        getJdbcTemplate().update(getStatement("delete.CalendarLinks.by.item_calendarTime.starred.hidden"),
                new Object[] { expireBefore, new Boolean(starred), new Boolean(hidden) });
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteCalendarLinksBefore: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteLinksByContext(String context, String type) {
    log.info("deleteLinksByContext(" + context + ", " + type + ")");
    if (type == null) {
        log.error(this + " deleteLinksByContext: null type string");
        return false;
    }/*from  w  w  w.  ja  v  a 2 s  .com*/
    try {
        if (DashboardLogic.TYPE_CALENDAR.equals(type)) {
            // remove calendar links
            getJdbcTemplate().update(getStatement("delete.CalendarLinks.by.context"), new Object[] { context });
        } else if (DashboardLogic.TYPE_NEWS.equals(type)) {
            // remove news links
            getJdbcTemplate().update(getStatement("delete.NewsLinks.by.context"), new Object[] { context });
        } else {
            // wrong value for the type string
            log.error(this + " deleteLinksByContext: wrong type string " + type);
            return false;
        }
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteLinksByContext: " + context + ", " + type + " Error executing query: " + ex.getClass()
                + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteNewsItemsWithoutLinks() {
    log.info("deleteNewsItemsWithoutLinks()");

    try {/*from w  w w . j a v  a  2s .co m*/
        getJdbcTemplate().update(getStatement("delete.NewsItems.no.links"));
        return true;
    } catch (DataAccessException ex) {
        log.warn(
                "deleteNewsItemsWithoutLinks: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteNewsLink(Long personId, Long newsItemId) {
    if (log.isDebugEnabled()) {
        log.debug("deleteNewsLink(" + personId + "," + newsItemId + ")");
    }//w w  w  . ja  v a  2s .c om

    try {
        getJdbcTemplate().update(getStatement("delete.NewsLink.by.personId.itemId"),
                new Object[] { personId, newsItemId });
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteNewsLinks: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

public boolean deleteNewsLinks(Long newsItemId) {
    if (log.isDebugEnabled()) {
        log.debug("deleteNewsLinks( " + newsItemId + ")");
    }/*ww w .j av a2  s.c  o m*/

    try {
        getJdbcTemplate().update(getStatement("delete.NewsLinks.by.itemId"), new Object[] { newsItemId });
        return true;
    } catch (DataAccessException ex) {
        log.warn("deleteNewsLinks: Error executing query: " + ex.getClass() + ":" + ex.getMessage());
        return false;
    }
}