Hi,
I'm quite new to JDO and wanted to ask if it is possible to filter using complex objects. I know that you can do something like this:
Query q = pm.newQuery(MyClass.class, "field1 < value");
q.declareParameters("int value");
List results = q.execute(205);
Iterator iter = results.iterator();
But assume I have the following situatio...
What exception would google app engine return if tried to add data in datastore that is already full?
...
I'm implementing a frontpage with "hot" stories based on a certain ranking algorithm. However, I can't figure out how to pass Appengine's datastore my own sort function (like I can in python with sort(key=ranking_function)). I want something like this:
class Story(db.Model):
user = db.ReferenceProperty(User)
text = db.TextProp...
I was going to CSV based export/import for large data with app engine. My idea was just simple.
First column of CSV would be key of entity.
If it's not empty, that row means existing entity and should overwrite old one.
Else, that row is new entity and should create new one.
I could export key of entity by adding key property.
clas...
Is there any way to query GAE datastore with filter similar to SQL LIKE statement? For example, if a class has a string field, and I want to find all classes that have some specific keyword in that string, how can I do that?
It looks like JDOQL's matches() don't work... Am I missing something?
Any comments, links or code fragments are ...
I am using GAE(Java) with JDO for persistence.
I have an entity with a Enum field which is marked as @Persistent and gets saved correctly into the datastore (As observed from the Datastore viewer in Development Console). But when I query these entities putting a filter based on the Enum value, it is always returning me all the entities ...
Background
So let's say I'm making app for GAE, and I want to use API Hooks.
BIG EDIT: In the original version of this question, I described my use case, but some folks correctly pointed out that it was not really suited for API Hooks. Granted! Consider me helped. But now my issue is academic: I still don't know how to use hooks in ...
I'm trying to test the efficiency of the Google App Engine Datastore database. I want to know how fast it will query over a large dataset. And by large, I mean like 5-10mil entities of the same kind.
The devserver only lets me input 1000 entities of the same kind. Is there a way to up this limit? Thanks
...
This query works:
item = db.GqlQuery("SELECT * FROM Item WHERE CSIN = 13")[0]
although if there are no results returned, it blows up in my face. (How can I get around this? A for loop seems dubious when I want at max one iteration.)
This query does not work:
item = db.GqlQuery("SELECT * FROM Item WHERE CSIN = :1", CSIN)[0]
CSIN is...
Perhaps I'm missing something simple, as I believe that this is a common scenario...
When I am working with an object retrieved from the datastore, I want to detect any changes to the object and update the memcache. In a non-JDO scenario this would be easy, as any data logic layer would intercept all updates and thus have a chance to u...
I'd like to determine what place a particular entry is in, but the appropriate GQL query is escaping me. Ideally I'd like to know the following details, which seem like they should be known by the datastore. I just can't seem to figure how to determine it. Can someone help?
the placement of a particular entry (in a given sorting, i....
I have models set up as the following:
class Day(db.Model):
date = db.DateProperty()
total = db.FloatProperty()
class Event(db.Model):
desc = db.StringProperty()
amount = db.FloatProperty()
The hierarchy is as such: User > Day > Event (Users have Days. Days have Events.)
When a user logs in I want to select their day...
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. I've been reading up on it and it does seem attractive.
What I want to know is, if anyone ha...
Suppose I have
class Foo(db.Model):
bar = db.ReferenceProperty(Bar)
foo = Foo.all().get()
Is there a way for me to do foo.bar without a query being made to Datastore? The docs say that foo.bar will be an instance of Key, so I would expect to be able to do foo.bar.id() and be able to get the id of the Bar that's associated with foo...
I created one table in Google App Engine .I stored and retrieved data from Google App Engine.
But i don't know how to delete data from Google App Engine datastore.
...
I need to update a record in the datastore, but instead of updated record I get always a new record.
My model:
class PageModel(db.Model):
title = db.StringProperty()
content = db.TextProperty()
reference = db.SelfReferenceProperty()
user = db.UserProperty(auto_current_user = True)
created = db.DateTimeProperty...
What is the architecture used to store the index in the DB by Google and how many tables does Google maintain for indexing?
...
I am trying to load the full object graph for User, which contains a
collection of decks, which then contains a collection of cards, as
such:
User:
@PersistenceCapable(detachable = "true")
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
@FetchGroup(name = "decks", members = { @Persistent(name =
"_Decks") })
public ab...
Select all records, ID which is not in the list
How to make like :
query = Story.all()
query.filter('ID **NOT IN** =', [100,200,..,..])
...
What advantage is there to designing child-parent relationships, which allow us to do writes in transactions, when there is never a real concern for consistency and contention and those sort of more complex issues? Does it make writes and reads faster?
Consider my situation where there are many .png images that are referenced to one mos...