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


Java EntityNotFoundException類代碼示例

本文整理匯總了Java中org.biokoframework.system.entity.EntityNotFoundException的典型用法代碼示例。如果您正苦於以下問題:Java EntityNotFoundException類的具體用法?Java EntityNotFoundException怎麽用?Java EntityNotFoundException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: createEntityNotFound

import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
public static CommandException createEntityNotFound(Class<? extends DomainEntity> entityClass, String entityId) {
	String[] message = sErrorMap.get(FieldNames.ENTITY_WITH_ID_NOT_FOUND_CODE);
	Fields fields = new Fields(
			ErrorEntity.ERROR_CODE, FieldNames.ENTITY_WITH_ID_NOT_FOUND_CODE,
			ErrorEntity.ERROR_MESSAGE, new StringBuilder()
				.append(message[0])
				.append(entityClass.getSimpleName())
				.append(message[1])
				.append(entityId)
				.append(message[2])
				.toString());
	
	ErrorEntity entity = new ErrorEntity();
	entity.setAll(fields);
	return new EntityNotFoundException(entity);
}
 
開發者ID:bioko,項目名稱:system,代碼行數:17,代碼來源:CommandExceptionsFactory.java

示例2: create

import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
public static HashMap<Class<? extends BiokoException>, HttpError> create() {
	HashMap<Class<? extends BiokoException>, HttpError> exceptionMap = new HashMap<Class<? extends BiokoException>, HttpError>();
	exceptionMap.put(BadCommandInvocationException.class, new HttpError(400));
	exceptionMap.put(AuthenticationFailureException.class, new HttpError(401));
	exceptionMap.put(EntityNotFoundException.class, new HttpError(404));
	exceptionMap.put(CommandNotFoundException.class, new HttpError(404));
	
	exceptionMap.put(ValidationException.class, new HttpError(400));
	exceptionMap.put(CommandException.class, new HttpError(500));
	
	exceptionMap.put(EasterEggException.class, new HttpError(418));
	return exceptionMap;
}
 
開發者ID:bioko,項目名稱:http-test,代碼行數:14,代碼來源:HttpResponseExceptionFactory.java

示例3: repositoryEmpty

import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
public static CommandException repositoryEmpty(String entityName) {
	String[] message = sErrorMap.get(FieldNames.REPOSITORY_IS_EMPTY_CODE);
	Fields fields = new Fields(
			ErrorEntity.ERROR_CODE, FieldNames.REPOSITORY_IS_EMPTY_CODE,
			ErrorEntity.ERROR_MESSAGE, new StringBuilder()
				.append(message[0])
				.append(entityName)
				.append(message[1])
				.toString());
	
	ErrorEntity entity = new ErrorEntity();
	entity.setAll(fields);
	return new EntityNotFoundException(entity);
}
 
開發者ID:bioko,項目名稱:system,代碼行數:15,代碼來源:CommandExceptionsFactory.java

示例4: createMap

import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
protected Map<Class<? extends BiokoException>, ? extends Integer> createMap() {
	HashMap<Class<? extends BiokoException>, Integer> map = new HashMap<>();
	
	map.put(BadCommandInvocationException.class, 400);
	map.put(AuthenticationFailureException.class, 401);
	
	map.put(EntityNotFoundException.class, 404);
	map.put(CommandNotFoundException.class, 404);
	map.put(UnknownRouteException.class, 404);

       map.put(ForbiddenAccessException.class, 403);

	map.put(ValidationException.class, 400);
	map.put(CommandException.class, 500);

	map.put(EasterEggException.class, 418);
	
	return map;
}
 
開發者ID:bioko,項目名稱:http-exposer,代碼行數:20,代碼來源:ExceptionResponseModule.java


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