我在下面的循环中获取数据时遇到问题,即使大小不为零,我在 sysout 的“数据是”中得到空值。那里有什么问题?
List<Long> dd = domainItemMapper.getIsSearchable(34372);
System.out.println("the test is-" + dd.size());
for (int i = 0; i < dd.size(); i++) {
Long isSearch = dd.get(i);
System.out.println("data is"+dd.get(i));
if (isSearch.equals(0)) {
isSearchValue = false;
} else
isSearchValue = true;
}
对数据库的调用是mybatis调用,如下界面
List<Long> getIsSearchable(@Param("parentFieldId") long parentFieldId);
暗示
<mapper namespace="com.ge.dbt.common.persistence.IFormValidatorMapper">
<select id="getIsSearchable" statementType="CALLABLE"
resultType="Long">
select is_searchable from t_field where parent_field_id=#{parentFieldId}
</select>
</mapper>