- This topic has 2 replies, 3 voices, and was last updated 17 years, 2 months ago by goldsounds.
-
AuthorPosts
-
DeanJonesMemberit has become painfully apparent that GWT and Hibernate don’t play well together. Hibernate mapped POJO’s are instrumented and will not compile/serialize to JavaScript. The only solution I have found is to create “mirror classes”, one for Hibernate, identical for GWT, and use this code http://gwt-spring-hibernate-reference.googlecode.com/svn/trunk/GWT_Spring_Hibernate_Sample/server_src/org/gwtspringhibernate/reference/rlogman/server/GeneralHelper.java
to, via reflection, copy all properties. It takes care of one problem intrinsic to Hibernate, mapped Date columns aren’t really java.util.Date, but java.sql.Date, which also wont serialize. It does not handle collections, or things much needed like BigDecimal.
A bit of tooling would really help here. Generate the mirror POJO’s, instead of reflection, generate Helpers to copy the properties, fix the Date types, provide options on copy of embedded collections, generate RemoteService stubs, add GWT Capabilities to a project, etc…
I don’t need a visual designer, just some things to take out the repetitive grunt work.
Riyad KallaMemberI wonder if using JPA works any smoother? With the new JPA tooling in MyEclipse it’s almost too easy not to use it, but it does annotate the classes up (dunno if GWT has rules against annotations)
goldsoundsMemberAs of v1.4, GWT’s java->javascript compiler doesn’t support Java5 syntax. That means no generics and no annotations (hence the typeArgs hack).
In GWT 1.5 Java5 syntax will be supported. What this means for JPA and Hibernate Annotations is yet to be seen, but I can’t imagine that Google would put in Java5 syntax support without supporting the primary use of this feature, i.e. simple persistence.
Speaking of which – does anyone else see embedding persistence specifics into code as being a potential portability nightmare? What about schema changes/upgrades? I haven’t tried to _maintain_ an app with annotation-based persistence yet. Anyone been bitten?
D
-
AuthorPosts