当前位置: 首页>>代码示例>>Java>>正文


Java PersistenceException.getMessage方法代码示例

本文整理汇总了Java中org.apache.ibatis.exceptions.PersistenceException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java PersistenceException.getMessage方法的具体用法?Java PersistenceException.getMessage怎么用?Java PersistenceException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ibatis.exceptions.PersistenceException的用法示例。


在下文中一共展示了PersistenceException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAllPendingReservations

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public List<ReservationInformation> getAllPendingReservations(
		ExperimentType type) throws ExperimentException,
		NoReservationsAvailableException {

	try {
		List<ReservationEntry> reservationEntries;

		if (type == null) {
			reservationEntries = service.getAllReservationsFrom(new Date());
		} else {
			reservationEntries = service.getAllReservationsFromByType(
					type.name(), new Date());
		}

		if (reservationEntries == null || reservationEntries.size() == 0) {
			throw new NoReservationsAvailableException("pending");
		}

		return this.processReservationEntries(reservationEntries);

	} catch (PersistenceException e) {
		throw new ExperimentException(e.getMessage());
	}
}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:25,代码来源:ExperimentDBAdapter.java

示例2: setRTAvailability

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public void setRTAvailability(String rt, RTAvailability availability)
		throws ActionException {

	boolean alreadyContained = false;

	try {
		if (rtService.contains(rt)) {
			alreadyContained = true;

			rtService.setStartingAvailability(rt,
					availability.getStartingTime());
			rtService.setEndingAvailability(rt,
					availability.getEndingTime());

		}
	} catch (PersistenceException e) {
		throw new ActionException(e.getMessage());
	}

	if (!alreadyContained) {
		throw new ActionException("rt does not exist");
	}
}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:24,代码来源:RTRepositoryAdapter.java

示例3: createExperiment

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public void createExperiment(String experiment, String author, String type)
		throws ExperimentException, DuplicateExperimentException {

	boolean alreadyContained = true;

	try {

		if (!service.containsExperiment(experiment)) {
			alreadyContained = false;

			ExperimentEntry entry = new ExperimentEntry();
			entry.setAuthor(author);
			entry.setName(experiment);
			entry.setType(type);
			service.saveExperiment(entry);
		}

	} catch (PersistenceException e) {
		throw new ExperimentException(e.getMessage());
	}

	if (alreadyContained) {
		throw new DuplicateExperimentException(experiment);
	}
}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:26,代码来源:ExperimentDBAdapter.java

示例4: addExperimentOperation

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public void addExperimentOperation(String experiment,
		OperationInformation operationInfo) throws ExperimentException,
		NoSuchExperimentException {

	try {
		if (service.containsExperiment(experiment)) {

			int experimentId = service.getExperimentId(experiment);

			OperationEntry entry = new OperationEntry();
			entry.setExperiment(experimentId);
			entry.setType(operationInfo.getType());
			entry.setOperation(operationInfo.getName());

			service.saveExperimentOperation(entry);
		} else {
			throw new NoSuchExperimentException(experiment);
		}

	} catch (PersistenceException e) {
		throw new ExperimentException(e.getMessage());
	}
}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:24,代码来源:ExperimentDBAdapter.java

示例5: setJpg

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public void setJpg(int id, String jpg) throws ActionException {
	try {
		if (!imageService.contains(id)) {
			throw new ActionException("image does not exist");
		}

		String host = this.extractHost(jpg);

		if (host != null) {
			String fileName = this.extractFilename(jpg);

			if (fileName != null) {
				imageService.setJpg(id, host);
			} else {
				imageService.setJpg(id, host);
			}
		}
	} catch (PersistenceException e) {
		throw new ActionException(e.getMessage());
	}
}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:22,代码来源:ImageRepositoryAdapter.java

示例6: setFits

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public void setFits(int id, String fits) throws ActionException {
	try {
		if (!imageService.contains(id)) {
			throw new ActionException("image does not exist");
		}

		String host = this.extractHost(fits);

		if (host != null) {
			String fileName = this.extractFilename(fits);

			if (fileName != null) {
				imageService.setFits(id, host);
			} else {
				imageService.setFits(id, host);
			}
		}
	} catch (PersistenceException e) {
		throw new ActionException(e.getMessage());
	}
}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:22,代码来源:ImageRepositoryAdapter.java

示例7: anyRTReservationBetween

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public boolean anyRTReservationBetween(List<String> telescopes,
		TimeSlot timeSlot) throws ExperimentException {

	boolean available = true;

	try {
		for (String rt : telescopes) {

			if (service.anyRTReservationBetween(rt, timeSlot.getBegin(),
					timeSlot.getEnd())) {

				available = false;
				break;
			}
		}
	} catch (PersistenceException e) {
		throw new ExperimentException(e.getMessage());
	}

	return !available;
}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:22,代码来源:ExperimentDBAdapter.java

示例8: clearAllObsoleteContexts

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public void clearAllObsoleteContexts() throws ExperimentException {

		try {

			List<ReservationEntry> reservationEntries = service
					.getAllReservationsShouldBeObsolete();

			for (ReservationEntry entry : reservationEntries) {
				service.removeReservationContext(entry.getIdreservation());
				service.setReservationStatus(entry.getIdreservation(),
						"OBSOLETE");
			}

		} catch (PersistenceException e) {
			throw new ExperimentException(e.getMessage());
		}

	}
 
开发者ID:GLORIA-project,项目名称:gloria-core,代码行数:19,代码来源:ExperimentDBAdapter.java

示例9: read

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
@Timed("db_storage_read_operation")
@Override
@Transactional
public <T, E extends Exception> T read(Work<T, E> work) throws StorageException, E {
  try {
    return work.apply(storeProvider);
  } catch (PersistenceException e) {
    throw new StorageException(e.getMessage(), e);
  }
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:11,代码来源:DbStorage.java

示例10: insert

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public int insert(M model) throws RepositoryException {
    // automatically set id
	if (model.getId() == 0) {
    	model.setId(nextId());
    }
	
	try{
        return getMapper().insert(model);
    }
    catch (PersistenceException e) {
        throw new RepositoryException(e.getMessage());
    }
}
 
开发者ID:Joycean,项目名称:skeleton-mybatis-persistence,代码行数:14,代码来源:BaseDao.java

示例11: update

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public int update(M model) throws RepositoryException {
    try {
        return getMapper().update(model);
    }
    catch (PersistenceException e) {
        throw new RepositoryException(e.getMessage());
    }
}
 
开发者ID:Joycean,项目名称:skeleton-mybatis-persistence,代码行数:9,代码来源:BaseDao.java

示例12: delete

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public int delete(M model) throws RepositoryException {
    try {
        return getMapper().delete(model);
    }
    catch (PersistenceException e) {
        throw new RepositoryException(e.getMessage());
    }
}
 
开发者ID:Joycean,项目名称:skeleton-mybatis-persistence,代码行数:9,代码来源:BaseDao.java

示例13: get

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public M get(long id) throws RepositoryException {
    try {
        return (M) getMapper().get(id);
    }
    catch (PersistenceException e) {
        throw new RepositoryException(e.getMessage());
    }
}
 
开发者ID:Joycean,项目名称:skeleton-mybatis-persistence,代码行数:9,代码来源:BaseDao.java

示例14: count

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public int count(Map criteria) throws RepositoryException {
    try {
        return getMapper().count(criteria);
    }
    catch (PersistenceException e) {
        throw new RepositoryException(e.getMessage());
    }
}
 
开发者ID:Joycean,项目名称:skeleton-mybatis-persistence,代码行数:9,代码来源:BaseDao.java

示例15: select

import org.apache.ibatis.exceptions.PersistenceException; //导入方法依赖的package包/类
public List<M> select(Map criteria, Regulation regulation) throws RepositoryException {
	try {
        if (regulation != null && regulation.pagination != null) {
        	regulation.pagination.setRowCount(this.count(criteria));
        }
        return getMapper().select(criteria, regulation);
    }
    catch (PersistenceException e) {
        throw new RepositoryException(e.getMessage());
    }
}
 
开发者ID:Joycean,项目名称:skeleton-mybatis-persistence,代码行数:12,代码来源:BaseDao.java


注:本文中的org.apache.ibatis.exceptions.PersistenceException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。