Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚开始使用 JAVA jpa。到目前为止,我只尝试了有效的 persist 方法。我在运行以下查询时遇到问题
Customer = Customer(manager.createQuery("Select c FROM Customer c where c.LastName=\"Lname\""));
但是在上述情况下,我的 Customer 类没有被识别。我这样做对吗?
查询对象不能进行类型转换,所以我通过使用解决了这个问题
query = em.createQuery( "SELECT c FROM Country c WHERE c.name = 'Canada'"); Country c = (Country)query.getSingleResult();