The expected length of an alias is 0; the actual length is 1 cache of the sleeping request

String q1Str = "SELECT parent_id FROM meta WHERE st_id = "+childIds+";";
Query q1 = em.createNativeQuery(q1Str);
//q1.setHint("org.hibernate.cacheable", true);
Object parentId = null;
try{
parentId = q1.getSingleResult();
}catch(NoResultException nre){
    //nope
}

      

the inclusion hibernate.cacheable

will throw me the following exception

the expected length of aliases is 0; actual length 1

+3


source to share


1 answer


I think this happens when there is no primary key in the requested table.



0


source







All Articles