Can rid #0:0 ever exist? Can I assume this to be null RID?

70 views
Skip to first unread message

Chris Waldron

unread,
Jul 5, 2015, 2:16:33 AM7/5/15
to orient-...@googlegroups.com
Can the rid #0:0 ever exist?  Can I assume rid #0:0 to be "null" for the purpose of defining RIDs?

Cheers,
Chris.

Chris Waldron

unread,
Jul 9, 2015, 2:09:13 AM7/9/15
to orient-...@googlegroups.com
The reason I asked this question is that the C# driver uses (-1, -1) as the default RID.  I wanted to rework the C# driver to make the Orid a struct rather than a class.  In C# a struct is a value type and is never null with the values defaulted to null or zero.  Thus the default Orid is (0,0).  I wanted to know if that would break anything.  However after making the proper changes and running the unit tests, I was able to achieve the same unit tests outcomes thus verify that I can use #0:0 as the empty or null rid.

Cheers,
Chris

Luca Garulli

unread,
Jul 9, 2015, 2:54:11 AM7/9/15
to orient-...@googlegroups.com
Actually record #0:0 contains the database metadata. A Null RID is #-1:-1.

Best Regards,

Founder & CEO


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Waldron

unread,
Jul 10, 2015, 3:57:11 AM7/10/15
to orient-...@googlegroups.com
I understand this is how it has always been and probably won't be modified as it would be a breaking change but #0:0 really should be the Null RID.  Using #0;0 as Null RID would enable the use of value types. 

Cheers,
Chris.
Reply all
Reply to author
Forward
0 new messages