I'm trying to build database application using GWT 1.5.3. I use JPA annotations with my objects. It seems in hosted mode GWT's RPC works fine. But when I try to compile my app using GWT-compiler I get errors like: "The import javax.persistence cannot be resolved", "Entity cannot be resolved to a type". toplink-essentials.jar is already included in my project path. What settings else do I need to solve this problem?
相关问题
- JPA one-to-many association to an entity with @Inh
- How does the JPA handle partial, non-disjoint inhe
- How can I access the repository from the entity in
- Should there be an EntityManager per thread in Spr
- How to run GWT in production mode
相关文章
- 这个SpringBoot 2.2.x,怎么判断?
- Hibernate doesn't generate cascade
- Spring NamespaceHandler issue when launching Maven
- Writing CRUDRepository's findBy() method on a
- QueryDSL Window functions
- How to left join unrelated entities?
- JPA configure boolean fields to persist as integer
- How to map an abstract collection with jpa?
You can use Gilead (http://sourceforge.net/projects/gilead/) library to seamlessly manage JPA entities with GWT.
Regards
You need to include the source code for the JPA annotations in the build path for your GWT project. See here for more details:
http://code.google.com/p/google-web-toolkit/issues/detail?id=1830&can=1&q=jpa
Specifically this jar file which will fix your problem:
http://google-web-toolkit.googlecode.com/issues/attachment?aid=1475633892125294312&name=jpa-annotations-source.jar
Simply, keep another version of your Entities but without the annotations!
Rebounding on synergetic's comment, you now (from GWT 1.5) only need to add
to your Module.gwt.xml
I am also working with JPA <--> GWT data transformation etc.
In an effort to eliminate the DTO layer I used Gilead too.
My objection here is about translating javax.persistence. To avoid this I used XML JPA mapping declarations (orm.xml)
Ok, I've found what I was missing. I needed to include jpa-annotations-source.jar in my GWT-compiler path in myapp-compile.cmd script (or in ant build file). By the way can anyone tell me the origin of this jpa-annotations-source.jar file?