Sameer
Sameer

Reputation: 23

Nosqlunit-neo4j unable to assign label to Node in Spring Data Neo4j 4

It seems that Nosqlunit-neo4j is not compatible with SDN 4 since TypeRepresentationStrategy is removed. It adds the node defined in following graphml xml file into test database but doesn't assign it a label due to which repository.count() returns 0. However, if I query the database natively, then it does fetches the node without any Label.

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
    <key id="__type__" for="node" attr.name="__type__" attr.type="string"></key>
    <key id="productId" for="node" attr.name="productId" attr.type="string"></key>

    <graph id="G" edgedefault="directed">
        <node id="3">
            <data key="__type__">com.my.package.Product</data>
            <data key="productId">100001235</data>
            <index name="__types__" key="className">com.my.package.Product
            </index>
        </node>
    </graph>
</graphml>

Does anyone facing the same issue?

Upvotes: 1

Views: 46

Answers (1)

Michael Hunger
Michael Hunger

Reputation: 41706

If you use the label Product directly it should work. You don't need the index or the __type__ properties anymore.

Upvotes: 1

Related Questions