开发者

JPA TopLink Help!

开发者 https://www.devze.com 2023-02-22 15:32 出处:网络
Greetings, As of now I had accomplished building a single-table JPA. But when going to one-to-one or one-to-many. Things get complicated.

Greetings,

As of now I had accomplished building a single-table JPA. But when going to one-to-one or one-to-many. Things get complicated. Especially when it comes to queries with parameters.

I always get an exception on a named-query

Exception Description: Error compiling the query [Subject.searchBySubjectCode: 
SELECT s FROM Subject s WHERE s.subjectcode = :subjectcode], line 1, column 33: 
unknown state or association field [subjectcode] of class [model.Subject].

How is this pos开发者_Go百科sible? Yet I added both entities on the persistence.xml. BTW, I'm using TopLink Essentials and implement the JPA on MVC Architecture. In addition, when I re-open the form, this exception always returns then.

java.lang.IllegalArgumentException: NamedQuery of name: <query> not found.


Solved the problem again... Just used TypedQuery

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号