开发者

GAE, change an class for a persistent object

I have a web application with some data in its datastore. I have just finished another version of it, in which i changed one of the persistent classes. Basically, there is a class called "Node" (which represents a node in a hierarchy tree), that used to have it's author as a

private CmsUser author;

and now it stores its author as private Key author.

When i deployed that second version to the server (as another version), it didnt work (which is predictable).

Is there any way to make it work? Or do i have to create another entity instead of the Node thing and write a piece of code that would change all my old no开发者_运维知识库des into new ones?

Thanks.


You will have to write some code that loads each Node in its old form, then saves it in the new form.

Since it looks like you are using java, you can do this with the low level API. If you were using Python, there is a trick you can do with Expando. See here

You might want to try the new Mapper API to handle looping through all your entities.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜