[Frames] Accessing ID

113 views
Skip to first unread message

Harald Wellmann

unread,
Jan 26, 2012, 7:09:26 AM1/26/12
to gremli...@googlegroups.com
I'm trying to access the ID of a framed Neo4j vertex like this

public interface User extends VertexFrame {

@Property("id")
Long getId();
}

but I only get null.

It seems I need to call user.asVertex().getId().

Seeing that Neo4jElement already has some special handling for the "id"
property in setProperty(), wouldn't it make sense to treat "id" as a
read-only property and return the underlying node id from the invocation
handler?

Cheers,
Harald


Marko Rodriguez

unread,
Jan 26, 2012, 9:39:47 AM1/26/12
to gremli...@googlegroups.com
Hi Harald,

"id" is a reserved property in Blueprints. If you want to get the underlying graph id, then use:

user.asVertex().getId()

Would you like me to add getId() as a method to VertexFrame and EdgeFrame?

Marko.

http://markorodriguez.com

Harald Wellmann

unread,
Jan 26, 2012, 10:17:39 AM1/26/12
to gremli...@googlegroups.com
Am 26.01.2012 15:39, schrieb Marko Rodriguez:
> Hi Harald,
>
> "id" is a reserved property in Blueprints. If you want to get the underlying graph id, then use:
>
> user.asVertex().getId()
>
> Would you like me to add getId() as a method to VertexFrame and EdgeFrame?

Yes, that would be handy. Saves a level of delegation in the method
call. And when there's no obvious domain-level ID, there's no need to
invent one...

Thanks,
Harald

Marvin Froeder

unread,
Apr 21, 2014, 9:09:33 PM4/21/14
to gremli...@googlegroups.com
I like this getId() idea as well.

On Thursday, January 17, 2013 5:38:26 AM UTC-2, Tom Blauwiesel wrote:
Hello,

a year later, I have the same Problem like Harald. I want to access the Id from a framed Vertex/Edge.
Was the idea to add a "getId()" Method rejected? I think it would make the work with a FramedGraph and a KeyIndexableGraph easier.

Best regards,
Tom
Reply all
Reply to author
Forward
0 new messages