ArrayIndexOutOfBoundsException

时间:2022-01-15 05:51:44

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0

cusAndComs=this.getEm().createQuery("FROM CusAndCom c WHERE c.hotelCompanyId="+shopId,CusAndCom.class).getResultList();
        return cusAndComs.get(0).getCustomerId();

cusAndComs 没查出数据引起