java - Why is getEntityManager() not defined? "Cannot resolve method getEntityManager" -


I'm building an Android app that integrates with Google Epegine Datastore without using GDO.

I am trying to create an endpoint that will allow me to access the data in my datastore. The function I am writing is below, but I am having a strange problem by putting this code in the endpoint java class ...

The error I get is not resolved by the method Can getEntityManager ()

In every example I see online, all this is called this function. That's why it should be a way of working, or I have to do some stupid.

What am I missing? How can I resolve it?

  @ API (name = "getPostsApi", version = "v1", namespace = @ API namepace (ownerDomain = "endpoints.myModule.myCo.com", Owner name = "Endpoints.myModule.myCo.com", PackagePath = "")) Public class GetPostsEndpoint {/ ** * This method lists all the organizations inserted in the datastore. * It uses the HTTP GET method and paging support * * @ Return A Collection Response Class in which the list of all entities is issued * and a cursor on the next page. * / @SuppressWarnings ({"uncheck", "unused"}) @APImath (name = "GetPostsEndpoint") Public Collection Response & lt; NewPostBean & gt; ListStuff (@Nalabal @ Named ("cursor") string cursor string, @ Noble @ Nominated ("border") integer boundary) {EntityManager mgr = null; Cursor cursor = null; & Lt; NewPostBean & gt; Execution = null; Try {mgr = getEntityManager (); // & lt; ---- Brake // query query on this line = MAGR.Creative ("Select from content as content"); // limit = 1; // execution = (list & lt; NewPostBean & gt;) query.getResultList (); // cursor = jpacerhelper.trasser (execution); // (NewPostBen Objeh: Execute) //; //} {// mgr.close () at the end; //} Return Collection Response. & Lt; NewPostBean & gt; the creator (). SetItems (execute) .setNextPageToken (cursorString) .build (); }}    

When I look, I think that they are actually unit manager By creating this class: Public Final Category EMF {Personal Stable Last EntityManagerFactory emfInstance = Perseverence.createEntityManagerFactory ("Transaction-Optional"); Private EMF () {} Public Fixed EntityManagerFactory get () {emfInstance return; }}

Then they call the EMF.get () to get the unit manager. I used just so much and it works what code did you know that call "getEntityManager" out of that blue color like that? GetEntityManager does not appear at all according to the code you posted

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -