On Tue, Mar 17, 2009 at 5:14 AM, Jason Morris <[email protected]> wrote: > Except that objects that are bound to some sort of server-side data store > (DB, FS, whatever) will be > used on both the client and the server. Some of these tools use annotations > to describe parts of the > mapping information (column name / size / type of a field). > > So while the annotations have no effect on the client side code, they may be > needed in order for the > server side code to work correctly, since the same object is being serialized > from client to server. > I am well aware of Hibernates limitations regarding GWT's serialization > mechanism (I haven't used > Hibernate myself in years). I do however make use of EoD SQL and the GWT > compiler hasn't complained > once about my fields being annotated with @ResultColumn or > @AutoGeneratedKeys, since it's not used > anywhere on the client side, it is however kinda important to have at runtime > for the server so the > EoD knows what to put where ;) > > Or am I barking up the wrong dog here?
As of GWT 1.5, you can annotate your Java code with anything you like. Annotations are effectively treated by the GWT compiler as if they were themselves marked with RetentionPolicy.SOURCE. Because the annotation information is "thrown away", there's no need to translate the annotations themselves into Javascript, so the compiler can make productive use of binary-only versions of the annotations. In other words, for annotations (and possibly interfaces, which are similarly declarative), the compiler just needs the .class file somewhere on the classpath at compile time. So, as long as you have the EoD/Hibernate/whatever annotations in compiled form in a JAR somewhere that the GWT compiler can see, you can use .java files that import them with no trouble. Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
