當前位置: 首頁>>代碼示例>>Java>>正文


Java DataAccessException.getMessage方法代碼示例

本文整理匯總了Java中org.springframework.dao.DataAccessException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java DataAccessException.getMessage方法的具體用法?Java DataAccessException.getMessage怎麽用?Java DataAccessException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.dao.DataAccessException的用法示例。


在下文中一共展示了DataAccessException.getMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createMcUser

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public McQueUsr createMcUser(Long toolSessionID) throws McApplicationException {
try {
    HttpSession ss = SessionManager.getSession();
    UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
    Long userId = toolUser.getUserID().longValue();
    String userName = toolUser.getLogin();
    String fullName = toolUser.getFirstName() + " " + toolUser.getLastName();
    McSession mcSession = getMcSessionById(toolSessionID.longValue());

    McQueUsr user = new McQueUsr(userId, userName, fullName, mcSession, new TreeSet());
    mcUserDAO.saveMcUser(user);

    return user;
} catch (DataAccessException e) {
    throw new McApplicationException("Exception occured when lams is creating mc QueUsr: " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:19,代碼來源:McService.java

示例2: retrieveUser

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
/**
 * Implementation of an abstract method defined in the base class. The
 * retrieveUser() method is called by authenticate() method of the base
 * class. The latter is called by the AuthenticationManager.
 */
@Override
protected final UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication)
		throws AuthenticationException {
	UserDetails details;
	try {
		details = this.getUserDetailsService().loadUserByUsername(username);
		authentication.setDetails(details);
	}
	catch (DataAccessException repositoryProblem) {
		throw new AuthenticationServiceException(repositoryProblem.getMessage(), repositoryProblem);
	}

	if (details == null) {
		throw new AuthenticationServiceException(
				"UserDetailsService returned null, which is an interface contract violation");
	}
	return details;
}
 
開發者ID:melthaw,項目名稱:spring-backend-boilerplate,代碼行數:24,代碼來源:UserDetailsAuthenticationProviderImpl.java

示例3: getAttemptsForUserAndQuestionContent

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public List<VoteUsrAttempt> getAttemptsForUserAndQuestionContent(final Long userUid, final Long questionUid) {
try {
    return voteUsrAttemptDAO.getAttemptsForUserAndQuestionContent(userUid, questionUid);
} catch (DataAccessException e) {
    throw new VoteApplicationException(
	    "Exception occured when lams is getting vote voteUsrRespDAO by user id and que content id: "
		    + e.getMessage(),
	    e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:12,代碼來源:VoteService.java

示例4: updateMcQueUsr

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public void updateMcQueUsr(McQueUsr mcQueUsr) throws McApplicationException {
try {
    mcUserDAO.updateMcUser(mcQueUsr);
} catch (DataAccessException e) {
    throw new McApplicationException("Exception occured when lams is updating mc QueUsr: " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:McService.java

示例5: getMcUserBySession

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public McQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionUid) throws McApplicationException {
try {
    return mcUserDAO.getMcUserBySession(queUsrId, mcSessionUid);
} catch (DataAccessException e) {
    throw new McApplicationException("Exception occured when lams is getting mc QueUsr: " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:McService.java

示例6: getMcUserByUID

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public McQueUsr getMcUserByUID(Long uid) throws McApplicationException {
try {
    return mcUserDAO.getMcUserByUID(uid);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is getting the mc QueUsr by uid." + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例7: updateMcUsrAttempt

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public void updateMcUsrAttempt(McUsrAttempt mcUsrAttempt) throws McApplicationException {
try {
    mcUsrAttemptDAO.updateMcUsrAttempt(mcUsrAttempt);
} catch (DataAccessException e) {
    throw new McApplicationException("Exception occured when lams is updating mc UsrAttempt: " + e.getMessage(),
	    e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例8: refreshQuestionContent

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public List refreshQuestionContent(final Long mcContentId) throws McApplicationException {
try {
    return mcQueContentDAO.refreshQuestionContent(mcContentId);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is refreshing  mc question content: " + e.getMessage(), e);
}

   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:11,代碼來源:McService.java

示例9: removeMcQueContent

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public void removeMcQueContent(McQueContent mcQueContent) throws McApplicationException {
try {
    mcQueContentDAO.removeMcQueContent(mcQueContent);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is removing mc question content: " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例10: getOptionDtos

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public List<McOptionDTO> getOptionDtos(Long mcQueContentId) throws McApplicationException {
try {
    return mcOptionsContentDAO.getOptionDtos(mcQueContentId);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is populating candidate answers dto" + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例11: getMcSessionById

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public McSession getMcSessionById(Long mcSessionId) throws McApplicationException {
try {
    return mcSessionDAO.getMcSessionById(mcSessionId);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is retrieving by id mc session : " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例12: updateMc

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public void updateMc(McContent mc) throws McApplicationException {
try {
    mcContentDAO.updateMcContent(mc);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is updating" + " the mc content: " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例13: findOptionsByQuestionUid

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public List<McOptsContent> findOptionsByQuestionUid(Long mcQueContentId) throws McApplicationException {
try {
    return mcOptionsContentDAO.findMcOptionsContentByQueId(mcQueContentId);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is finding by que id" + " the mc options: " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例14: updateMcOptionsContent

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public void updateMcOptionsContent(McOptsContent mcOptsContent) throws McApplicationException {
try {
    mcOptionsContentDAO.updateMcOptionsContent(mcOptsContent);
} catch (DataAccessException e) {
    throw new McApplicationException(
	    "Exception occured when lams is updating" + " the mc options content: " + e.getMessage(), e);
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:McService.java

示例15: createToolSession

import org.springframework.dao.DataAccessException; //導入方法依賴的package包/類
@Override
   public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) {
// pre-condition validation
if ((toolSessionId == null) || (toolContentId == null)) {
    throw new SubmitFilesException(
	    "Fail to create a submission session" + " based on null toolSessionId or toolContentId");
}

SubmitFilesService.log.debug("Start to create submission session based on toolSessionId["
	+ toolSessionId.longValue() + "] and toolContentId[" + toolContentId.longValue() + "]");
try {
    SubmitFilesContent submitContent = getSubmitFilesContent(toolContentId);
    if ((submitContent == null) || !toolContentId.equals(submitContent.getContentID())) {
	submitContent = new SubmitFilesContent();
	submitContent.setContentID(toolContentId);
    }
    SubmitFilesSession submitSession = new SubmitFilesSession();

    submitSession.setSessionID(toolSessionId);
    submitSession.setSessionName(toolSessionName);
    submitSession.setStatus(new Integer(SubmitFilesSession.INCOMPLETE));
    submitSession.setContent(submitContent);
    submitFilesSessionDAO.createSession(submitSession);
    SubmitFilesService.log.debug("Submit File session created");
} catch (DataAccessException e) {
    throw new SubmitFilesException(
	    "Exception occured when lams is creating" + " a submission Session: " + e.getMessage(), e);
}

   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:31,代碼來源:SubmitFilesService.java


注:本文中的org.springframework.dao.DataAccessException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。