当前位置: 首页>>代码示例>>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;未经允许,请勿转载。