CARVIEW |
Select Language
HTTP/2 200
date: Fri, 18 Jul 2025 13:18:30 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"ec1d092e41448b9faff0b032e43beff3"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=8hJgyRlbAmHou%2BTRpvz2XWxNNKuRbxhBK6pqAhHEcsATKgIIwF5sRjO0XDhU5xIokRY9M2OT3P8xUkWxST5OKUF5v%2Bvm%2FMfReN9MoxxHchmujLPeUrUsN0Y1oLTB4njLhvyh328v%2FYvje6nF%2FETgfEW5S8Xvge3Tkbbcs0cfgf3q8HupwtWxw9Ch1ywNgz1bYb0H4G58j3K8KKmTAhj0HrbD0w1oJlbqZ1CYu3ub94jvOMNQZ6FzPfLIjrRwQtVu9BSAgyf%2BuhALE7fmT1ngbw%3D%3D--X4Ar%2Bd6zGbIOd04Z--DM4kvK16pm1Le%2BMdZSbvUg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1194814750.1752844710; Path=/; Domain=github.com; Expires=Sat, 18 Jul 2026 13:18:30 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sat, 18 Jul 2026 13:18:30 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: B286:2137CF:F63973:12546DE:687A49A6
Home · objectify/objectify Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 162
Home
dxy edited this page May 20, 2016
·
4 revisions
Objectify is a Java data access API specifically designed for the Google App Engine datastore. Its goals are to:
- Be easy to learn and understand.
- Support all native datastore features in an intuitive, human-friendly way.
- Model sophisticated, strongly-typed, polymorphic data structures.
- Enable modular, EJB-like transactional logic.
- Increase performance and decrease cost through smart, transaction-aware caching.
- Allow major schema migrations "in-place" with zero downtime.
- Seamlessly coexist with other datastore tools: the Java Low-Level API, JDO/JPA, Twig, Go, Python DB and NDB.
Objectify provides a level of abstraction that is high enough to be convenient, but low enough not to obscure the key/value nature of the datastore. It is intended to be a Goldilocks API - not too low level, not too high level, just right.
If you are new to Google App Engine, start with Concepts
This is a quick tour of what using Objectify looks like, intended to give you a taste of the framework. Full explanations can be found later in the documentation.
A simple entity:
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;
@Entity
public class Car {
@Id Long id;
@Index String license;
int color;
}
Somewhat more complicated:
import com.googlecode.objectify.annotation.AlsoLoad;
import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.IgnoreSave;
import com.googlecode.objectify.annotation.Load;
import com.googlecode.objectify.annotation.OnLoad;
@Entity
@Cache
public class Motorcycle {
@Id String vin;
@Load List<Ref<Person>> owners = new ArrayList<Ref<Person>>();
@AlsoLoad("colour") int color;
@IgnoreSave boolean ktm;
@OnLoad public void onLoad() {
if (ktm)
color = ORANGE;
}
}
import static com.googlecode.objectify.ObjectifyService.ofy;
Car porsche = new Car("2FAST", RED);
ofy().save().entity(porsche).now(); // async without the now()
assert porsche.id != null; // id was autogenerated
// Get it back
Result<Car> result = ofy().load().key(Key.create(Car.class, porsche.id)); // Result is async
Car fetched1 = result.now(); // Materialize the async value
// More likely this is what you will type
Car fetched2 = ofy().load().type(Car.class).id(porsche.id).now();
// Or you can issue a query
Car fetched3 = ofy().load().type(Car.class).filter("license", "2FAST").first().now();
// Change some data and write it
porsche.color = BLUE;
ofy().save().entity(porsche).now(); // async without the now()
// Delete it
ofy().delete().entity(porsche).now(); // async without the now()
- Home
- Concepts
- User's Guide
- Examples
- API Javadoc
- Release Notes
- Best Practices
- Frequently Asked Questions
- Extensions
- Contributing To Objectify
- User's Guide (Objectify v4)
- User's Guide (Objectify v3)
Clone this wiki locally
You can’t perform that action at this time.