因为持久属性projectNo的
Long类型是,所以创建Parameterexpression时的type参数应该是
Long。因此,由于Parameterexpression的
Long类型为,因此参数值的类型也应为Long:
//because this persistent Attribute is Long:private Long projectNo;//we use Long here as wellParameterexpression<Long> pexp = cb.parameter(Long.class, "projectNo");...//and finally set parameter. Long again, because that is the type // type of Parameterexpression:query.setParameter("projectNo", Long.valueOf(projectNo));
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)