本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}