objectify

How to access GAE datastore with Objectify and service account credentials?

孤街醉人 提交于 2019-12-13 04:27:17
问题 Is it possible for one GAE application to access the datastore of another GAE application (both applications are hosted under the same Google account) using Objectify? If so, how can I pass service account credentials to Objectify (which API calls)? 回答1: It is not possible . Objectify is a very simple and convenient lightweight ORM that sits on top of a GAE Datastore , thus shielding the developer from most of the complexities of using JDO/JPA. Nowhere in the documentation have I seen the

Executing DISTINCT query with objectify for app engine

旧巷老猫 提交于 2019-12-12 16:45:43
问题 Given the following two tables, how do I write/execute the following query in objectify: SELECT DISTINCT(authorId) FROM Book ORDER BY date DESCENDING LIMIT 30. @Entity Book{ @Id private Long bookId;//auto generated private Key<Author> authorKey; private String title; private Date date; … } @Entity Author{ @Id private Long authorId;//auto generated private String name; … } Note that all I am looking for in my result is a list of authorIds, as in public List<Long> getActiveAuthors(){ ..

Editing Collections with GWT Editors and RequestFactory

帅比萌擦擦* 提交于 2019-12-12 10:07:25
问题 See the orignal question for context. Additional Context: Objectify-Appengine is used for persistence. FormProxy and QuestionProxy are of type EntityProxy QuestionDataProxy and its subtypes are of type ValueProxy All Editors implement HasRequestContext , and in the case of QuestionData subtype Editors, HasRequestContext.setContext() is called explicitly from the parent. The first problem has to do with Collections, and the second has to do with Polymorphic types. I'm not sure if the problem

Cron job run on time but failure to execute ofy().load().type()… query any configure i require in appengine.xml

会有一股神秘感。 提交于 2019-12-12 02:39:15
问题 I working on project using java on GAE. I used cron job for some remainders. I set time for cron job once a day. GAE run cron job at time but my cron job Implementation class execute on stating 4 5 lines only after 5 lines there is ofy code hat is not executed why? bellow is my code My appengine-web.xml:- <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>evadev014</application> version>9</version> <threadsafe>true</threadsafe> <instance-class>F4_1G</instance-class> <

Objectify DatastoreNeedIndexException error on Order

南楼画角 提交于 2019-12-12 02:08:39
问题 When I try to run the following line List<MessageEntity> list = ObjectifyService.ofy() .load() .type(MessageEntity.class) .ancestor(Key.create(groupKey)) .order("dateSent") .list(); I get the following error message: "com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found. recommended index is:\n- kind: MessageEntity\n ancestor: yes\n properties:\n - name: dateSent\n\nThe suggested index for this query is:\n \n \n \n\n" If I remove the .order("dateSent") line

Error using Filter and Projection in Objectify Google Datastore

こ雲淡風輕ζ 提交于 2019-12-12 00:10:12
问题 I am trying to execute the below query using Objectify 5.1.8 :- Query<Coupon> coupons = ObjectifyService.ofy().load().type(Coupon.class).filter("rewardPoints !=", "").project("code").distinct(true); for (Coupon coupon : coupons) { out.write(coupon.getCode()); } It is giving me an error : java.lang.IllegalArgumentException: Inequality filter on rewardPoints must also be a group by property when group by properties are set. Basically, what I wish to achieve is to perform a filter and project

Can I persist child objects in @PrePersist handler of a parent class? (Objectify 3.1b1)

[亡魂溺海] 提交于 2019-12-11 20:26:09
问题 I am new to Objectify and trying to implement One-to-Many relationship. I have entities Organization and entity Person . Organization has @Transient property List< Person > contactPeople . Class Person has @Parent property Key< Organization > organizationKey which I can set via setter. I'd like to persist contactPeople in @PrePersist handler of Organization. In order to do that I need to set parent key in Person. Wiki here says: "You can't update @Id or @Parent fields in a @PrePersist

GWT pass Objectify Cursor from Server to Client with RequestFactory and show more pages in DataGrid

眉间皱痕 提交于 2019-12-11 11:41:59
问题 I am brand new to cursors and have the following method: public List<Venue> findPage(Subject subject, Objectify ofy, int pageSize) { final Business business = (Business) subject.getSession().getAttribute(BUSINESS_ATTRIBUTE); final Query<Venue> query = ofy.query(Venue.class).filter(BUSINESS_ATTRIBUTE, business); final String encodedCursor = (String) subject.getSession().getAttribute(VENUE_CURSOR_CONDITION); if (encodedCursor != null) { query.startCursor(Cursor.fromWebSafeString(encodedCursor))

JsonMappingException: How to transfert a Objectify Entity (with Key) through Restlet

橙三吉。 提交于 2019-12-11 11:37:31
问题 I am developping an Android Application, comunicating with a GAE server + Objectify DB. I choose Restlet for rest framework. I have a problem when I try to retrieve an Entity with a Key attribute. The server throws an error: org.codehaus.jackson.map.JsonMappingException: Direct self-reference leading to cycle (through reference chain: java.util.ArrayList[0]->com.my.model.MyMessage["senderKey"]->com.googlecode.objectify.Key["root"]) Here is my model (very simple): public class MyMessage

Safe embedded entity with objectify

别说谁变了你拦得住时间么 提交于 2019-12-11 10:37:31
问题 I have two entities. @Entity public class Recipe { @Id private Long id; private List<Step> steps; } @Entity public class Step { @Id private Long id; private String instruction; } And the following Clound Endpoint @ApiMethod( name = "insert", path = "recipe", httpMethod = ApiMethod.HttpMethod.POST) public Recipe insert(Recipe recipe) { ofy().save().entities(recipe.getSteps()).now(); //superfluous? ofy().save().entity(recipe).now(); logger.info("Created Recipe with ID: " + recipe.getId());