0
votes

Can I pass an objectify entity (i.e class annotated by @Entity) to a function accepting com.google.appengine.api.datastore.Entity ?

2

2 Answers

2
votes

No. Java is a typed language. You can only pass subclasses of com.google.appengine.api.datastore.Entity to a function which accepts com.google.appengine.api.datastore.Entity. Anything else won't compile.

0
votes

No, the entity annotation doesn't change the type of the object. There is no "getProperty" in objectify but you could certainly use reflection or commons BeanUtils to do a similar thing.