Syncleus / Ferma

An ORM / OGM for the TinkerPop graph stack.

Home Page:http://syncleus.com/Ferma

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to add keyValues on Edge and Vertex Creation

kevmegforest opened this issue · comments

I've got a bug with fields which are mandatory for classes.

I'm trying to create an Edge on an existing vertex using

        edgeHasCalculs= COP_Vertex.addEdgeToExistingVStoreLocation(storeVertex, calculs.INITIALIZER_EHasCalculs);
        edgeHasCalculs.setTypeCalcul(classOf[VCOP].getSimpleName);
        edgeHasCalculs.setTimespan(timespan);
        edgeHasCalculs.setEnd_Date(endDate.toDate());

It fails at the first line, because of :
"The field 'EHasCalculs.Timespan' is mandatory, but not found on record: EHasCalculs{out:#-1:-2,in:#21:2}"

I would need to be able to specify the keyValues on creation of the baseEdge so that when it goes in the delegatingFrameGraph, the classInitializer or an other way be able to specify keyValues in this function.

public <T> T addFramedEdge(final VertexFrame source, final VertexFrame destination, final String label, final ClassInitializer<T> initializer, final Object... keyValues) {

        final Edge baseEdge = source.getElement().addEdge(label, destination.getElement(), keyValues);
        final T framedEdge = frameNewElement(baseEdge, initializer);
        return framedEdge;

    }

I'm using the annotation methods:

@Incidence(label = "EHasCalculs", direction = Direction.OUT)
	public abstract <E extends AbstractEdgeFrame> E addEdgeToExistingVStoreLocation(VStoreLocation son, ClassInitializer<? extends E> edgeInitializer);

Thanks