orientdb-odm icon indicating copy to clipboard operation
orientdb-odm copied to clipboard

Returning the object's RID upon INSERTion

Open odino opened this issue 12 years ago • 4 comments

Serious issues: when we do an insert, there is no way to get the RID of the inserted record.

This means that if you need to insert and then output the RID or just insert and then link the inserted object to another record with a link, you need to do an extra query.

~~I think~~ OrientDB supports returning the RID when you do an INSERT, so lets add this capability,

~~if not, we should talk to @lvca and request for this feature (I seriously doubt its missing)~~

odino avatar Jan 08 '13 07:01 odino

OrientDB already supports it.

lvca avatar Jan 08 '13 07:01 lvca

thanks for clarifying man, I wasnt 100% sure

odino avatar Jan 08 '13 07:01 odino

i'm also facing with this problem for the persistence part.

The problem is that for now only for the "select" command we'll wait for Return

public function shouldReturn()
    {
        if ($this->getCommand() instanceOf Select) {
            return true;
        }
        ...

davidino avatar Jan 11 '13 11:01 davidino

@davidino, why not implements a ReturningCommand interface for Select and Insert ?

Then we can do an instanceOf ReturningCommand

odino avatar Jan 13 '13 13:01 odino