I agree. It looks like we first of all need some algorithm of key generation for new objects, and it does not necessarily have to be involved with DDL. The first suggestion that comes to my mind on that matter is, obviously, marking some method of the class persisted with magical annotation - so that the value will be able to supply its own key when needed.
Alex 2016-07-21 17:11 GMT+03:00 Sergi Vladykin <sergi.vlady...@gmail.com>: > I think these problems we need to solve regardless of DDL. > > Sergi > > On 21 июля 2016 г., 16:40, Alexey Goncharuk <alexey.goncha...@gmail.com> > wrote: > >> Suppose I have a PersonKey {int id;} class and Person {@SqlQueryField int >> id; @SqlQueryField String name; @SqlQueryField int age;} class. >> >> How would an insert statement look like? >> INSERT INTO Person (_key, _val) values (...) >> INSERT INTO Person (_key, _val, id, name, age) values (...) -> Obviously >> will not be usable from any console unless we are able to parse "new >> PersonKey(1)" statements. >> >> INSERT INTO Person (id, name, age) values (...) -> How do we know how to >> construct the PersonKey? Most likely I am missing something, but this is >> not clear for me so far. >>