objectify

Get an Objectify Entity's Key

此生再无相见时 提交于 2019-12-01 01:31:06
问题 Dummy question. I create my POJO Objectify entity (for example, "Category") and persist it. Then I retrieve it via a query. I want to use it in a one-to-may relationship e.g. want to set my category to one or more "Products". I will have this in my "Product"'s code: Key<Categoria> categoria; So the question is: how can I find my retrieved entity's key for setting it in my product? 回答1: I'm usually adding an extra method: @Transient Key<Categoria> getKey() { return Key.create(Categoria.class,

Why API call take 80 ms latency to reach controller (in Google App Engine)?

北城以北 提交于 2019-11-30 19:04:55
问题 For every Api call to reach controller, it is taking 80ms latency, i have tried all the instance classes, result is same, i have not found any solution for this. As show in the image, RPC call starts at 80th ms, remaining time spending out side of my code. 回答1: Well, there may be a lot of GAE infra code executing for every request before your app code is invoked - it's the nature of PaaS: it gives you the convenience of simpler app code by taking a portion of the stuff that needs to be

Objectify paging with Cursors

非 Y 不嫁゛ 提交于 2019-11-30 18:48:37
I have this method in my RPC service: @Override public Entrata[] getEntrate(int from, int to) { List<Entrata> data = entrateDao.list(); return data.toArray(new Entrata[0]); } As you can see, I am not using the two parameters, which, in a SQL world, I would use as LIMIT and OFFSET. It's not completely clear what I have to do now, I started reading this: http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Cursors I think I have to do a query.startCursor() Then iterate for "TO" times, the page size. All right? Can you help me with some snippets? :) From docs: Cursors let you

How to reduce the memory usage of Appstats on Google App Engine Java

拟墨画扇 提交于 2019-11-30 09:08:37
问题 This is related to question Java Appengine APPSTATS causing java out of memory error. Appstats seems to cause a java.lang.OutOfMemoryError on 128MB instances and I wonder whether there are ways to reduce the amount of logging. Is there a way to filter some package names from the stack trace? GAE API: @14ms memcache.Get real=7ms api=0ms Stack: com.google.appengine.tools.appstats.Recorder:290 makeAsyncCall() com.google.apphosting.api.ApiProxy:184 makeAsyncCall() com.google.apphosting.api

Objectify paging with Cursors

情到浓时终转凉″ 提交于 2019-11-30 03:37:50
问题 I have this method in my RPC service: @Override public Entrata[] getEntrate(int from, int to) { List<Entrata> data = entrateDao.list(); return data.toArray(new Entrata[0]); } As you can see, I am not using the two parameters, which, in a SQL world, I would use as LIMIT and OFFSET. It's not completely clear what I have to do now, I started reading this: http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Cursors I think I have to do a query.startCursor() Then iterate for

How to reduce the memory usage of Appstats on Google App Engine Java

余生颓废 提交于 2019-11-29 12:56:33
This is related to question Java Appengine APPSTATS causing java out of memory error . Appstats seems to cause a java.lang.OutOfMemoryError on 128MB instances and I wonder whether there are ways to reduce the amount of logging. Is there a way to filter some package names from the stack trace? GAE API: @14ms memcache.Get real=7ms api=0ms Stack: com.google.appengine.tools.appstats.Recorder:290 makeAsyncCall() com.google.apphosting.api.ApiProxy:184 makeAsyncCall() com.google.apphosting.api.ApiProxy:123 makeAsyncCall() com.google.appengine.api.memcache.MemcacheServiceApiHelper:104 makeAsyncCall()

GAE+Objectify - Parameterized type com.googlecode.objectify.Ref not supported

霸气de小男生 提交于 2019-11-29 12:03:40
I am using Google App engine1.9.3, Eclipse, Objectify5.03. My Class is as follows: import com.googlecode.objectify.Ref; import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Id; import com.googlecode.objectify.annotation.Load; @Entity public class User { @Id private Long userId; private String userName; @Load private Ref<UserDetails> userDetails; @Load private Ref<UserPassword> userPassword; //getters & setters } When I try creating the google endpoint for this class thru Eclipse, I get the following error: java.lang.IllegalArgumentException:

Looking for opinions on using Objectify-appengine instead of JDO in GAE-J [closed]

南笙酒味 提交于 2019-11-28 19:14:14
I've been slowly and a bit painfully working my way up the datastore/JDO learning curve in GAE. Recently I've found a framework called Objectify that is supposed to be somewhere between the very-simple Datastore native API and the complex JDO. I've been reading up on it and it does seem attractive. What I want to know is, if anyone has much experience with Objectify... How mature is it? Is there much of a user community? Is it ready for heavy-lifting primetime? Could it be abandoned? There doesn't seem to be much discussion of Objectify here or on the web in general, which makes me nervous

GAE+Objectify - Parameterized type com.googlecode.objectify.Ref not supported

橙三吉。 提交于 2019-11-28 05:54:55
问题 I am using Google App engine1.9.3, Eclipse, Objectify5.03. My Class is as follows: import com.googlecode.objectify.Ref; import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Id; import com.googlecode.objectify.annotation.Load; @Entity public class User { @Id private Long userId; private String userName; @Load private Ref<UserDetails> userDetails; @Load private Ref<UserPassword> userPassword; //getters & setters } When I try creating the google endpoint

Appengine DevMode : access denied (“java.lang.RuntimePermission” “accessClassInPackage.sun.security.util”)

十年热恋 提交于 2019-11-28 02:20:50
I upgraded my PC to Ubuntu 12.04 and restored the backup of my workspace and Eclipse afterwards. Now when I try to start my AppEngine/GWT application I run into a problem with the java security manager. Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.util") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366) at java.security.AccessController.checkPermission(AccessController.java:555) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at com.google.appengine