Quantcast
Channel: User Just code - Stack Overflow
Viewing all articles
Browse latest Browse all 41

Google Datastore convert POCO to Entity

$
0
0

I am using Google Datastore as DB.This is the code I have been using.

DatastoreService datastore = getDataStoreService();Key rootKey = getRootKey(identity, entityTypeEnum);

The problem is for the entire solution to put any entity I have to use

Entity entity = getOrCreateEntity(EntityTypeEnum.AdminData);entity.setProperty(Constants.ID, auditEntry.getId());entity.setProperty(Constants.APPNAME, auditEntry.getId());getDataStoreService().put(entity);

What I want is there any way we can use generics here? or any entity framework kind of framework which we can use for entire application.

So, convert POCO class to Entity while storing and retrieving?

I could not find any help from GCP documents.


Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>