首页 > 代码库 > ArrayIndexOutOfBoundsException

ArrayIndexOutOfBoundsException

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 没查出数据引起

ArrayIndexOutOfBoundsException