使用 Java 迁移 GAE 数据存储中的对象
我有一个应用程序,随着它的增长,各种数据模型类自然需要更改属性(添加、重命名、删除等)。在 MySQL 中,我只需对数据存储运行一组查询,这会改变架构和数据。
我不明白处理 GAE 数据存储的正确方法是什么。我的服务器端应用程序是用 Java 编写的。
具体来说,我想知道如何:
1)重命名现有对象上的字段 2)在现有对象上添加新字段(我认为这会在新对象上自动发生)
感谢您的帮助。
I have an application that naturally as it grows various data model classes need to change attributes (add, rename, remove, etc). In MySQL I would just run a set of queries against the data store that would alter the schemas and the data.
I don't understand what is the correct approach to do with GAE's data store. My application on the server side is written in Java.
Specifically, I would like to know how to:
1) Rename a field on an existing object
2) Add a new field on an existing object (I think this happen automatically on new objects)
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要考虑使用 Objectify 来管理数据存储区;它还能够非常轻松地更新现有模型的架构 。
You may want to consider using Objectify in managing the datastore; it also has the ability to update schemas of existing models quite easily.
最近有人创建了一个工具,可能可以满足您的需求:http://code.google。 com/p/entity-console/
Someone has recently created a tool that would probably do what you need: http://code.google.com/p/entity-console/