List jobCri= session.createCriteria(JobTransportList.class) Projections.distinct( Property.forName (JobTransportList._OrderID))) .add( Restrictions.and( Property.forName(JobTransportList._OrderID).isNotEmpty(), ) 因为查询语句中没有使用到OrderID,所以如果使用到isNotEmpty,isNotNull 就会报如下错误,改成 .add(Restrictions.and(Property.forName(JobTransportList._OrderID).ne(new BigDecimal(0)), org.hibernate.MappingException: Property path [pglms.j2ee.domain.tms.JobTransportList.OrderID] does not reference a collection
|
hibernate报错
最新推荐文章于 2022-06-16 16:16:01 发布