The problem of encapsulating Order strength in hibernate

When encapsulating the order instance, the code was written as

String hql="select new Order(id,money,receiverInfo) from Order";

            List list = s.createQuery(hql).list();
           

So it reports an error. . . The reason is that Order is occupied in the system, and the system will report an error when you encapsulate the instance with new Order


String hql="select new com.itheima.domain.Order(id,money,receiverInfo) from Order";

            List list = s.createQuery(hql).list();
        
            is written so that it will not find other Orders in the system by default

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325772134&siteId=291194637