google-app-engine
Share class between endpoint and Objectify with different field subset
Say this is my classes #Entity public class Library{ ... } #Entity public class Book{ #Load #Parent #ApiResourceProperty(ignored = AnnotationBoolean.TRUE) private Ref<Library> libraryRef; #Ignore private Library library; } I want to send List<Book> to the "android" client: I don't want the android client to get libraryRef but I want the client to get library Here is the data access method I have now public static List< Book > getAllBooks(){ return OfyService.ofy().load().type(Book.class).list(); } My endpoint will just return List<Book> to android. I believe I have accomplished the first part: make sure datastore does not store library but libraryRef. But how do I accomplish the second part: make sure the client gets library? I am sure it is not yet loaded. How do I make sure it is loaded? Do I have to use my own for-loop for iteration?
My advice for anyone working with code shared between client and server is to make a clean separation between your API objects and your domain objects. It's a little more work up front to make DTOs but it makes your whole system more flexible - if you want to change your domain objects, you don't risk breaking a zillion mobile phone apps that are on a slow (or nonexistant) upgrade cycle.
Related Links
Use a subdomain instead of https://storage.googleapis.com
App Engine Flexible to Cloud Storage Network Unreachable
Google Cloud Search API - is there a limit to number of document puts per second?
Stackdriver Analysis report unavailable error
Dependencies not installing from lib directory in google app engine
what is uri / server error
GAE : What is the preferred way of ensuring an outside task really finishes?
WebRTC app.yaml file does not exists
collection_name for ndb.KeyProperty
Is there any way to access Firebase from an App Engine servlet without using manual scaling or the flexible environment?
Why does Google Cloud SQL (using JDBC) take longer to insert records from Google App Engine than from my personal computer?
How do I track Google account logins on python GAE?
Delete and Rename events in google drive
App Engine - How to Clear Cookie
How do I get the path to the Cloud SDK directory using the gcloud command?
Cannot reach Endpoint method with cURL