掲示板

service builder issue

3年前 に Scarletake Bwi によって更新されました。

service builder issue

Expert 投稿: 326 参加年月日: 10/12/20 最新の投稿
hi
i use 6.1.1
an weard issue


		dynamicQuery.add(RestrictionsFactoryUtil.between("createdDate", rangeStart.getTime(), rangeEnd.getTime()));
		dynamicQuery.setProjection(ProjectionFactoryUtil.max("versionId"));
		List<long> list = this.dynamicQuery(dynamicQuery);
		if (list == null) {
			LOGGER.debug("null");
		} else {
			LOGGER.debug("size:" + list.size());
			for(Long key:list){
				LOGGER.debug("to " + key);
			}
		}
</long>

the database is empty,
the correct result should be 0, but size of list is 1, and it will throw exception when i try log the 1.

now i use try-catch on it, but i want know how can i distinguish between it's due to no record in database and something wrong?

thank you