Wednesday, May 25, 2011

RequestFactory updating issue: update entity which has fields that are not listed in the proxy interface

Hello,

I'm encountering an issue with RequestFactory when I'm trying to update an entity which has properties that are not listed in the proxy objects. For example, in my case I have the following structure: 

Contract
  String contractCode; // gets/sets
  String serviceName; // gets/sets
  Date installationDate // get/sets -> updated from external service, not from the UI

ContractProxy {
  String contractCode;  //gets/sets 
  String serviceName;  //gets/sets
}

and we have a service class ContractService: 
public class ContractService { 
  @Transactional
  public void updateContract(Contract contract) {
    dataStore.get().storeOrUpdate(contract); // twig-persist dataStore object (GAE)
  }
}

So, the problem is that when contract is updated, the installationDate is set to null, cause RF's ContractProxy->Contract transformation doesn't have any information about that installation date. Was wondering how you guys are handling this situations ? 

I know that It could be done by copying and updating some of the properties, but why I have to use RF, when I have to do it manually ? 



--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment