google-code-export / appengine-jruby

Automatically exported from code.google.com/p/appengine-jruby
0 stars 0 forks source link

Add support for entity groups #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There should be a way to specify entity groups. Probably a custom, key Type 
called Parent

Original issue reported on code.google.com by rib...@gmail.com on 9 Jun 2009 at 5:43

GoogleCodeExporter commented 9 years ago

Original comment by rib...@gmail.com on 9 Jun 2009 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by rib...@gmail.com on 26 Jul 2009 at 1:01

GoogleCodeExporter commented 9 years ago

Original comment by rib...@gmail.com on 26 Jul 2009 at 1:02

GoogleCodeExporter commented 9 years ago
How about entity-group feature?

I think to use entity.key.id for serial-id is bad idea.
entity.key.id is not unique in a Kind with entity-group feature.
entity.key.id is unique in entries has a common parent.

I tried with low-level API.
example code is attached.

% appcfg.rb run dm_serial.rb
"delete all.."
"delete all.."
["should be blank:", [], []]

=(low level api)=========================
["Parents", Parents(11355), "P1"]
["Parents", Parents(11356), "P2"]
["Children", Parents(11355)/Children(11357), "C3"]
["Children", Parents(11355)/Children(11358), "C4"]
["Children", Parents(11356)/Children(11357), "C5"]
["Children", Parents(11356)/Children(11359), "C6"]

=(datamapper)============================
[#<Parent @sid=11355 @nickname="P1">, "Parents(11355)", nil]
[#<Parent @sid=11356 @nickname="P2">, "Parents(11356)", nil]
[#<Child @sid=11357 @nickname="C3">, "Parents(11356)/Children(11357)", 
Parents(11356)]
[#<Child @sid=11358 @nickname="C4">, "Parents(11355)/Children(11358)", 
Parents(11355)]
[#<Child @sid=11357 @nickname="C3">, "Parents(11356)/Children(11357)", 
Parents(11356)]
[#<Child @sid=11359 @nickname="C6">, "Parents(11356)/Children(11359)", 
Parents(11356)]

Original comment by sasaki.t...@gmail.com on 13 Dec 2009 at 8:00

Attachments:

GoogleCodeExporter commented 9 years ago
this is new adapter with :
 - use entity-key-string for key
 - create entity with parent-entity
 - create entity with id or name
 - entity-group transaction

Original comment by sasaki.t...@gmail.com on 19 Dec 2009 at 1:28

Attachments:

GoogleCodeExporter commented 9 years ago
I'm not actually an official developer, so take this with a grain of salt, 
but...

Two things jump out at me about this patch.

First, it's not actually a patch. When I download the latest code from hg and 
run a 
diff myself, I see tons of stuff has changed since then. It's hard to tell 
right away 
which changes you actually intended, and which you didn't. A fork might be 
easier, 
depending on the situation, but at least a patch.

Second, what is the purpose of LowDS? Aside from build, it seems to be 
basically 
shortcuts to the AppEngine::Datastore API, and directly to the Java API. I 
don't see 
where the Java API is needed, and the shortcuts in some cases make things less 
readable -- what is 'tx'?

Just my two cents.

Original comment by ninja@slaphack.com on 27 Dec 2009 at 8:50

GoogleCodeExporter commented 9 years ago
Sorry to my poor stuffs.

I created new datastore library project on GitHub.
http://github.com/takeru/tiny_ds
 - CRUD like a ActiveRecord or DataMapepr
 - set parent, key, id, name, and find by these, YES entity-group-transaction!!
 - BASE transaction :
http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine
 - query : very thin wrapper of low level API.
 - Shout demo app. (sinatra)
 - some specs..

Original comment by sasaki.t...@gmail.com on 30 Dec 2009 at 1:06