objectify

Sort Items Objectify Getting error No matching Index Found

走远了吗. 提交于 2020-01-07 02:55:08
问题 I am trying to sort a list of items by my property 'price' but I'm getting error. This is my filter items = ofy().load().type(MyItem.class) .filter("OtherEntityRef", tmpEntity) .order("price").limit(100) .list(); But we I run it, the log shows the erro: Uncaught exception from servlet java.io.IOException: com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: no matching index found. The suggested index for this query is: <datastore-index kind="MyClass" ancestor="false

Objectify - many writes to same entity in short period of time with and without transaction

人走茶凉 提交于 2020-01-07 02:03:27
问题 What I'm doing is creating a transaction where 1) An entity A has a counter updated to +1 2) A new entity B is written to the datastore. It looks like this: WrappedBoolean result = ofy().transact(new Work<WrappedBoolean>() { @Override public WrappedBoolean run() { // Increment count of EntityA.numEntityBs by 1 and save it entityA.numEntityBs = entityA.numEntityBs +1; ofy().save().entity(entityA).now(); // Create a new EntityB and save it EntityB entityB = new EntityB(); ofy().save().entity

Objectify - many writes to same entity in short period of time with and without transaction

流过昼夜 提交于 2020-01-07 02:03:07
问题 What I'm doing is creating a transaction where 1) An entity A has a counter updated to +1 2) A new entity B is written to the datastore. It looks like this: WrappedBoolean result = ofy().transact(new Work<WrappedBoolean>() { @Override public WrappedBoolean run() { // Increment count of EntityA.numEntityBs by 1 and save it entityA.numEntityBs = entityA.numEntityBs +1; ofy().save().entity(entityA).now(); // Create a new EntityB and save it EntityB entityB = new EntityB(); ofy().save().entity

Using Objectify to concurrently write data on GAE

允我心安 提交于 2020-01-05 16:58:23
问题 Let's for example say I have the following objectify model: @Cache @Entity public class CompanyViews implements Serializable, Persistence { @Id private Long id; private Date created; private Date modified; private Long companyId; ........ private Integer counter; ........ @Override public void persist() { persist(false); } @Override public void persist(Boolean async) { ObjectifyService.register(Feedback.class); // setup some variables setUuid(UUID.randomUUID().toString().toUpperCase());

Using Objectify to concurrently write data on GAE

半腔热情 提交于 2020-01-05 16:57:31
问题 Let's for example say I have the following objectify model: @Cache @Entity public class CompanyViews implements Serializable, Persistence { @Id private Long id; private Date created; private Date modified; private Long companyId; ........ private Integer counter; ........ @Override public void persist() { persist(false); } @Override public void persist(Boolean async) { ObjectifyService.register(Feedback.class); // setup some variables setUuid(UUID.randomUUID().toString().toUpperCase());

Save an entity to memcache but not the disk with Objectify

眉间皱痕 提交于 2020-01-05 09:59:38
问题 I've got an entity that I use for non-critical logging of game completion rates, basically just simple counters. Due to the fact this will be updated hundreds of thousands of times a day (and hopefully growing) it'll live (almost) permanently in memcache. To save myself from having to pay for those hundreds of thousands of writes of non-critical data I'm happy to risk having to object persisted in memcache with a disk write only every 15 minutes or so. I can't see any obvious way to do it,

Save an entity to memcache but not the disk with Objectify

耗尽温柔 提交于 2020-01-05 09:50:03
问题 I've got an entity that I use for non-critical logging of game completion rates, basically just simple counters. Due to the fact this will be updated hundreds of thousands of times a day (and hopefully growing) it'll live (almost) permanently in memcache. To save myself from having to pay for those hundreds of thousands of writes of non-critical data I'm happy to risk having to object persisted in memcache with a disk write only every 15 minutes or so. I can't see any obvious way to do it,

Objectify BATCH delete has no effect

你说的曾经没有我的故事 提交于 2020-01-05 09:15:27
问题 I have a DAO below, with a transactional delete per entity and in batch . Deleting one entity at a time works just fine. Batch delete has NO effect whatsoever : the code below is simple and straightforward IMO, but the call to deleteMyObjects(Long[] ids) - which calls delete(Iterable keysOrEntities) of Objectify - has no effect ! public class MyObjectDao { private ObjectifyOpts transactional = new ObjectifyOpts().setBeginTransaction(true); private ObjectifyOpts nonTransactional = new

Objectify BATCH delete has no effect

一世执手 提交于 2020-01-05 09:15:22
问题 I have a DAO below, with a transactional delete per entity and in batch . Deleting one entity at a time works just fine. Batch delete has NO effect whatsoever : the code below is simple and straightforward IMO, but the call to deleteMyObjects(Long[] ids) - which calls delete(Iterable keysOrEntities) of Objectify - has no effect ! public class MyObjectDao { private ObjectifyOpts transactional = new ObjectifyOpts().setBeginTransaction(true); private ObjectifyOpts nonTransactional = new

Google DataStore with objectify - composite queries on HashMap

六眼飞鱼酱① 提交于 2020-01-05 05:46:06
问题 I am using Google App Engine for my REST service backend and Google dataStore as the DB and objectify for accessing datastore. One of the properties in my entity is Map<String,String> customAttrs; This is because I don't know before hand what all parameters can come from the client. My requirement is that I want to be able to index on these parameters in the HashMap. I looked at the following question: GAE w/ Objectify - Can you query a HashMap? and tried out what was mentioned in the