That is because every next is validated against its type. The type (as Java class name) is stored in a "_CLASS_" property of the node. If it does not fit to the given type (using is assignablefrom) , null is returned.
If you want to exclude the null results append ".filter(_ != null)" to toList or add the class property to the Cypher query.
This is not very convenient but should work.
Best Christopher
Hi Chistopher,
The collection seems to be fulled with the item, but i'm not able to
find a way to recover the queried item.
This should work:
"be able to execute (*) query" in {
val query = """start n=node(*) where n.name?="Neo" return n"""
val typedResult = query.execute.asCC[Test_Matrix]("n")
typedResult.toList.size must be_>(0)
typedResult.hasNext must beTrue
typedResult.next must not beNull
success
}
hasNext assertion passes, but next returns null and the test fails.
What i'm doing wrong?
Thanks a lot for your help :)
---
Salut,
====================================
Ricardo Borillo Domenech
http://xml-utils.com / http://twitter.com/borillo
On Thu, Jan 31, 2013 at 11:54 AM, Christopher Schmidt
<fako...@gmail.com> wrote:
> I've added an additional test case, which works for me (although the 1st
> result is null). See
> https://github.com/FaKod/neo4j-scala/commit/0e46de14897dcc5ad19419bfc017375e05d6e286
>
> Can you play around with this testcase a little by executing mvn install?
>
>
> On Thu, Jan 31, 2013 at 7:26 AM, Ricardo Borillo <bor...@gmail.com> wrote:
>>
>> Hi,
>>
>> Yes i do, but the example is not working when you specify * instead of an
>> existing I'd reference .... * value works fine in the shell but it doesn't
>> work through the API :/
>>
>> Best regards,
>> Ricardo
>>
>> El 31/01/2013, a las 06:23, Christopher Schmidt <fako...@gmail.com>
>> escribió:
>>
>> Have you had a look at:
>> https://github.com/FaKod/neo4j-scala/blob/0.2.0-M/src/test/scala/org/neo4j/scala/unittest/CypherTest.scala
>>
>> The test works fine for me. The neo4j-scala Cypher implementation is more
>> or less a direct delegation to the Java one.
>>
>> best Christopher
>>
>> On Wed, Jan 30, 2013 at 6:47 PM, Ricardo Borillo <bor...@gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> Ok. Now is not crashing using
>>> SingletonEmbeddedGraphDatabaseServiceProvider, but the mapping with
>>> the case clase is not working.
>>> The result now is List(null) :'(
>>>
>>> Thanks for your help :)
>>> ---
>>> Salut,
>>> ====================================
>>> Ricardo Borillo Domenech
>>> http://xml-utils.com / http://twitter.com/borillo
>>>
>>>
>>> On Wed, Jan 30, 2013 at 6:30 PM, Christopher Schmidt <fako...@gmail.com>
>>> wrote:
>>> > That's because you are using the REST provider (should work with the
>>> > local
>>> > one).
>>> >
>>> > I will try to have a look at it tomorrow.
>>> >
>>> > Christopher
>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> >> Groups
>>> >> "neo4j-scala" group.
>>> >> To unsubscribe from this group and stop receiving emails from it, send
>>> >> an
>>> >> email to neo4j-scala...@googlegroups.com.
>>> >> To post to this group, send email to neo4j...@googlegroups.com.
>>> >> For more options, visit https://groups.google.com/groups/opt_out.
>>> >>
>>> >>
>>
>>
>