com.googlecode.objectify.impl
Class AsyncObjectifyImpl

java.lang.Object
  extended by com.googlecode.objectify.impl.AsyncObjectifyImpl
All Implemented Interfaces:
AsyncObjectify
Direct Known Subclasses:
SessionCachingAsyncObjectifyImpl

public class AsyncObjectifyImpl
extends java.lang.Object
implements AsyncObjectify

Implementation of the Objectify interface. Note we *always* use the AsyncDatastoreService methods that use transactions to avoid the confusion of implicit transactions.

Author:
Jeff Schnitzer

Field Summary
protected  com.google.appengine.api.datastore.AsyncDatastoreService ads
          The google object that does the actual heavy lifting
protected  ObjectifyFactory factory
          The factory that produced us
protected  Objectify sync
          The synchronous version of this API; gets initialized by ObjectifyImpl's constructor
protected  com.google.appengine.api.datastore.Transaction txn
          The transaction to use.
 
Constructor Summary
AsyncObjectifyImpl(ObjectifyFactory fact, com.google.appengine.api.datastore.AsyncDatastoreService ds, com.google.appengine.api.datastore.Transaction txn)
          Protected constructor creates a wrapper on the datastore with the specified txn.
 
Method Summary
<T> Result<java.lang.Void>
delete(java.lang.Class<T> clazz, long id)
           
<T> Result<java.lang.Void>
delete(java.lang.Class<T> clazz, java.lang.String name)
           
 Result<java.lang.Void> delete(java.lang.Iterable<?> keysOrEntities)
           
 Result<java.lang.Void> delete(java.lang.Object... keysOrEntities)
           
<T> Result<T>
find(java.lang.Class<? extends T> clazz, long id)
           
<T> Result<T>
find(java.lang.Class<? extends T> clazz, java.lang.String name)
           
<T> Result<T>
find(Key<? extends T> key)
           
<S,T> Result<java.util.Map<S,T>>
get(java.lang.Class<? extends T> clazz, java.lang.Iterable<S> ids)
           
<T> Result<T>
get(java.lang.Class<? extends T> clazz, long id)
          Note that the Result.get() method will throw NotFoundException if entity wasn't found
<S,T> Result<java.util.Map<S,T>>
get(java.lang.Class<? extends T> clazz, S... idsOrNames)
           
<T> Result<T>
get(java.lang.Class<? extends T> clazz, java.lang.String name)
          Note that the Result.get() method will throw NotFoundException if entity wasn't found
<T> Result<java.util.Map<Key<T>,T>>
get(java.lang.Iterable<? extends Key<? extends T>> keys)
           
<T> Result<java.util.Map<Key<T>,T>>
get(Key<? extends T>... keys)
           
<T> Result<T>
get(Key<? extends T> key)
          Note that the Result.get() method will throw NotFoundException if entity wasn't found
 com.google.appengine.api.datastore.AsyncDatastoreService getAsyncDatastore()
          Get the raw AsyncDatastoreService
 ObjectifyFactory getFactory()
          Not currently part of the AsyncObjectify api, but the actual logic lives here.
 com.google.appengine.api.datastore.Transaction getTxn()
          Not currently part of the AsyncObjectify api, but the actual logic lives here.
<T> Result<java.util.Map<Key<T>,T>>
put(java.lang.Iterable<? extends T> objs)
           
<T> Result<java.util.Map<Key<T>,T>>
put(T... objs)
           
<T> Result<Key<T>>
put(T obj)
           
<T> Query<T>
query()
          Not currently part of the AsyncObjectify api, but the actual logic lives here.
<T> Query<T>
query(java.lang.Class<T> clazz)
          Not currently part of the AsyncObjectify api, but the actual logic lives here.
 Objectify sync()
          Get the synchronous version of Objectify.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected ObjectifyFactory factory
The factory that produced us


ads

protected com.google.appengine.api.datastore.AsyncDatastoreService ads
The google object that does the actual heavy lifting


txn

protected com.google.appengine.api.datastore.Transaction txn
The transaction to use. If null, do not use transactions.


sync

protected Objectify sync
The synchronous version of this API; gets initialized by ObjectifyImpl's constructor

Constructor Detail

AsyncObjectifyImpl

public AsyncObjectifyImpl(ObjectifyFactory fact,
                          com.google.appengine.api.datastore.AsyncDatastoreService ds,
                          com.google.appengine.api.datastore.Transaction txn)
Protected constructor creates a wrapper on the datastore with the specified txn.

Parameters:
txn - can be null to not use transactions.
Method Detail

get

public <T> Result<java.util.Map<Key<T>,T>> get(java.lang.Iterable<? extends Key<? extends T>> keys)
Specified by:
get in interface AsyncObjectify
See Also:
Objectify.get(Iterable)

get

public <T> Result<java.util.Map<Key<T>,T>> get(Key<? extends T>... keys)
Specified by:
get in interface AsyncObjectify
See Also:
Objectify.get(Key...)

get

public <T> Result<T> get(Key<? extends T> key)
Description copied from interface: AsyncObjectify
Note that the Result.get() method will throw NotFoundException if entity wasn't found

Specified by:
get in interface AsyncObjectify
See Also:
Objectify.get(Key)

get

public <T> Result<T> get(java.lang.Class<? extends T> clazz,
                         long id)
Description copied from interface: AsyncObjectify
Note that the Result.get() method will throw NotFoundException if entity wasn't found

Specified by:
get in interface AsyncObjectify
See Also:
Objectify.get(Class, long)

get

public <T> Result<T> get(java.lang.Class<? extends T> clazz,
                         java.lang.String name)
Description copied from interface: AsyncObjectify
Note that the Result.get() method will throw NotFoundException if entity wasn't found

Specified by:
get in interface AsyncObjectify
See Also:
Objectify.get(Class, String)

get

public <S,T> Result<java.util.Map<S,T>> get(java.lang.Class<? extends T> clazz,
                                            java.lang.Iterable<S> ids)
Specified by:
get in interface AsyncObjectify
See Also:
Objectify.get(Class, Iterable)

get

public <S,T> Result<java.util.Map<S,T>> get(java.lang.Class<? extends T> clazz,
                                            S... idsOrNames)
Specified by:
get in interface AsyncObjectify
See Also:
Objectify.get(Class, Object...)

find

public <T> Result<T> find(Key<? extends T> key)
Specified by:
find in interface AsyncObjectify
See Also:
Objectify.find(Key)

find

public <T> Result<T> find(java.lang.Class<? extends T> clazz,
                          long id)
Specified by:
find in interface AsyncObjectify
See Also:
Objectify.find(Class, long)

find

public <T> Result<T> find(java.lang.Class<? extends T> clazz,
                          java.lang.String name)
Specified by:
find in interface AsyncObjectify
See Also:
Objectify.find(Class, String)

put

public <T> Result<Key<T>> put(T obj)
Specified by:
put in interface AsyncObjectify
See Also:
Objectify.put(Object)

put

public <T> Result<java.util.Map<Key<T>,T>> put(java.lang.Iterable<? extends T> objs)
Specified by:
put in interface AsyncObjectify
See Also:
Objectify.put(Iterable)

put

public <T> Result<java.util.Map<Key<T>,T>> put(T... objs)
Specified by:
put in interface AsyncObjectify
See Also:
Objectify.put(Object...)

delete

public Result<java.lang.Void> delete(java.lang.Object... keysOrEntities)
Specified by:
delete in interface AsyncObjectify
See Also:
Objectify.delete(Object...)

delete

public <T> Result<java.lang.Void> delete(java.lang.Class<T> clazz,
                                         long id)
Specified by:
delete in interface AsyncObjectify
See Also:
Objectify.delete(Class, long)

delete

public <T> Result<java.lang.Void> delete(java.lang.Class<T> clazz,
                                         java.lang.String name)
Specified by:
delete in interface AsyncObjectify
See Also:
Objectify.delete(Class, String)

delete

public Result<java.lang.Void> delete(java.lang.Iterable<?> keysOrEntities)
Specified by:
delete in interface AsyncObjectify
See Also:
Objectify.delete(Iterable)

query

public <T> Query<T> query()
Not currently part of the AsyncObjectify api, but the actual logic lives here.


query

public <T> Query<T> query(java.lang.Class<T> clazz)
Not currently part of the AsyncObjectify api, but the actual logic lives here.


getTxn

public com.google.appengine.api.datastore.Transaction getTxn()
Not currently part of the AsyncObjectify api, but the actual logic lives here.


getAsyncDatastore

public com.google.appengine.api.datastore.AsyncDatastoreService getAsyncDatastore()
Description copied from interface: AsyncObjectify
Get the raw AsyncDatastoreService

Specified by:
getAsyncDatastore in interface AsyncObjectify

getFactory

public ObjectifyFactory getFactory()
Not currently part of the AsyncObjectify api, but the actual logic lives here.


sync

public Objectify sync()
Description copied from interface: AsyncObjectify
Get the synchronous version of Objectify.

Specified by:
sync in interface AsyncObjectify


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1