Exception [EclipseLink-6044] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.QueryException
异常描述:在执行查询期间从行 [DatabaseRecord( => 2)] 读取的主键被检测为空。主键不能包含 null。查询: ReadAllQuery(referenceClass=ResourceHistory sql= "SELECT count(1) FROM omm_logs.resource_history e where e.user_id='f6748e11-6a76-4448-9bf5-af4da5643542' and (e.datetime >= '2013-05-15 16 :29:24' 或 e.datetime <= '2013-06-05 10:32:25' 或 e.service_code LIKE '%5%' 或 e.keyword LIKE '%1%' 或 e.resource_type LIKE '% 1%' 或 e.channel LIKE '%1%')" )
Query cQry=em.createNativeQuery(query,ResourceHistory.class);
long count=(Long)cQry.getSingleResult();
我正在使用 netbeans 7.0.1、mysql 5.x。