one of 4 special methods are required on all entities as they are used by the RequestFactory servlet is:
Integer getVersion()
but i am working on a system that already has a DB schema(MySql), i'd like to use RF to do CRUD operations, so do i have to insert each table a version column? is there other way i can use RF without had each table a "version" column?
thanks very much.
If you can implement a single Locator class that works for all your
entities, then go with it; and otherwise make one for each entity.
For instance, if you have a base class for your entities that provides an ID
and version, then you can easily cast any entity to that class to implement
getId and getVersion, and you probably can implement getIdType by returning
a fixed type.
You can clazz.newInstance() in the create() or use
PersistenceManager#newInstace with JDO.
And you can easily "find" using the Class and ID with JPA using
EntityManager#find(clazz,id), or with JDO using
PersistenceManager#getObjectById(clazz,id).
Basically, you could very well have only one Locator class per "id type".
Oh, and something to keep in mind: the Locator and *your services* instances
(not the ServiceLocator instances though) are cached aggressively and reused
for all subsequent requests, so make sure they are thread-safe !
(have a look at the ServiceLayerCache class to see all "memoized" methods)
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.