Dan Benamy
Dan Benamy

Reputation: 837

How do I remove a field from a model in google app engine with java?

http://code.google.com/appengine/articles/update_schema.html shows how to remove a property from a model in python with delattr. Is there a way to do the same in java?

Thanks!

Upvotes: 3

Views: 773

Answers (3)

Ikai Lan
Ikai Lan

Reputation: 2240

App Engine's datastore is schemaless. That means that whatever properties exist on an entity at insert time define that property. All the type information exists in your Java classes.

If your entity has already been deployed to production and you remove a field, this will not retroactively remove the property from entities that have already been saved. You'll have to create a set of Task Queue tasks to go through and re-save all of those entities. It's probably best to take this step before migrating to the new entity so you don't break your business logic elsewhere.

Upvotes: 0

Sug
Sug

Reputation: 802

You simply remove the property from your class code, and recompile.

Upvotes: 0

Markus Knittig
Markus Knittig

Reputation: 631

Yes, there's a method for that in the Low-Level API.

Upvotes: 2

Related Questions