Questions tagged [objectify]

Objectify is a 3rd party Java data access API specifically designed for Google Cloud Datastore in the App Engine Standard runtime. It occupies a "middle ground"; easier to use and more transparent than JDO or JPA, but significantly more convenient than the Low-Level API provided for Cloud Datastore.

Objectify is a 3rd party Java data access API specifically designed for Google Cloud Datastore in the App Engine Standard runtime. It occupies a "middle ground"; easier to use and more transparent than JDO or JPA, but significantly more convenient than the Low-Level API provided for Cloud Datastore.

It also integrates with the App Engine memcache and taskqueue APIs to simplify common patterns of working with Cloud Datastore.

The Cloud Datastore low-level Java API for App Engine Standard is simple and elegant, neatly reducing your data operations to four simple methods: get, put, delete, and query. However, it is not designed to be used by the average developer:

  • DatastoreService persists GAE-specific Entity objects rather than normal POJO classes.
  • DatastoreService Keys are untyped and error-prone.
  • DatastoreService has a machine-friendly but not human-friendly query interface.
  • DatastoreService has an unnecessarily complicated transaction API.

Objectify provides a convenient layer which addresses these issues, yet preserves the elegance of get, put, delete, and query.

1145 questions
26
votes
6 answers

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

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. …
tempy
  • 1,567
  • 2
  • 18
  • 28
22
votes
4 answers

Python Lxml (objectify): Checking whether a tag exists

I need to check whether a certain tag exists in an xml file. For example, I want to see if the tag exists in this snippet:
Hi ...
Currently, I am using an ugly hack with…
Biosci3c
  • 772
  • 5
  • 15
  • 35
18
votes
5 answers

Objectify 5.1 Context Not Started Error due to missing ObjectifyFilter

with the latest version of Objectify (5.1), am getting following error when i try to access the ofy() method You have not started an Objectify context. You are probably missing the ObjectifyFilter. If you are not running in the context of an http…
Ramesh Lingappa
  • 2,448
  • 20
  • 33
16
votes
3 answers

When do you register classes in Objectify for GAE?

So this might be kind of a dumb question but when do you register classes with: ObjectifyService.register( User.class ); Currently, I'm doing this in the constructor of an interface-like class that I use in my other classes to simplify usage of the…
Brandon
  • 4,486
  • 8
  • 33
  • 39
16
votes
4 answers

Objectify with Cloud Endpoints

I am using appengine cloud endpoints and objectify. I have previously deployed these endpoints before and now I am updating them and it is not working with Objectify. I have moved to a new machine and running latest appengine 1.8.6. Have tried…
Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141
13
votes
1 answer

Objectify query filter by list?

Is it possible to make an Objectify query with a list and get a list of all objects matching the list? For example List vinNumberList; Query q=ofy.query(CarObject.class).filter("vin",vinNumberList);
Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141
13
votes
1 answer

How to sort responses in Objectify?

I'm currently building an app for deployment to GAE, using Objectify 3.1. I am getting strange results when attempting to do a query with an order() clause. My domain: public class InvoiceLineItem { private int units; private BigDecimal…
Steve
  • 2,678
  • 8
  • 40
  • 54
12
votes
2 answers

Why Objectify instead of JDO?

I am approaching to Gwt + Gae world. My essential need is to send over the Gwt-Rpc wire my Entity classes, without duplicating them into DTOs. Objectify promise to do that pretty well. It claims it will hide all the "Jdo complexity". I never worked…
Fabio B.
  • 9,138
  • 25
  • 105
  • 177
12
votes
6 answers

How to resolve "You have not started an Objectify context" in JUnit?

I've got some Objectify test code running in JUnit and I'm getting this error: java.lang.IllegalStateException: You have not started an Objectify context. You are probably missing the ObjectifyFilter. If you are not running in the context of an http…
Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113
12
votes
4 answers

Max length of String stored with App Engine?

When storing String fields with App Engine: What is the maximum length() of the String that App Engine datastore can handle? Also if using Objectify, is this max length the same or Objectify does some processing that affect this max length?
quarks
  • 33,478
  • 73
  • 290
  • 513
10
votes
4 answers

Search for substring within an entity using objectify

I have an entity called lastName with value "Benjamin". Is there a way in objectify that if the user put "Ben" or "jam" or "Benja". I still be able to find this entity using query.filter(). I must use the query as there are other search criteria iam…
Shady Hussein
  • 513
  • 8
  • 24
9
votes
2 answers

Objectify paging with Cursors

I have this method in my RPC service: @Override public Entrata[] getEntrate(int from, int to) { List data = entrateDao.list(); return data.toArray(new Entrata[0]); } As you can see, I am not using the two parameters, which, in a…
Fabio B.
  • 9,138
  • 25
  • 105
  • 177
9
votes
2 answers

How to specify legacy incremental IDs with Java

I'm using GAE 1.8.1 and I've hit an issue with Objectify with the new scattered ID system. At least I think it's Objectify, I'm not sure (Using Objectify 4 RC1). I'm getting this.. Caused by: java.lang.IllegalArgumentException: id cannot be zero …
Eurig Jones
  • 8,226
  • 7
  • 52
  • 74
9
votes
1 answer

Objectify Filter by Ref

I have a m-n relationship with Objectify, and I want to get 1 side of the relation. I was trying to solve it with this query: Query query = ofy().load().type(Person.class); query.filter("position", ceo); return…
davibq
  • 1,089
  • 11
  • 31
8
votes
2 answers

How many objects is "too many" for in a single transaction to Google's DataStore (High Replication)?

I have following entity (non-relevant fields/methods are removed). public class HitsStatsTotalDO { @Id transient private Long targetId; public Key createKey() { return new…
expert
  • 29,290
  • 30
  • 110
  • 214
1
2 3
76 77