Hi,
It is possible,

Just set field for in and out links to be the not null LINK type.
So if you will add more than one edge you will have exception "Type of
field provided in schema '" + prop.getType() + " can not be used for
creation to hold several links."  It is IllegalStateException but I will
change it  to OValidationException (I even did not expect that it will be
useful )) ). if you will not have edge at all you will have
OValidationException exception "The field '" + p.getFullName() + "' cannot
be null"



On Fri, Feb 21, 2014 at 1:11 AM, Barry Dahlberg <barry.dahlb...@n4l.co.nz>wrote:

> Hi,
>
> Using the graph database, is there any way to define an edge that must be
> present? For example consider a simple blog schema:
>
>   create class Post extends V
>   create class Comment extends V
>   create class About extends E
>
> Here we want to enforce that a Comment must be about *exactly one* Post.
> In traditional SQL this would be a simple foreign key. In Orient I can set
> up the property types and a unique index on the About edge to make sure
> there is never more than one, but I can't see any way to require that at
> least one is there. Is this possible?
>
> Perhaps I am going about this the wrong way, is this something the graph
> DB is designed to deal with?
>
> Thanks
> ~
>
> --
>
> ---
> 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-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

-- 

--- 
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-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to