Why not use a single int or long value (depending on the number of String values) where each bit position determines if that value was modified? Bit 0 for value1, bit 1 for value2, etc. Then if you want to know if any of the values have been modified, for example, in a query then just query to see if modified property not equal to 0.
Stephen On Tue, Jun 28, 2011 at 7:23 AM, gadev <[email protected]> wrote: > Hi there, > Unfortunately, I have reached a dead-end, I have a number of entities, for > example: > @Entity > class MyEntity { > @Id > String uid; > String value1; > String value2; > String value3; > ... > } > The entity is set by a back-end job with default data. The entity is used to > populate a form in the UI, and all field are displayed with grey color font. > The user is allowed to edit those details and that means that the UI should > display the edited values with a different color-font. > So how do I manage this? Should each entity have a flag for each attribute > denoting if it changed or not? > Should I split my entity to smaller entities, for instance, > @Entity > class Value1Entity { > @Id > String uid; > String value1; > boolean modified=false; > } > > @Entity > class Value2Entity { > @Id > String uid; > String value2; > boolean modified=false; > } > > @Entity > class Value3Entity { > @Id > String uid; > String value3; > boolean modified=false; > } > Taking into account latency and performance issues and of course managing > code what is the best solution? Or what else would you suggest.. > Many thanks, > G > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-appengine-java/-/qw16neegNewJ. > 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-appengine-java?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-appengine-java?hl=en.
