Example usage for org.springframework.dao DataAccessException getClass

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

Introduction

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

Prototype

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

Source Link

Document

Returns the runtime class of this Object .

Usage

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

public boolean deleteCalendarItem(Long id) {
    if (log.isDebugEnabled()) {
        log.debug("deleteCalendarItem( " + id + ")");
    }/*from w  ww  .  ja v a 2s  .  co  m*/

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

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

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

    try {/*from w  w  w.j av a  2 s. 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 + ")");
    }/*from  w ww . j  a va  2  s  . co  m*/

    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 + ")");
    }/*from  ww  w .  ja  v  a  2s  .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 + ")");
    }//ww  w  .  j av a2  s  .  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 + ")");
    }//  w  w w  . j  a  va 2s  .  co m

    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 {//from  w  w w  . j  a  va2  s  . c o m
        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   www.j  av  a2 s  .  c om*/
    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  . java 2 s  .  c  o  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 + ")");
    }//from   www  .ja  va  2s .  com

    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;
    }
}