Yep,
template.save(new MyRel(start,end,type,otherProps));
Michael
Am 15.05.2012 um 22:55 schrieb Tero Paananen:
>> It only has an caveat, as in neo4j the uniqueness only looks at the index-key-value
>> combination, neither on rel-type, start or end-node.
>
> Yep.
>
>> You can use template.createEnttiyFromStoredState() to get your entity from the relationship.
>>
>> You can also use @Indexed(unique=true) inside the rel-entity and just do template.save(myRel)
>
> In this case, how do I deal with the start and end nodes?
>
you have annotated fields in your relationship-entity:
@StartNode StartEntity start;
@EndNode EndEntity end;
you can/should also set type on @RelationshipEnttiy(type=...)
or
@RelType String type;
Michael